From patchwork Mon Jan 29 16:58:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 25671 Received: (qmail 71934 invoked by alias); 29 Jan 2018 16:58:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 71819 invoked by uid 89); 29 Jan 2018 16:58:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f194.google.com Received: from mail-wr0-f194.google.com (HELO mail-wr0-f194.google.com) (209.85.128.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jan 2018 16:58:10 +0000 Received: by mail-wr0-f194.google.com with SMTP id a43so432853wrc.4 for ; Mon, 29 Jan 2018 08:58:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=n0u2X1WThW7OwxuvXl4u37945m7dCHlF3chloTeBess=; b=FoEGGL/x2W5ggZnWQd8quUFyUHqbEU2Hu+DFzP1wL91/NhrJCIwWNndKXgl4Litx37 CNao/QB+XYzk0mvIoDmGmXS2JQC8NUyawUbXZHKdUriJOxhBkZ4PXTHNkpwz2ckffZbz 6HQ65k9fmmERQE3fuyiMRmYIPJgK6e64ipdRk5NTI7WwkXa4vOnukAk2pIWrhV/LjMTW V035+W/fDJMyqbrLAFzYSEdSFV5WjztF+92tDVpeZWUTgpM7jtbX0TwIx7ez1Tpat964 pB9x78JohlLnr8sdH9bVsFeb1I9bm52wFsl0uKm0PPkfVgdz71bbe7IJ3cdMOYVxqUJa 1rcw== X-Gm-Message-State: AKwxytcft5T3kYMRCe8d5f5zHnmgF1E0ZjyE9Nm8doajGaiE6CBQHSV3 myfHVW/5aD57de5yT7ay0oSFwA== X-Google-Smtp-Source: AH8x227SrYaKon8KAa58/KraevKZi7rLzWdTa51PekTNkLX8IVaXB0fF9K2+D0EDThGBDw2UnsZqVQ== X-Received: by 10.223.145.129 with SMTP id 1mr6489041wri.18.1517245088739; Mon, 29 Jan 2018 08:58:08 -0800 (PST) Received: from ?IPv6:2001:8a0:f915:7500:56ee:75ff:fe8d:232b? ([2001:8a0:f915:7500:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id m6sm9941386wmb.6.2018.01.29.08.58.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2018 08:58:07 -0800 (PST) Subject: Re: [Regression] Segfault on native-extended-gdbserver + fork To: Simon Marchi 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> Cc: Sergio Durigan Junior , gdb-patches@sourceware.org, Simon Marchi From: Pedro Alves Message-ID: <8bbb4b6c-46eb-21c3-dad8-327bea8485fd@redhat.com> Date: Mon, 29 Jan 2018 16:58:06 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1b82573ce66790c935eaff87b7565907@polymtl.ca> 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. */