Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>,
	gdb-patches@sourceware.org,
	Simon Marchi <simon.marchi@ericsson.com>
Subject: Re: [Regression] Segfault on native-extended-gdbserver + fork
Date: Mon, 29 Jan 2018 16:58:00 -0000	[thread overview]
Message-ID: <8bbb4b6c-46eb-21c3-dad8-327bea8485fd@redhat.com> (raw)
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 <palves@redhat.com>
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.  */
-- 
2.14.3


  reply	other threads:[~2018-01-29 16:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-19 16:16 [PATCH v2 1/3] Remove args from target detach Simon Marchi
2018-01-19 16:16 ` [PATCH v2 2/3] Pass inferior down to target_detach and to_detach Simon Marchi
2018-01-19 16:16 ` [PATCH v2 3/3] Make linux_nat_detach/thread_db_detach use the inferior parameter Simon Marchi
2018-01-28  6:32   ` [Regression] Segfault on native-extended-gdbserver + fork (was: Re: [PATCH v2 3/3] Make linux_nat_detach/thread_db_detach use the inferior parameter) Sergio Durigan Junior
2018-01-28 16:50     ` [Regression] Segfault on native-extended-gdbserver + fork Simon Marchi
2018-01-29 16:01       ` Pedro Alves
2018-01-29 16:25         ` Simon Marchi
2018-01-29 16:58           ` Pedro Alves [this message]
2018-01-29 17:04             ` Simon Marchi
2018-01-29 17:31               ` Pedro Alves
2018-01-29 17:36                 ` Pedro Alves
     [not found]           ` <87mv0w8tnr.fsf@redhat.com>
2018-01-29 17:36             ` Sergio Durigan Junior
2018-01-29 17:47               ` Pedro Alves
2018-01-29 18:06                 ` Sergio Durigan Junior
2018-01-19 16:35 ` [PATCH v2 1/3] Remove args from target detach Pedro Alves
2018-01-19 16:57   ` Simon Marchi

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=8bbb4b6c-46eb-21c3-dad8-327bea8485fd@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sergiodj@redhat.com \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    /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