From: Simon Marchi <simon.marchi@ericsson.com>
To: <gdb-patches@sourceware.org>
Cc: Simon Marchi <simon.marchi@ericsson.com>
Subject: [PATCH 2/2] Only leave dprintf inserted if it is marked as persistent (PR breakpoints/17012)
Date: Wed, 18 Jun 2014 14:26:00 -0000 [thread overview]
Message-ID: <1403101571-1190-2-git-send-email-simon.marchi@ericsson.com> (raw)
In-Reply-To: <1403101571-1190-1-git-send-email-simon.marchi@ericsson.com>
On Linux native, if dprintf are inserted when detaching, they are left
in the inferior which causes it to crash from a SIGTRAP. It also happens
with dprintfs on remote targets, when set disconnected-dprintf is off.
I believe that the rationale of the line I modified was to leave dprinfs
inserted in order to support disconnected dprintfs. This adds a check to
see if the dprintf should actually stay inserted or not.
bl->target_info.persist will be 1 only if disconnected-dprintf is on and
we are debugging a remote target. On native, it will always be 0,
regardless of the value of disconnected-dprintf. This makes sense, since
disconnected dprintfs are not supported by the native target.
gdb/Changelog:
2014-06-18 Simon Marchi <simon.marchi@ericsson.com>
PR breakpoints/17012
* breakpoint.c (remove_breakpoints_pid): Only skip removing
dprintf if it is marked as persistent.
---
gdb/breakpoint.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 2240f08..1aa02f9 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3111,7 +3111,7 @@ remove_breakpoints_pid (int pid)
if (bl->pspace != inf->pspace)
continue;
- if (bl->owner->type == bp_dprintf)
+ if (bl->owner->type == bp_dprintf && bl->target_info.persist == 1)
continue;
if (bl->inserted)
--
2.0.0
next prev parent reply other threads:[~2014-06-18 14:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-18 14:26 [PATCH 1/2] Add dprintf and detach test " Simon Marchi
2014-06-18 14:26 ` Simon Marchi [this message]
2014-07-02 13:29 ` Simon Marchi
2014-07-07 15:06 ` Joel Brobecker
2014-07-07 17:20 ` Simon Marchi
2014-07-07 20:23 ` Joel Brobecker
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=1403101571-1190-2-git-send-email-simon.marchi@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=gdb-patches@sourceware.org \
/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).