]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Linux gdbserver fork event debug output
authorPedro Alves <palves@redhat.com>
Thu, 6 Aug 2015 11:07:09 +0000 (12:07 +0100)
committerPedro Alves <palves@redhat.com>
Thu, 6 Aug 2015 11:07:09 +0000 (12:07 +0100)
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.

gdb/gdbserver/ChangeLog
gdb/gdbserver/linux-low.c

index 33a90e64fd3c9d10d64def7f247cab0ac2ce76a7..ac5667e99a096820cd287d36e8c57be6d9fe8b81 100644 (file)
@@ -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-07-14  Pedro Alves  <palves@redhat.com>
 
        * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
index 8c90944d5268443277408962ef6239a35ab80edc..5c78167ceec0ff935bec9fe59f24e18002a6eb8a 100644 (file)
@@ -3135,13 +3135,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
@@ -3172,6 +3165,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)