This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] Wait for target to stop before running agent commands
- From: Gary Benson <gbenson at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Pedro Alves <palves at redhat dot com>, Doug Evans <dje at google dot com>
- Date: Thu, 18 Sep 2014 10:59:06 +0100
- Subject: [PATCH 3/3] Wait for target to stop before running agent commands
- Authentication-results: sourceware.org; auth=none
- References: <1411034346-868-1-git-send-email-gbenson at redhat dot com>
This commit fixes a bug on where agent_run_command is called on
GNU/Linux targets that may not have stopped yet.
gdb/ChangeLog:
* linux-nat.c (linux_child_static_tracepoint_markers_by_strid):
Use target_stop_and_wait in place of target_stop.
---
gdb/ChangeLog | 5 +++++
gdb/linux-nat.c | 2 +-
2 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 5a82d23..f2895ff 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4458,7 +4458,7 @@ linux_child_static_tracepoint_markers_by_strid (struct target_ops *self,
ptid_t ptid = ptid_build (pid, 0, 0);
/* Pause all */
- target_stop (ptid);
+ target_stop_and_wait (ptid);
memcpy (s, "qTfSTM", sizeof ("qTfSTM"));
s[sizeof ("qTfSTM")] = 0;
--
1.7.1