From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: [pushed][PATCH 1/3] Linux gdbserver fork event debug output (Re: [PATCH/7.10 1/2] Linux gdbserver confused when event randomization returns a process exit event)
Date: Thu, 06 Aug 2015 09:34:00 -0000 [thread overview]
Message-ID: <55C32A05.3060204@redhat.com> (raw)
In-Reply-To: <86io8weize.fsf@gmail.com>
On 08/03/2015 11:58 AM, Yao Qi wrote:
> Looks this code is dead code even without your patch. This code is
> guarded by "if (!report_to_gdb)", but if report_to_gdb is false,
> "(event_child->waitstatus.kind != TARGET_WAITKIND_IGNORE)" is false too.
>
Indeed. I've pushed this preliminary patch, to address that.
Thanks!
--------
From ad071a3055b9b47dad340c1a1cb3a9b39529cef0 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Thu, 6 Aug 2015 10:30:16 +0100
Subject: [PATCH 1/3] 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.
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/linux-low.c | 16 +++++++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 43cae40..eb1101c 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 f1e1d72..76b212d 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)
--
1.9.3
next prev parent reply other threads:[~2015-08-06 9:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-31 17:03 [PATCH/7.10 0/2] gdbserver: Fix several fork support (& co) issues Pedro Alves
2015-07-31 17:04 ` [PATCH/7.10 1/2] Linux gdbserver confused when event randomization returns a process exit event Pedro Alves
2015-08-03 10:59 ` Yao Qi
2015-08-06 9:34 ` Pedro Alves [this message]
2015-08-06 9:43 ` [pushed]Re: " Pedro Alves
2015-07-31 17:04 ` [PATCH/7.10 2/2] gdbserver: Fix non-stop / fork / step-over issues Pedro Alves
2015-07-31 18:04 ` Don Breazeal
2015-07-31 19:02 ` Pedro Alves
2015-08-05 22:19 ` Don Breazeal
2015-08-06 10:09 ` Pedro Alves
2015-08-03 15:14 ` Yao Qi
2015-08-03 16:20 ` Pedro Alves
2015-08-04 16:40 ` Pedro Alves
2015-08-05 11:41 ` Yao Qi
2015-08-05 15:10 ` Pedro Alves
2015-08-06 9:44 ` [pushed] " Pedro Alves
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=55C32A05.3060204@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.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