* gdb-events.sh: Add target-changed event.
authorKeith Seitz <keiths@redhat.com>
Wed, 21 Aug 2002 15:34:36 +0000 (15:34 +0000)
committerKeith Seitz <keiths@redhat.com>
Wed, 21 Aug 2002 15:34:36 +0000 (15:34 +0000)
        * 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.

gdb/ChangeLog
gdb/gdb-events.c
gdb/gdb-events.h
gdb/gdb-events.sh
gdb/valops.c

index 5309af6fa45ae0e6fe242cd9d31883913af788d0..e462110b3824b3bc2c2676e52362d511b0acc6f3 100644 (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
index 0912e651190c8d1458101621fe54e3545b5ba606..3acccf11dc706e59945aa65fbed7075d879eaa79 100644 (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,
index 67868184b0ffa3149b917dd301337bdf59031bba..daba6a4463a079eba50dfb5861b64263ce56603b 100644 (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. */
index 2872b99c48c85998d13a4bf58b72a443ba4b3591..e92a71460ec7348808133b3a9c263c8e1abf2a73 100755 (executable)
@@ -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
index d7c889fc4e7881baeaa4d0f8d1f893133bb22862..569c85b62cd28b5a21505ae00b3f6542caa9a5c6 100644 (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;