aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Metzger <markus.t.metzger@intel.com>2016-06-10 14:07:22 +0200
committerMarkus Metzger <markus.t.metzger@intel.com>2016-07-06 08:31:21 +0200
commit41af4a217b5ebe9f08225afac5dd249c30002a1c (patch)
treef346f98fe242efea40870b12fb629c1d340ad442
parent037ca1addd7af2a9ba9c0fecbeb2c2af6be7c841 (diff)
downloadgdb-41af4a217b5ebe9f08225afac5dd249c30002a1c.zip
gdb-41af4a217b5ebe9f08225afac5dd249c30002a1c.tar.gz
gdb-41af4a217b5ebe9f08225afac5dd249c30002a1c.tar.bz2
record: signal a record goto stop to front-ends
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
-rw-r--r--gdb/record.c21
-rw-r--r--gdb/record.h3
2 files changed, 24 insertions, 0 deletions
diff --git a/gdb/record.c b/gdb/record.c
index ef15459..15bc722 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -343,6 +343,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)
{
ULONGEST insn;
diff --git a/gdb/record.h b/gdb/record.h
index 84440c6..8baf01c 100644
--- a/gdb/record.h
+++ b/gdb/record.h
@@ -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_ */