]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
record: signal a record goto stop to front-ends
authorMarkus Metzger <markus.t.metzger@intel.com>
Fri, 10 Jun 2016 12:07:22 +0000 (14:07 +0200)
committerMarkus Metzger <markus.t.metzger@intel.com>
Wed, 6 Jul 2016 06:31:21 +0000 (08:31 +0200)
The "record goto" command does not indicate the stop to front-ends.  Instead,
it prints the new location directly.

Add a function to signal a normal stop to observers and have them print the new
location.  This function temporarily switches to the stopped thread.

We use the TARGET_WAITKIND_NO_RESUMED wait status for this purpose.  This should
result in a stop notification without giving a stop reason.  We could also
invent a new wait status but this doesn't seem necessary at this point.

Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
gdb/
* record.h (record_signal_goto_stop): New.
* record.c (record_signal_goto_stop): New.

Change-Id: I0b196be68779f9e81abca78df5bc39e917023581

gdb/record.c
gdb/record.h

index ef154593e3239c15cdcdfea7df5bc3ac75d4aa35..15bc722a85633806cd474f716214e53fa4a3da46 100644 (file)
@@ -342,6 +342,27 @@ cmd_record_save (char *args, int from_tty)
 
 /* See record.h.  */
 
+void
+record_signal_goto_stop (struct thread_info *tp)
+{
+  struct target_waitstatus ws;
+  struct cleanup *cleanup;
+
+  clear_proceed_status_thread (tp);
+
+  cleanup = make_cleanup_restore_current_thread ();
+  switch_to_thread (tp->ptid);
+
+  ws.kind = TARGET_WAITKIND_NO_RESUMED;
+  set_last_target_status (tp->ptid, ws);
+
+  observer_notify_normal_stop (NULL, 1);
+
+  do_cleanups (cleanup);
+}
+
+/* See record.h.  */
+
 void
 record_goto (const char *arg)
 {
index 84440c64b993913dc7de68d2598a184b3fd22f0d..8baf01c21eb7aa6e3b7d3a071f91b8f6fbc00679 100644 (file)
@@ -91,4 +91,7 @@ extern struct target_ops *find_record_target (void);
    it does anything.  */
 extern void record_preopen (void);
 
+/* Signal a record-goto stop of TP to front-ends.  */
+extern void record_signal_goto_stop (struct thread_info *tp);
+
 #endif /* _RECORD_H_ */