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 v4 3/4] Remove obsolete getthrds and HAVE_PTRACE64 configure checks.
Date: Mon, 5 Oct 2026 18:08:55 +0530 [thread overview]
Message-ID: <20261005123854.31854-2-akamath996@gmail.com> (raw)
From: Aditya Vidyadhar Kamath <aditya.kamath1@ibm.com>
AIX 7.2 is the baseline supported AIX release. On all AIX supported releases,
getthrds is there <procinfo.h> declared, and ptrace64 is in <sys/ptrace.h>
declared and defined in libc.a.
This patch removes the obsolete configure checks and cleans up.
We are doing 2 things:
1: Remove AC_CHECK_DECLS (getthrds) in configure.ac and config.in.
2: Remove obsolete #ifdef HAVE_PTRACE64 in gdb/nat/gdb_ptrace.h
and use ptrace64 directly under PTRACE_TYPE_ARG5.
---
gdb/aix-thread.c | 33 ++-------------------------------
gdb/config.in | 7 -------
gdb/configure.ac | 5 -----
gdb/nat/gdb_ptrace.h | 13 ++++---------
4 files changed, 6 insertions(+), 52 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index 65b9c5f7479..95aa18985ed 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,15 +306,6 @@ 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
-
static int
ptrace64aix (int req, int id, long long addr, int data, int *buf)
{
@@ -331,17 +313,6 @@ ptrace64aix (int req, int id, long long addr, int data, int *buf)
return ptrace_check (req, id, ptracex (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
static int
ptrace32 (int req, int id, addr_ptr addr, int data, int *buf)
diff --git a/gdb/config.in b/gdb/config.in
index 0e5a6637c2b..dab7a3e7239 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -147,10 +147,6 @@
/* Define to 1 if you have the declaration of `ffs', and to 0 if you don't. */
#undef HAVE_DECL_FFS
-/* Define to 1 if you have the declaration of `getthrds', and to 0 if you
- don't. */
-#undef HAVE_DECL_GETTHRDS
-
/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
don't. */
#undef HAVE_DECL_SNPRINTF
@@ -397,9 +393,6 @@
/* Define to 1 if you have the `pthread_sigmask' function. */
#undef HAVE_PTHREAD_SIGMASK
-/* Define to 1 if you have the `ptrace64' function. */
-#undef HAVE_PTRACE64
-
/* Define if sys/ptrace.h defines the PTRACE_GETFPXREGS request. */
#undef HAVE_PTRACE_GETFPXREGS
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 0d88a280b16..684ce8e21fb 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1915,11 +1915,6 @@ if test "${build}" = "${host}" -a "${host}" = "${target}" ; then
CONFIG_SRCS="${CONFIG_SRCS} aix-thread.c"
CONFIG_OBS="${CONFIG_OBS} aix-thread.o"
LIBS="$LIBS -lpthdebug"
-
- # 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>]])
fi
;;
esac
diff --git a/gdb/nat/gdb_ptrace.h b/gdb/nat/gdb_ptrace.h
index e0607164260..0d06cb8eb55 100644
--- a/gdb/nat/gdb_ptrace.h
+++ b/gdb/nat/gdb_ptrace.h
@@ -127,15 +127,10 @@
zero. */
#ifdef PTRACE_TYPE_ARG5
-# ifdef HAVE_PTRACE64
-# define ptrace(request, pid, addr, data) \
- ptrace64 (request, pid, addr, data, 0)
-# undef PTRACE_TYPE_ARG3
-# define PTRACE_TYPE_ARG3 long long
-# else
-# define ptrace(request, pid, addr, data) \
- ptrace (request, pid, addr, data, 0)
-# endif
+# define ptrace(request, pid, addr, data) \
+ ptrace64 (request, pid, addr, data, 0)
+# undef PTRACE_TYPE_ARG3
+# define PTRACE_TYPE_ARG3 long long
#else
/* Wrapper that avoids adding a pointless cast to all callers. */
# define ptrace(request, pid, addr, data) \
--
2.51.2
next reply other threads:[~2026-10-05 12:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 12:38 Aditya Vidyadhar Kamath [this message]
2026-10-09 11:32 ` Andrew Burgess
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=20261005123854.31854-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