public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Aditya Vidyadhar Kamath <ADITYA.VIDYADHAR.KAMATH@ibm.com>
Subject: Re: [PATCH] Use current_inferior ()->pid for AIX
Date: Mon, 2 May 2022 14:50:31 +0000	[thread overview]
Message-ID: <b9fff4d724cbce11935c20a1be24dd62b2daef6a.camel@de.ibm.com> (raw)
In-Reply-To: <BN6PR15MB13130BF943A019871F8F4E0EB5119@BN6PR15MB1313.namprd15.prod.outlook.com>

Aditya Vidyadhar Kamath <ADITYA.VIDYADHAR.KAMATH@ibm.com> wrote:

>AIX is still using inferior_ptid.pid() to get the inferior pid instead
>of the new object current_inferior().With this it is not possible to
>debug any sample program as the it fails with assertion check for
>pid!=0.

I don't quite understand the underlying problem here.  While we may
want to get rid of inferior_ptid at some point in the future, as of
right now inferior_ptid *is* still being used (by many places in the
target stack), and should always be maintained correctly.

Maybe the problem is really that somewhere inferior_ptid isn't being
updated as it should?


As an aside, this part changes semantics of the code:

>@@ -932,11 +932,12 @@
> static void
> pd_deactivate (void)
> {
>+  ptid_t ptdrtn = ptid_t (current_inferior ()->pid);
>   if (!pd_active)
>     return;
>   pthdb_session_destroy (pd_session);
>   
>-  pid_to_prc (&inferior_ptid);
>+  pid_to_prc (&ptdrtn); 
>   pd_active = 0;
> }

The point of this code was to *change* inferior_ptid back from
the per-thread view to the no-threads view as the threading
layer is deactivated.  With your patch, inferior_ptid is no
longer changed at all, which makes the pid_to_prc call useless.

Bye,
Ulrich


       reply	other threads:[~2022-05-02 14:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <BN6PR15MB13130BF943A019871F8F4E0EB5119@BN6PR15MB1313.namprd15.prod.outlook.com>
2022-05-02 14:50 ` Ulrich Weigand [this message]
2022-03-29  6:58 Aditya Vidyadhar Kamath
2022-03-29 13:01 ` Simon Marchi
2022-03-30 13:04   ` Aditya Vidyadhar Kamath
2022-04-05 12:15     ` Aditya Vidyadhar Kamath
2022-04-05 12:47     ` Simon Marchi
2022-04-12 13:32       ` Aditya Vidyadhar Kamath
2022-04-18  6:33         ` Aditya Vidyadhar Kamath
2022-04-21 11:41         ` Aditya Vidyadhar Kamath
2022-04-21 14:51         ` Simon Marchi
     [not found]           ` <BN8PR15MB2867D6D625DD0B353C99D3A3B5DD9@BN8PR15MB2867.namprd15.prod.outlook.com>
2022-05-30 12:45             ` Simon Marchi
2022-06-10 14:47               ` Aditya Vidyadhar Kamath
2022-06-15  4:03                 ` Aditya Vidyadhar Kamath
2022-06-23 20:40                   ` Aditya Vidyadhar Kamath

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=b9fff4d724cbce11935c20a1be24dd62b2daef6a.camel@de.ibm.com \
    --to=ulrich.weigand@de.ibm.com \
    --cc=ADITYA.VIDYADHAR.KAMATH@ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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).