summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2015-08-06 10:30:16 +0100
committerPedro Alves <palves@redhat.com>2015-08-06 10:30:16 +0100
commitad071a3055b9b47dad340c1a1cb3a9b39529cef0 (patch)
treea25057c1cbc372836f8d74a743d3ea8f429089a4
parente0a3af227ee0602ae69320fd6f931c363f14975b (diff)
downloadbinutils-gdb-ad071a3055b9b47dad340c1a1cb3a9b39529cef0.tar.gz
Linux gdbserver fork event debug output
The "extended event with waitstatus" debug output is unreachable, as it is guarded by "if (!report_to_gdb)". If extended_event_reported is true, then so is report_to_gdb. Move it to where we print why we're reporting an event to GDB. Also, the debug output currently tries to print the wrong struct target_waitstatus. gdb/gdbserver/ChangeLog: 2015-08-06 Pedro Alves <palves@redhat.com> * linux-low.c (linux_wait_1): Move fork event output out of the !report_to_gdb check. Pass event_child->waitstatus to target_waitstatus_to_string instead of ourstatus.
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/linux-low.c16
2 files changed, 15 insertions, 7 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 43cae4049de..eb1101c1b3a 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2015-08-06 Pedro Alves <palves@redhat.com>
+
+ * linux-low.c (linux_wait_1): Move fork event output out of the
+ !report_to_gdb check. Pass event_child->waitstatus to
+ target_waitstatus_to_string instead of ourstatus.
+
2015-08-04 Yao Qi <yao.qi@linaro.org>
* linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index f1e1d7271d7..76b212d2398 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -3153,13 +3153,6 @@ linux_wait_1 (ptid_t ptid,
paddress (event_child->stop_pc),
paddress (event_child->step_range_start),
paddress (event_child->step_range_end));
- if (extended_event_reported (&event_child->waitstatus))
- {
- char *str = target_waitstatus_to_string (ourstatus);
- debug_printf ("LWP %ld: extended event with waitstatus %s\n",
- lwpid_of (get_lwp_thread (event_child)), str);
- xfree (str);
- }
}
/* We're not reporting this breakpoint to GDB, so apply the
@@ -3190,6 +3183,15 @@ linux_wait_1 (ptid_t ptid,
if (debug_threads)
{
+ if (extended_event_reported (&event_child->waitstatus))
+ {
+ char *str;
+
+ str = target_waitstatus_to_string (&event_child->waitstatus);
+ debug_printf ("LWP %ld: extended event with waitstatus %s\n",
+ lwpid_of (get_lwp_thread (event_child)), str);
+ xfree (str);
+ }
if (current_thread->last_resume_kind == resume_step)
{
if (event_child->step_range_start == event_child->step_range_end)