public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Markus Metzger <markus.t.metzger@intel.com>
To: gdb-patches@sourceware.org
Cc: palves@redhat.com, marc.khouzam@ericsson.com
Subject: [PATCH 4/8] record: signal a record goto stop to front-ends
Date: Wed, 06 Jul 2016 11:56:00 -0000	[thread overview]
Message-ID: <1467806191-4320-5-git-send-email-markus.t.metzger@intel.com> (raw)
In-Reply-To: <1467806191-4320-1-git-send-email-markus.t.metzger@intel.com>

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.

2016-07-06  Markus Metzger  <markus.t.metzger@intel.com>

gdb/
	* record.h (record_signal_goto_stop): New.
	* record.c (record_signal_goto_stop): New.


---
 gdb/record.c | 21 +++++++++++++++++++++
 gdb/record.h |  3 +++
 2 files changed, 24 insertions(+)

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 84440c64..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_ */
-- 
1.8.3.1

  reply	other threads:[~2016-07-06 11:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 11:56 [PATCH 0/8] record: notify about "record goto" stop Markus Metzger
2016-07-06 11:56 ` Markus Metzger [this message]
2016-07-06 11:56 ` [PATCH 2/8] record: do not allow record goto on a running thread Markus Metzger
2016-07-06 11:57 ` [PATCH 6/8] record-full: signal record-goto stop Markus Metzger
2016-07-06 11:57 ` [PATCH 1/8] btrace: check if we're replaying when setting the replay position to the end Markus Metzger
2016-07-06 11:57 ` [PATCH 7/8] btrace-btrace: signal record-goto stop Markus Metzger
2016-07-06 11:57 ` [PATCH 3/8] infrun: export clear_proceed_status_thread Markus Metzger
2016-07-06 11:57 ` [PATCH 5/8] mi, testsuite: add another EXTRA option to mi_expect_stop Markus Metzger
2016-07-06 11:57 ` [PATCH 8/8] btrace: record stop moves to the end of the trace Markus Metzger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1467806191-4320-5-git-send-email-markus.t.metzger@intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.com \
    --cc=palves@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).