[binutils-gdb] gdb: add inferior parameter to architecture_changed observable
Simon Marchi
simark@sourceware.org
Tue Oct 10 14:48:41 GMT 2023
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=97153a2bbfc59d33c1031526e63b06725862ba6b
commit 97153a2bbfc59d33c1031526e63b06725862ba6b
Author: Simon Marchi <simon.marchi@efficios.com>
Date: Fri Sep 29 14:24:36 2023 -0400
gdb: add inferior parameter to architecture_changed observable
This is to make it explicit which inferior's architecture just changed,
and that the callbacks should not assume it is the current inferior.
Update the only caller, pyuw_on_new_gdbarch, to add the parameter,
although it doesn't use it currently.
Change-Id: Ieb7f21377e4252cc6e7b1ce2cc812cd1a1840e0e
Reviewed-By: John Baldwin <jhb@FreeBSD.org>
Approved-By: Andrew Burgess <aburgess@redhat.com>
Diff:
---
gdb/arch-utils.c | 3 ++-
gdb/observable.h | 5 +++--
gdb/python/py-unwind.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 5331bd86443..b2b265a5534 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -1489,7 +1489,8 @@ set_target_gdbarch (struct gdbarch *new_gdbarch)
gdb_assert (new_gdbarch != NULL);
gdb_assert (new_gdbarch->initialized_p);
current_inferior ()->set_arch (new_gdbarch);
- gdb::observers::architecture_changed.notify (new_gdbarch);
+ gdb::observers::architecture_changed.notify (current_inferior (),
+ new_gdbarch);
registers_changed ();
}
diff --git a/gdb/observable.h b/gdb/observable.h
index 5a2144030b3..acb05e9b535 100644
--- a/gdb/observable.h
+++ b/gdb/observable.h
@@ -153,9 +153,10 @@ extern observable<struct breakpoint */* b */> breakpoint_deleted;
is the modified breakpoint. */
extern observable<struct breakpoint */* b */> breakpoint_modified;
-/* The current architecture has changed. The argument NEWARCH is a
+/* INF's architecture has changed. The argument NEWARCH is a
pointer to the new architecture. */
-extern observable<struct gdbarch */* newarch */> architecture_changed;
+extern observable<inferior */* inf */, struct gdbarch */* newarch */>
+ architecture_changed;
/* The thread's ptid has changed. The OLD_PTID parameter specifies
the old value, and NEW_PTID specifies the new value. */
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index 1856e41e2a1..f8b142dd52c 100644
--- a/gdb/python/py-unwind.c
+++ b/gdb/python/py-unwind.c
@@ -945,7 +945,7 @@ static const registry<gdbarch>::key<pyuw_gdbarch_data_type> pyuw_gdbarch_data;
intermediary. */
static void
-pyuw_on_new_gdbarch (struct gdbarch *newarch)
+pyuw_on_new_gdbarch (inferior *inf, gdbarch *newarch)
{
struct pyuw_gdbarch_data_type *data = pyuw_gdbarch_data.get (newarch);
if (data == nullptr)
More information about the Gdb-cvs
mailing list