From 91f378ddd0f3c51a29190b337abd9ebd06726f0b Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Sun, 28 Jul 2024 23:25:58 -0400 Subject: gdb: pass inferior to gdbarch_update_p Make the current inferior reference bubble up one level. I think this makes it clearer what gdbarch_update_p, which is update the passed inferior's architecture (although the function name could probably be better). When gdbarch_find_by_info, it is possible for the new architecture's init callback to be called. I have not audited all of them (there are just too many), it's possible that some of them do care about the current inferior, for some reason (for instance, if one of them makes a target call). If so, they should be changed too. Change-Id: I89f012188d7fdca395a830f4b013743565f26847 --- gdb/gdbarch.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gdb/gdbarch.h') diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index 5175ef7..60a0f60 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -316,7 +316,7 @@ extern obstack *gdbarch_obstack (gdbarch *arch); extern char *gdbarch_obstack_strdup (struct gdbarch *arch, const char *string); -/* Helper function. Force an update of the current architecture. +/* Helper function. Force an update of INF's architecture. The actual architecture selected is determined by INFO, ``(gdb) set architecture'' et.al., the existing architecture and BFD's default @@ -325,8 +325,7 @@ extern char *gdbarch_obstack_strdup (struct gdbarch *arch, const char *string); Returns non-zero if the update succeeds. */ -extern int gdbarch_update_p (struct gdbarch_info info); - +extern int gdbarch_update_p (inferior *inf, gdbarch_info info); /* Helper function. Find an architecture matching info. -- cgit v1.1