* 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.
This commit is contained in:
Keith Seitz 2002-08-21 15:34:36 +00:00
parent 9fb14e79f9
commit e23792ccb6
5 changed files with 41 additions and 2 deletions

View file

@ -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

View file

@ -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,

View file

@ -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. */

View file

@ -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

View file

@ -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;