Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Aditya Vidyadhar Kamath <akamath996@gmail.com>
Cc: ulrich.weigand@de.ibm.com,  simon.marchi@polymtl.ca,
	 tom@tromey.com, gdb-patches@sourceware.org,
	 Aditya.Kamath1@ibm.com, sangamesh.swamy@in.ibm.com
Subject: Re: [PATCH 1/3] Remove stale pre-AIX-7.2 compatibility guards
Date: Wed, 16 Sep 2026 09:14:27 -0600	[thread overview]
Message-ID: <87mrthut2k.fsf@tromey.com> (raw)
In-Reply-To: <20260916114519.17472-2-akamath996@gmail.com> (Aditya Vidyadhar Kamath's message of "Wed, 16 Sep 2026 17:15:20 +0530")

>>>>> Aditya Vidyadhar Kamath <akamath996@gmail.com> writes:

> From: Aditya Vidyadhar 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.

Hi.  I saw this and had a few comments.

> -#if !HAVE_DECL_GETTHRDS
> -extern int getthrds (pid_t, struct thrdsinfo64 *, int, tid_t *, int);
> -#endif

I think this is the last use of HAVE_DECL_GETTHRDS, so the corresponding
configure check can be removed:

	 # Older versions of AIX do not provide the declaration for
	 # the getthrds function (it appears that it was introduced
	 # with AIX 6.x).
	 AC_CHECK_DECLS(getthrds, [], [], [[#include <procinfo.h>]])

>  static int
>  ptrace64aix (int req, int id, long long addr, int data, int *buf)
>  {
>    errno = 0;
> -  return ptrace_check (req, id, ptracex (req, id, addr, data, buf));
> +  return ptrace_check (req, id, ptrace64 (req, id, addr, data, buf));

>  static int
> -ptrace32 (int req, int id, addr_ptr addr, int data, int *buf)
> +ptrace32 (int req, int id, long long addr, int data, int *buf)
>  {
>    errno = 0;
> -  return ptrace_check (req, id,
> -		       ptrace (req, id, addr, data, buf));
> +  return ptrace_check (req, id, ptrace64 (req, id, addr, data, buf));

AFAICT ptrace64aix and ptrace32 are now identical.  If this is
intentional then I think they could be combined.  But then it looks like
they could also just be merged into ptrace_check as well.

If that's done then there are other spots that could be simplified, for
example:

  if (flags & PTHDB_FLAG_GPRS)
    {
      if (data->arch64)
	ptrace64aix (PTT_WRITE_GPRS, tid,
		     (unsigned long) context->gpr, 0, NULL);
      else
	ptrace32 (PTT_WRITE_GPRS, tid, (uintptr_t) context->gpr, 0, NULL);
    }

In gdb it's very unusual to use "long long" here but OTOH the rules are
more lax for native code.  So I don't know if that's a problem.

thanks,
Tom

      reply	other threads:[~2026-09-16 15:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 11:45 Aditya Vidyadhar Kamath
2026-09-16 15:14 ` Tom Tromey [this message]

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=87mrthut2k.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=akamath996@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=simon.marchi@polymtl.ca \
    --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