From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123081 invoked by alias); 29 Jan 2018 17:04:04 -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 122486 invoked by uid 89); 29 Jan 2018 17:04:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=his X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jan 2018 17:03:58 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w0TH3pDY007263 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 29 Jan 2018 12:03:56 -0500 Received: by simark.ca (Postfix, from userid 112) id A83681E5B7; Mon, 29 Jan 2018 12:03:51 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id D85E31E093; Mon, 29 Jan 2018 12:03:50 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Mon, 29 Jan 2018 17:04:00 -0000 From: Simon Marchi To: Pedro Alves Cc: Sergio Durigan Junior , gdb-patches@sourceware.org, Simon Marchi Subject: Re: [Regression] Segfault on native-extended-gdbserver + fork In-Reply-To: <8bbb4b6c-46eb-21c3-dad8-327bea8485fd@redhat.com> References: <20180119161628.21611-1-simon.marchi@polymtl.ca> <20180119161628.21611-3-simon.marchi@polymtl.ca> <87efmaebo3.fsf_-_@redhat.com> <931f8b594f7405649778f66ab2960a40@polymtl.ca> <669ec8c3-caa3-6901-b26c-00a7e20bc0d1@redhat.com> <1b82573ce66790c935eaff87b7565907@polymtl.ca> <8bbb4b6c-46eb-21c3-dad8-327bea8485fd@redhat.com> Message-ID: <5a92a367fa44671fb875fd59528c2bda@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.2 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 29 Jan 2018 17:03:51 +0000 X-IsSubscribed: yes X-SW-Source: 2018-01/txt/msg00605.txt.bz2 On 2018-01-29 11:58, Pedro Alves wrote: > On 01/29/2018 04:25 PM, Simon Marchi wrote: > >> It's true that it's a bit of a lie to say "[Inferior PID detached]" if >> there never actually was an inferior for that PID.  Since we never >> print "[Inferior PID detached]" on native in that case, I am fine with >> removing the call from remote.c.  Sergio, that would fix the crash you >> found I think? > > A tangent: > > We should probably change that message from: > > [Inferior PID detached] > > to something like: > > [Inferior ID (process PID) detached] > > I.e.: > [Inferior 24822 detached] > vs: > [Inferior 1 (process 24822) detached] > > In patch form, something like this: > > From 6c1db47bc19669d9c84024d09f8a63b5eb78b6c2 Mon Sep 17 00:00:00 2001 > From: Pedro Alves > Date: Mon, 29 Jan 2018 16:41:25 +0000 > Subject: [PATCH] change output > > --- > gdb/inferior.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/gdb/inferior.c b/gdb/inferior.c > index 38b7369275b..2986b510314 100644 > --- a/gdb/inferior.c > +++ b/gdb/inferior.c > @@ -234,7 +234,8 @@ exit_inferior (int pid) > exit_inferior_1 (inf, 0); > > if (print_inferior_events) > - printf_unfiltered (_("[Inferior %d exited]\n"), pid); > + printf_unfiltered (_("[Inferior %d (%s) exited]\n"), > + inf->num, target_pid_to_str (ptid_t (pid))); > } > > void > @@ -264,7 +265,8 @@ detach_inferior (inferior *inf) > exit_inferior_1 (inf, 0); > > if (print_inferior_events) > - printf_unfiltered (_("[Inferior %d detached]\n"), pid); > + printf_unfiltered (_("[Inferior %d (%s) detached]\n"), > + inf->num, target_pid_to_str (ptid_t (pid))); > } > > /* See inferior.h. */ Agreed. Though I don't think Sergio's original patch is needed if we instead remove the detach_inferior call in remote.c, so your patch shouldn't be based on his. Simon