aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2001-08-11 00:41:02 +0000
committerKeith Seitz <keiths@redhat.com>2001-08-11 00:41:02 +0000
commit67c2c32c6b30dd3690964884a46b39cc6ee27486 (patch)
treeff94c6dfcb0b0766f6bd0d86630c1e45261761be /gdb
parentc5745c877823a4c057c1f3a952a2e9fbce69354f (diff)
downloadgdb-67c2c32c6b30dd3690964884a46b39cc6ee27486.zip
gdb-67c2c32c6b30dd3690964884a46b39cc6ee27486.tar.gz
gdb-67c2c32c6b30dd3690964884a46b39cc6ee27486.tar.bz2
* 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.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/gdb-events.c23
-rw-r--r--gdb/gdb-events.h4
-rwxr-xr-xgdb/gdb-events.sh1
-rw-r--r--gdb/gdbarch.c5
-rwxr-xr-xgdb/gdbarch.sh5
6 files changed, 45 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 25d3233..b6775a4 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+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.
+
2001-08-10 Michael Snyder <msnyder@redhat.com>
* regcache.c (legacy_write_register_gen): Don't 'optimize out'
diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c
index d118108..0fbb3ba 100644
--- a/gdb/gdb-events.c
+++ b/gdb/gdb-events.c
@@ -111,6 +111,16 @@ tracepoint_modify_event (int number)
current_event_hooks->tracepoint_modify (number);
}
+void
+architecture_changed_event (void)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "architecture_changed_event\n");
+ if (!current_event_hooks->architecture_changed)
+ return;
+ current_event_hooks->architecture_changed ();
+}
+
#endif
#if WITH_GDB_EVENTS
@@ -134,6 +144,7 @@ enum gdb_event
tracepoint_create,
tracepoint_delete,
tracepoint_modify,
+ architecture_changed,
nr_gdb_events
};
@@ -249,6 +260,14 @@ queue_tracepoint_modify (int number)
append (event);
}
+static void
+queue_architecture_changed (void)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = architecture_changed;
+ append (event);
+}
+
void
gdb_events_deliver (struct gdb_events *vector)
{
@@ -294,6 +313,9 @@ gdb_events_deliver (struct gdb_events *vector)
vector->tracepoint_modify
(event->data.tracepoint_modify.number);
break;
+ case architecture_changed:
+ vector->architecture_changed ();
+ break;
}
delivering_events = event->next;
xfree (event);
@@ -312,6 +334,7 @@ _initialize_gdb_events (void)
queue_event_hooks.tracepoint_create = queue_tracepoint_create;
queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
+ queue_event_hooks.architecture_changed = queue_architecture_changed;
#endif
c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h
index 7d0d86f..18a4a20 100644
--- a/gdb/gdb-events.h
+++ b/gdb/gdb-events.h
@@ -57,6 +57,7 @@ typedef void (gdb_events_breakpoint_modify_ftype) (int b);
typedef void (gdb_events_tracepoint_create_ftype) (int number);
typedef void (gdb_events_tracepoint_delete_ftype) (int number);
typedef void (gdb_events_tracepoint_modify_ftype) (int number);
+typedef void (gdb_events_architecture_changed_ftype) (void);
/* gdb-events: object. */
@@ -69,6 +70,7 @@ struct gdb_events
gdb_events_tracepoint_create_ftype *tracepoint_create;
gdb_events_tracepoint_delete_ftype *tracepoint_delete;
gdb_events_tracepoint_modify_ftype *tracepoint_modify;
+ gdb_events_architecture_changed_ftype *architecture_changed;
};
@@ -81,6 +83,7 @@ extern void breakpoint_modify_event (int b);
extern void tracepoint_create_event (int number);
extern void tracepoint_delete_event (int number);
extern void tracepoint_modify_event (int number);
+extern void architecture_changed_event (void);
/* When GDB_EVENTS are not being used, completly disable them. */
@@ -92,6 +95,7 @@ extern void tracepoint_modify_event (int number);
#define tracepoint_create_event(number) 0
#define tracepoint_delete_event(number) 0
#define tracepoint_modify_event(number) 0
+#define architecture_changed_event() 0
#endif
/* Install custom gdb-events hooks. */
diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh
index 6c576f8..eb73465 100755
--- a/gdb/gdb-events.sh
+++ b/gdb/gdb-events.sh
@@ -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
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 40da7a4..be5cccf 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -61,6 +61,7 @@
#include "floatformat.h"
#include "gdb_assert.h"
+#include "gdb-events.h"
/* Static function declarations */
@@ -4733,6 +4734,7 @@ gdbarch_update_p (struct gdbarch_info info)
new_gdbarch->bfd_arch_info->printable_name);
current_gdbarch = new_gdbarch;
swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event ();
return 1;
}
}
@@ -4766,7 +4768,8 @@ gdbarch_update_p (struct gdbarch_info info)
registered an interest in this architecture. CURRENT_GDBARCH
must be updated before these modules are called. */
init_gdbarch_data (new_gdbarch);
-
+ architecture_changed_event ();
+
if (gdbarch_debug)
gdbarch_dump (current_gdbarch, gdb_stdlog);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 964e16f..3b0387e 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -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 info)
new_gdbarch->bfd_arch_info->printable_name);
current_gdbarch = new_gdbarch;
swapin_gdbarch_swap (new_gdbarch);
+ architecture_changed_event ();
return 1;
}
}
@@ -2099,7 +2101,8 @@ gdbarch_update_p (struct gdbarch_info info)
registered an interest in this architecture. CURRENT_GDBARCH
must be updated before these modules are called. */
init_gdbarch_data (new_gdbarch);
-
+ architecture_changed_event ();
+
if (gdbarch_debug)
gdbarch_dump (current_gdbarch, gdb_stdlog);