diff options
author | Keith Seitz <keiths@redhat.com> | 2002-08-21 15:34:36 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2002-08-21 15:34:36 +0000 |
commit | 7c649929c9712bbf6651bf7dc17be00b0fb59a45 (patch) | |
tree | 0abac52920a37180ddf351b521ff80329089f1db /gdb | |
parent | 8f1efe6b5a9e06260344ebadb4d00ebaafd55dbc (diff) | |
download | gdb-7c649929c9712bbf6651bf7dc17be00b0fb59a45.tar.gz |
* 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/ChangeLog | 8 | ||||
-rw-r--r-- | gdb/gdb-events.c | 23 | ||||
-rw-r--r-- | gdb/gdb-events.h | 4 | ||||
-rwxr-xr-x | gdb/gdb-events.sh | 3 | ||||
-rw-r--r-- | gdb/valops.c | 5 |
5 files changed, 41 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5309af6fa45..e462110b382 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 0912e651190..3acccf11dc7 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 67868184b0f..daba6a4463a 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 2872b99c48c..e92a71460ec 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 d7c889fc4e7..569c85b62cd 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; |