Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Aditya Vidyadhar Kamath <akamath996@gmail.com>,
	ulrich.weigand@de.ibm.com,  tom@tromey.com
Cc: gdb-patches@sourceware.org, Aditya.Kamath1@ibm.com,
	sangamesh.swamy@in.ibm.com
Subject: Re: [PATCH v3] Remove stale pre-AIX-7.2 compatibility guards
Date: Tue, 22 Sep 2026 15:58:03 -0400	[thread overview]
Message-ID: <85a25f1b-d6b8-4ae4-8d41-20d88764f2c0@polymtl.ca> (raw)
In-Reply-To: <20260922045230.58748-2-akamath996@gmail.com>

On 9/22/26 12:52 AM, Aditya Vidyadhar Kamath wrote:
> From: Aditya Kamath <Aditya.Kamath1@ibm.com>
> 
> GDB now requires AIX 7.2 as the minimum supported version and will
> support AIX 7.2 TL5, AIX 7.3 and upcoming AIX releases.  Remove
> dead compatibility code that existed only for older releases.
> 
> Remove the HAVE_DECL_GETTHRDS configure check since aix-thread.c was the last
> user of that macro.  Merge ptrace64aix and ptrace32 into a single
> ptrace_aix function since they became identical after this
> cleanup, and collapse all call sites that branched on arch64 just to
> pick between the two.  Also clean up rs6000-aix-nat.c by removing the
> ARCH3264 and HAVE_PTRACE64 guards along with the ptracex fallback in
> rs6000_ptrace32 and rs6000_ptrace64, which are now simple wrappers
> around ptrace64.
> 
> Also as per https://www.ibm.com/docs/en/aix/7.2.0?topic=p-ptrace-ptracex-ptrace64-subroutine
> ptrace64 will also support 32-bit debugees.

On this page I see:

    For ptracex or ptrace64: If the debuggee is a 32-bit process, the
    options that refer to GPRs or SPRs fail with errno = EIO

And I see that in the patch, you call ptrace64 to read registers
(PTT_READ_GPRS) for 32 bit processes.  How does that work?

> @@ -315,40 +306,13 @@ ptrace_check (int req, int id, int ret)
>    return 0;  /* Not reached.  */
>  }
>  
> -/* Call ptracex (REQ, ID, ADDR, DATA, BUF) or
> -   ptrace64 (REQ, ID, ADDR, DATA, BUF) if HAVE_PTRACE64.
> -   Return success.  */
> -
> -#ifdef HAVE_PTRACE64
> -# define ptracex(request, pid, addr, data, buf) \
> -	 ptrace64 (request, pid, addr, data, buf)
> -#endif
> +/* Call ptrace64 (REQ, ID, ADDR, DATA, BUF).  Return success.  */

I think that all these "Call ptrace64" comments are not very useful.  We
can see that by reading the code.  Change the comment to explain why
this wrapper function needs to exist (if it really does).

I think you could simplify this one further by moving the actual
ptrace64 call into ptrace_check (so that it does the ptrace call and the
check), and get rid of ptraceaix.  There is one level of abstraction
that is not needed anymore here.

If you only rely on ptrace64 now, I'd suggest changing the "id"
parameters to "long long", to match the type of ptrace64.

Otherwise, that looks fine to me.  I'll let Ulrich check the more
specific AIX details.

Simon

  reply	other threads:[~2026-09-22 19:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-22  4:52 Aditya Vidyadhar Kamath
2026-09-22 19:58 ` Simon Marchi [this message]
2026-09-23 12:53   ` Ulrich Weigand
2026-09-23 13:40     ` Simon Marchi
2026-09-22 20:35 ` 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=85a25f1b-d6b8-4ae4-8d41-20d88764f2c0@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=akamath996@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=tom@tromey.com \
    --cc=ulrich.weigand@de.ibm.com \
    /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