aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2002-08-21 15:34:36 +0000
committerKeith Seitz <keiths@redhat.com>2002-08-21 15:34:36 +0000
commite23792ccb6d6b4e8e30e5702eaacfd5556e4ac6e (patch)
tree0613faf51d12e9373fad1f698198cd01acc302e7 /gdb
parent9fb14e79f9f0322189fb5a2ea17f9819d44fced6 (diff)
downloadgdb-e23792ccb6d6b4e8e30e5702eaacfd5556e4ac6e.zip
gdb-e23792ccb6d6b4e8e30e5702eaacfd5556e4ac6e.tar.gz
gdb-e23792ccb6d6b4e8e30e5702eaacfd5556e4ac6e.tar.bz2
* gdb-events.sh: Add target-changed event.
* gdb-events.c: Regenerated. * gdb-events.c: Regenerated. * valops.c (value_assign): Add target-changed event notification to inlval_register, lval_memory, and lval_reg_frame_relative.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog8
-rw-r--r--gdb/gdb-events.c23
-rw-r--r--gdb/gdb-events.h4
-rwxr-xr-xgdb/gdb-events.sh3
-rw-r--r--gdb/valops.c5
5 files changed, 41 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5309af6..e462110 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@
+2002-08-21 Keith Seitz <keiths@redhat.com>
+
+ * gdb-events.sh: Add target-changed event.
+ * gdb-events.c: Regenerated.
+ * gdb-events.c: Regenerated.
+ * valops.c (value_assign): Add target-changed event notification
+ to inlval_register, lval_memory, and lval_reg_frame_relative.
+
2002-08-21 Joel Brobecker <brobecker@gnat.com>
* NEWS: Add an entry regarding the improvement of the next/step
diff --git a/gdb/gdb-events.c b/gdb/gdb-events.c
index 0912e65..3acccf1 100644
--- a/gdb/gdb-events.c
+++ b/gdb/gdb-events.c
@@ -119,6 +119,16 @@ architecture_changed_event (void)
current_event_hooks->architecture_changed ();
}
+void
+target_changed_event (void)
+{
+ if (gdb_events_debug)
+ fprintf_unfiltered (gdb_stdlog, "target_changed_event\n");
+ if (!current_event_hooks->target_changed)
+ return;
+ current_event_hooks->target_changed ();
+}
+
#endif
#if WITH_GDB_EVENTS
@@ -151,6 +161,7 @@ enum gdb_event
tracepoint_delete,
tracepoint_modify,
architecture_changed,
+ target_changed,
nr_gdb_events
};
@@ -274,6 +285,14 @@ queue_architecture_changed (void)
append (event);
}
+static void
+queue_target_changed (void)
+{
+ struct event *event = XMALLOC (struct event);
+ event->type = target_changed;
+ append (event);
+}
+
void
gdb_events_deliver (struct gdb_events *vector)
{
@@ -322,6 +341,9 @@ gdb_events_deliver (struct gdb_events *vector)
case architecture_changed:
vector->architecture_changed ();
break;
+ case target_changed:
+ vector->target_changed ();
+ break;
}
delivering_events = event->next;
xfree (event);
@@ -341,6 +363,7 @@ _initialize_gdb_events (void)
queue_event_hooks.tracepoint_delete = queue_tracepoint_delete;
queue_event_hooks.tracepoint_modify = queue_tracepoint_modify;
queue_event_hooks.architecture_changed = queue_architecture_changed;
+ queue_event_hooks.target_changed = queue_target_changed;
#endif
c = add_set_cmd ("eventdebug", class_maintenance, var_zinteger,
diff --git a/gdb/gdb-events.h b/gdb/gdb-events.h
index 6786818..daba6a4 100644
--- a/gdb/gdb-events.h
+++ b/gdb/gdb-events.h
@@ -59,6 +59,7 @@ 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);
+typedef void (gdb_events_target_changed_ftype) (void);
/* gdb-events: object. */
@@ -72,6 +73,7 @@ struct gdb_events
gdb_events_tracepoint_delete_ftype *tracepoint_delete;
gdb_events_tracepoint_modify_ftype *tracepoint_modify;
gdb_events_architecture_changed_ftype *architecture_changed;
+ gdb_events_target_changed_ftype *target_changed;
};
@@ -85,6 +87,7 @@ 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);
+extern void target_changed_event (void);
/* When GDB_EVENTS are not being used, completly disable them. */
@@ -97,6 +100,7 @@ extern void architecture_changed_event (void);
#define tracepoint_delete_event(number) 0
#define tracepoint_modify_event(number) 0
#define architecture_changed_event() 0
+#define target_changed_event() 0
#endif
/* Install custom gdb-events hooks. */
diff --git a/gdb/gdb-events.sh b/gdb/gdb-events.sh
index 2872b99..e92a714 100755
--- a/gdb/gdb-events.sh
+++ b/gdb/gdb-events.sh
@@ -65,6 +65,7 @@ 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
+f:void:target_changed:void
#*:void:annotate_starting_hook:void
#*:void:annotate_stopped_hook:void
#*:void:annotate_signalled_hook:void
@@ -87,8 +88,6 @@ f:void:architecture_changed:void
#*:void:readline_begin_hook:char *format, ...:format
#*:char *:readline_hook:char *prompt:prompt
#*:void:readline_end_hook:void
-#*:void:register_changed_hook:int regno:regno
-#*:void:memory_changed_hook:CORE_ADDR addr, int len:addr, len
#*:void:context_hook:int num:num
#*:int:target_wait_hook:int pid, struct target_waitstatus *status:pid, status
#*:void:call_command_hook:struct cmd_list_element *c, char *cmd, int from_tty:c, cmd, from_tty
diff --git a/gdb/valops.c b/gdb/valops.c
index d7c889f..569c85b 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -633,6 +633,7 @@ value_assign (struct value *toval, struct value *fromval)
write_memory (changed_addr, dest_buffer, changed_len);
if (memory_changed_hook)
memory_changed_hook (changed_addr, changed_len);
+ target_changed_event ();
}
break;
@@ -678,6 +679,9 @@ value_assign (struct value *toval, struct value *fromval)
VALUE_CONTENTS (fromval), TYPE_LENGTH (type));
#endif
}
+
+ target_changed_event ();
+
/* Assigning to the stack pointer, frame pointer, and other
(architecture and calling convention specific) registers may
cause the frame cache to be out of date. We just do this
@@ -765,6 +769,7 @@ value_assign (struct value *toval, struct value *fromval)
if (register_changed_hook)
register_changed_hook (-1);
+ target_changed_event ();
}
break;