From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28637 invoked by alias); 2 Sep 2014 14:13:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28473 invoked by uid 89); 2 Sep 2014 14:13:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg20.ericsson.net Received: from usevmg20.ericsson.net (HELO usevmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 02 Sep 2014 14:13:33 +0000 Received: from EUSAAHC002.ericsson.se (Unknown_Domain [147.117.188.78]) by usevmg20.ericsson.net (Symantec Mail Security) with SMTP id CC.C7.05330.77B75045; Tue, 2 Sep 2014 10:10:31 +0200 (CEST) Received: from [142.133.110.254] (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.78) with Microsoft SMTP Server (TLS) id 14.3.174.1; Tue, 2 Sep 2014 10:13:29 -0400 Message-ID: <5405D088.1010702@ericsson.com> Date: Tue, 02 Sep 2014 14:13:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: GDB Patches Subject: Re: [PATCH v3 1/2] Only leave dprintf inserted if it is marked as persistent (PR breakpoints/17012) References: <1408734315-21207-1-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1408734315-21207-1-git-send-email-simon.marchi@ericsson.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-09/txt/msg00054.txt.bz2 On 14-08-22 03:05 PM, Simon Marchi wrote: > 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. > > New in v3: > * Follow-up Pedro's review > * Remove == 1 for check on boolean. > > gdb/Changelog: > > 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 683ed2b..01e9b36 100644 > --- a/gdb/breakpoint.c > +++ b/gdb/breakpoint.c > @@ -3110,7 +3110,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) > continue; > > if (bl->inserted) Ping.