[RFC] Architecture change events

Keith Seitz
2001-08-10T13:50:00Z

Hi,

I would like some advice for how to complete this patch for submission
into the repository.

The patch simply adds an "architecture_changed" event and notification.
Problem: we need to pass a thread id around with this, but my
understanding of gdb in this area is a little deficient. It's been a long
time.

So, how do I go about figuring out what thread id to pass along with this?
(Is there even a way to do this yet?)

I dunno. Help!
Keith

Here's what I'm looking at:

ChangeLog
2001-08-10 Keith Seitz <keiths@redhat.com>

* gdb-events.sh: Add architecture_changed event.
* gdbarch.sh: Include gdb-event.h.
(gdbarch_update_p): Notify UIs when architecture changes.
* gdb-events.h: Regenerated.
* gdb-events.c: Regenerated.
* gdbarch.c: Regenerated.

Almost complete patch (notice missing thread argument)
Index: gdb-events.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdb-events.sh,v
retrieving revision 1.10
diff -u -p -r1.10 gdb-events.sh
--- gdb-events.sh 2001/08/10 16:05:30 1.10
+++ gdb-events.sh 2001/08/10 20:40:03
@@ -64,6 +64,7 @@ f:void:breakpoint_modify:int b:b
f:void:tracepoint_create:int number:number
f:void:tracepoint_delete:int number:number
f:void:tracepoint_modify:int number:number
+f:void:architecture_changed:void
#*:void:annotate_starting_hook:void
#*:void:annotate_stopped_hook:void
#*:void:annotate_signalled_hook:void
Index: gdbarch.sh
===================================================================
RCS file: /cvs/src/src/gdb/gdbarch.sh,v
retrieving revision 1.73
diff -u -p -r1.73 gdbarch.sh
--- gdbarch.sh 2001/07/10 21:24:48 1.73
+++ gdbarch.sh 2001/08/10 20:40:04
@@ -1129,6 +1129,7 @@ cat <<EOF
#include "floatformat.h"

#include "gdb_assert.h"
+#include "gdb-events.h"

/* Static function declarations */

@@ -2066,6 +2067,7 @@ gdbarch_update_p (struct gdbarch_info in
new_gdbarch->bfd_arch_info->printable_name);
current_gdbarch = new_gdbarch;
swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event (/*thread??*/);
return 1;
}
}
@@ -2099,7 +2101,8 @@ gdbarch_update_p (struct gdbarch_info in
registered an interest in this architecture. CURRENT_GDBARCH
must be updated before these modules are called. */
init_gdbarch_data (new_gdbarch);
-
+ architecture_changed_event (/*thread??*/);
+
if (gdbarch_debug)
gdbarch_dump (current_gdbarch, gdb_stdlog);