public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
To: "simark@simark.ca" <simark@simark.ca>,
	Aditya Kamath1 <Aditya.Kamath1@ibm.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Sangamesh Mallayya <sangamesh.swamy@in.ibm.com>
Subject: Re: [PATCH] Enable multi process debugging for AIX
Date: Wed, 2 Nov 2022 08:56:03 +0000	[thread overview]
Message-ID: <e54ccf49ba418f64643f26eb7fcbcd6d4a9796b8.camel@de.ibm.com> (raw)
In-Reply-To: <CH2PR15MB35441C85018B3AAA2EA46801D6369@CH2PR15MB3544.namprd15.prod.outlook.com>

Aditya Kamath1 <Aditya.Kamath1@ibm.com> wrote:

>>Is there any other way of figuring out what the parent process of
>>the new child is?  Maybe you should just do that when you get the
>>child event.
>
>I fully did not get the above suggestion " Maybe you should just do that when you get the
>child event ". Kindly let me know what you are trying to tell me in this context. 

The last iteration of you patch simply has a list of "pending parent"
and "pending child" PIDs.  If you get a fork event for the child, and
there is *any* parent PID in the "pending" list, you automatically
assume that this is the parent of *this* child.

I'm concerned that this may not always be true.  For example, if you
are already debugging multiple processes, and *two* of those fork at
the same time, you'll be getting four ptrace events in GDB - two
events for the two parent processes, and two events for the two new
child processes.  If this happens, you'll need to verify which child
is actually associated with *which* parent.

As you note, on other platforms this relationship is reported as part
of the ptrace event directly, and this is apparently not the case on
AIX.  However, the OS of course still knows what the parent process
of each of the child processes is - so I guess there should be *some*
way to find this out from within GDB.  (E.g. in Linux you could get
at that information by reading some /proc files.)

Bye,
Ulrich


  reply	other threads:[~2022-11-02  8:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 15:53 Aditya Kamath1
2022-07-19 18:51 ` Simon Marchi
2022-07-22 16:56   ` Aditya Kamath1
2022-08-18 18:59   ` Aditya Kamath1
2022-08-21 17:15     ` Aditya Kamath1
2022-08-22 13:25     ` Ulrich Weigand
2022-08-22 14:19       ` Simon Marchi
2022-08-23  6:52       ` Aditya Kamath1
2022-10-19 10:57       ` Aditya Kamath1
2022-10-19 10:57         ` Aditya Kamath1
2022-10-28 10:59         ` Ulrich Weigand
2022-11-01 13:55           ` Aditya Kamath1
2022-11-02  8:56             ` Ulrich Weigand [this message]
2022-11-10 10:39               ` Aditya Kamath1
2022-11-14 18:24                 ` Ulrich Weigand
2022-11-15  7:13                   ` Aditya Kamath1
2022-11-15 10:53                     ` Ulrich Weigand
2022-11-15 12:01                       ` Aditya Kamath1
2022-11-15 12:43                         ` Ulrich Weigand
2022-11-15 18:13                           ` Aditya Kamath1

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=e54ccf49ba418f64643f26eb7fcbcd6d4a9796b8.camel@de.ibm.com \
    --to=ulrich.weigand@de.ibm.com \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=simark@simark.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).