From: Aditya Vidyadhar Kamath <akamath996@gmail.com>
To: ulrich.weigand@de.ibm.com, simon.marchi@polymtl.ca, tom@tromey.com
Cc: gdb-patches@sourceware.org, Aditya.Kamath1@ibm.com,
sangamesh.swamy@in.ibm.com,
Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
Subject: [PATCH 1/3] Remove stale pre-AIX-7.2 compatibility guards
Date: Wed, 16 Sep 2026 17:15:20 +0530 [thread overview]
Message-ID: <20260916114519.17472-2-akamath996@gmail.com> (raw)
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.
---
gdb/aix-thread.c | 67 ++++++++----------------------------------------
1 file changed, 11 insertions(+), 56 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 5ac71d22237..aa14f8ff045 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1,4 +1,4 @@
-/* Low level interface for debugging AIX 4.3+ pthreads.
+/* Low level interface for debugging AIX 7.2+ pthreads.
Copyright (C) 1999-2026 Free Software Foundation, Inc.
Written by Nick Duffek <nsd@redhat.com>.
@@ -19,7 +19,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
-/* This module uses the libpthdebug.a library provided by AIX 4.3+ for
+/* This module uses the libpthdebug.a library provided by AIX 7.2+ for
debugging pthread applications.
Some name prefix conventions:
@@ -56,18 +56,9 @@
#include <sys/pthdebug.h>
#include <unordered_set>
-#if !HAVE_DECL_GETTHRDS
-extern int getthrds (pid_t, struct thrdsinfo64 *, int, tid_t *, int);
-#endif
-
/* Whether to emit debugging output. */
static bool debug_aix_thread;
-/* In AIX 5.1, functions use pthdb_tid_t instead of tid_t. */
-#ifndef PTHDB_VERSION_3
-#define pthdb_tid_t tid_t
-#endif
-
/* Success and failure values returned by pthdb callbacks. */
#define PDC_SUCCESS PTHDB_SUCCESS
@@ -315,40 +306,22 @@ 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. */
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));
}
-/* Call ptrace (REQ, ID, ADDR, DATA, BUF) or
- ptrace64 (REQ, ID, ADDR, DATA, BUF) if HAVE_PTRACE64.
- Return success. */
-
-#ifdef HAVE_PTRACE64
-# define ptrace(request, pid, addr, data, buf) \
- ptrace64 (request, pid, addr, data, buf)
-# define addr_ptr long long
-#else
-# define addr_ptr int *
-#endif
+/* Call ptrace64 (REQ, ID, ADDR, DATA, BUF). Return success. */
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));
}
/* If *PIDP is a composite process/thread id, convert it to a
@@ -1082,7 +1055,7 @@ aix_thread_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
ptrace64aix (PTT_CONTINUE, tid[0], (long long) 1,
gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid);
else
- ptrace32 (PTT_CONTINUE, tid[0], (addr_ptr) 1,
+ ptrace32 (PTT_CONTINUE, tid[0], (long long) 1,
gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid);
}
}
@@ -1826,30 +1799,12 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno,
}
else
{
- /* The contents of "struct ptspr" were declared as "unsigned
- long" up to AIX 5.2, but are "unsigned int" since 5.3.
- Use temporaries to work around this problem. Also, add an
- assert here to make sure we fail if the system header files
- use "unsigned long", and the size of that type is not what
- the headers expect. */
- uint32_t tmp_iar, tmp_msr, tmp_cr, tmp_lr, tmp_ctr, tmp_xer,
- tmp_fpscr;
-
- gdb_assert (sizeof (sprs32.pt_iar) == 4);
-
/* Pre-fetch: some registers won't be in the cache. */
ptrace32 (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL);
- fill_sprs32 (regcache, &tmp_iar, &tmp_msr, &tmp_cr, &tmp_lr,
- &tmp_ctr, &tmp_xer, &tmp_fpscr);
-
- sprs32.pt_iar = tmp_iar;
- sprs32.pt_msr = tmp_msr;
- sprs32.pt_cr = tmp_cr;
- sprs32.pt_lr = tmp_lr;
- sprs32.pt_ctr = tmp_ctr;
- sprs32.pt_xer = tmp_xer;
- sprs32.pt_fpscr = tmp_fpscr;
+ fill_sprs32 (regcache, &sprs32.pt_iar, &sprs32.pt_msr,
+ &sprs32.pt_cr, &sprs32.pt_lr, &sprs32.pt_ctr,
+ &sprs32.pt_xer, &sprs32.pt_fpscr);
if (tdep->ppc_mq_regnum >= 0)
if (REG_VALID == regcache->get_register_status
--
2.51.2
reply other threads:[~2026-09-16 11:46 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260916114519.17472-2-akamath996@gmail.com \
--to=akamath996@gmail.com \
--cc=Aditya.Kamath1@ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=sangamesh.swamy@in.ibm.com \
--cc=simon.marchi@polymtl.ca \
--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