Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 1/3] Remove stale pre-AIX-7.2 compatibility guards
@ 2026-09-16 11:45 Aditya Vidyadhar Kamath
  0 siblings, 0 replies; only message in thread
From: Aditya Vidyadhar Kamath @ 2026-09-16 11:45 UTC (permalink / raw)
  To: ulrich.weigand, simon.marchi, tom
  Cc: gdb-patches, Aditya.Kamath1, sangamesh.swamy, Aditya Vidyadhar Kamath

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-16 11:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 11:45 [PATCH 1/3] Remove stale pre-AIX-7.2 compatibility guards Aditya Vidyadhar Kamath

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox