From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mQxyEREUzmpU7gAAWB0awg (envelope-from ) for ; Tue, 13 Oct 2026 07:20:49 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=mLiVu4i0; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 3C65B1E051; Tue, 13 Oct 2026 07:20:49 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id A42151E04E for ; Tue, 13 Oct 2026 07:20:44 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D3A1C4BA798E for ; Tue, 13 Oct 2026 11:20:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D3A1C4BA798E Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=mLiVu4i0 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 37B664BA23E1 for ; Tue, 13 Oct 2026 11:20:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 37B664BA23E1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 37B664BA23E1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::436 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791890417; cv=none; b=E8TFj7IP7xRLrmbpf9w15D8DYRKP7lhNCcnoFu0Vk/Nb1sWwSIcwQFwwehk8XLf2QMx51BzE4MliYa1fIStxkyiYCqnZt2EkWnDOtFQ0ia/0dsoxAlDLyRSFt2k2s2IUgIHsGM/EBk5hFKXyuvZGB83bjxmeluDTN5db0No3x+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791890417; c=relaxed/simple; bh=M/9KkDOZRQDq6401FZGS/YGxAeSzzDRAsko049pi2wQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=KjEfOaWmTw0YV76EZFrigsvBntICCKmm+QEk2pu9ewMyoXxSqLJDElJEc3wUzVZPnyCZ1vHiHra8EmHPZzPEszeMn1p+1iapdY/pH5Re2Ikps2qD8yGc6rBgDBstupQFgopH0H3ZesaIApdxhDQHxKGAVutiIRbpe5/GpuBKETo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=mLiVu4i0 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37B664BA23E1 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-892734ce7e6so979531b3a.1 for ; Tue, 13 Oct 2026 04:20:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791890416; x=1792495216; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9uizpEbg1/VnfLyDqtD2VzkS6FkbpuVPYBq8yi+U9LY=; b=mLiVu4i0RP6AOXoKxAf5N057wbcz533JQztMSnMga9y0jAeHKghQ44qaYaij/QIIJa 3RRQoziTfPRwtNfD4MQ5KsSlHCqAHn3oPH+nOEle+K81ecnMYtdu94MsK7Cb6JI5oK+s 6OILj0bN6+it7WmrsmIuUpm2ZnB6n1EBEJ/SHsY2z8Apmk7VLOGEprUNNx9MfEcbX2i5 X9R1BtFZGJ8YwbJFrGKeoN90R++YjNss6FLsfoXogTnxTpZEYCRsgVRybJZPNGMfoXjX bck+du5IMA6x+ExpBQ8kx65Rj3TL/ZhvkC/pN+rFcnNI+0MH0JXCBQE1r0fy/VboA7kM jieA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791890416; x=1792495216; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9uizpEbg1/VnfLyDqtD2VzkS6FkbpuVPYBq8yi+U9LY=; b=v1enOqdDUu3kpEBXHayyV0K4d/ppqxb9Uz4qH3K8HAj9bqPcuHARPJEDgTJYT12Xhb eJdU2As01hCylwfollJMsbyA5Lwb/mV4booVQgcmMDHe5URheq1wUOdFDYn7loManjuY wIjbfzl/7a9fd1caJ6QDsaEUtAaGatgkaE8wXf2kwSWZEXxr51XM/cIl+U1AcjHU8lyQ rWp7qtVEd6Kpg4eCJxpbWl/cxr2VxctmsdJr6c3sWmwGAHL202MdTd9XJ9btpzKNEUIm Hf8cXyo5tfTOceM43F0PbAT121Ome1eqNPkQ/B3yNByXcYWcSutJLGCGuFa2voE9hfIG j3Ow== X-Gm-Message-State: AFq9FYKZN3+eFVUoB9u9DLi1L2VCaTPXjCbUBKCkwmAz8Rj6jPo/e5c3 PHnQilb9SMlo50GJprKbpEI8hAu6x4LVE/1btK5rcX6gmvuqnjEzKhQ5 X-Gm-Gg: AYBFou3g1KyJKb/Mb7WebYaxFc5nQCSX3V8PM3wUMi1z06Q1Xao6LGM5C6Ls7VUBxFF Jotacj2Vxv8M6qi4Y/pbb0I3WnyncicBzNzzmr1iHlcLUfkDZYQn++3zTvLsB28jZGYPSaC9n/Z UJj5jv52ZLLAgjDEmvt1+ZyGiuQvr2bSt4fbDz1XAGV6Mt7q/Qd+n8bAWPqBlnxoe0AXeQ0v4ks 0GWErbGLSJUE3GC+Y28c2zkZkgFrh30BEdki1V+74Mma0psJILF6D93+PHAMxbNEiqWuLdn2lfQ Wvi+9xCQtIpY/0++TGt55XzSCjX9FgIq58y3zlVPhbdIS6i4lTA+6LSU6oOre4LKdBz+aOzQ1V6 qgjiGOVlQDpZBlH1WGl6Dd34SsOTxGIMD6NiA9JLXkl8o9tG3yr7TpeDotBcqReNq/Ir/KjpJPY E26DpBux0DYRdrf89WNcGEa8YUaoqe65lisV10OedokTkx+QJtcne3Sp8DZAkULMLALlY9GoSh6 b2bH6Ig4AYrdAAu7Rw2Uug+M0TER6ET4e3h X-Received: by 2002:a05:6a00:428b:b0:89c:6036:c63 with SMTP id d2e1a72fcca58-89c6036151fmr2514226b3a.32.1791890416026; Tue, 13 Oct 2026 04:20:16 -0700 (PDT) Received: from dhcp-9-123-1-12.bl1-in.ibm.com ([129.41.58.4]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-896c469ea49sm4858351b3a.53.2026.10.13.04.20.13 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 13 Oct 2026 04:20:15 -0700 (PDT) From: Aditya Vidyadhar Kamath 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 Subject: [PATCH v5 2/4] Remove obsolete getthrds and HAVE_PTRACE64 configure checks. Date: Tue, 13 Oct 2026 16:49:17 +0530 Message-ID: <20261013111917.68981-4-akamath996@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20261013111917.68981-2-akamath996@gmail.com> References: <20261013111917.68981-2-akamath996@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org From: Aditya Vidyadhar Kamath AIX 7.2 is the baseline supported AIX release. On all supported AIX releases, getthrds is declared in , and ptrace64 is declared in and defined in libc.a. The configure checks for both were added for older AIX versions that are no longer supported. Remove AC_CHECK_DECLS (getthrds) from gdb/configure.ac and the corresponding entry from gdb/config.in. Remove the conditional extern declaration in gdb/aix-thread.c that the check guarded. Remove ptrace64 from the AC_CHECK_FUNCS list in gdbsupport/common.m4 and drop HAVE_PTRACE64 from all three config.in files. In gdb/aix-thread.c, remove the #ifdef HAVE_PTRACE64 guards; the ptracex and ptrace wrapper macros now call ptrace64 unconditionally, and addr_ptr is defined unconditionally as long long. In gdb/nat/gdb_ptrace.h, remove the #ifdef HAVE_PTRACE64 guard and always define the ptrace macro to call ptrace64 under PTRACE_TYPE_ARG5. Also remove the stale HP-UX reference from the comment above that block. No other files in the tree reference HAVE_PTRACE64 or HAVE_DECL_GETTHRDS outside generated build files. The gdb/configure, gdbserver/configure and gdbsupport/configure scripts are regenerated from the updated .ac and .m4 sources using autoconf 2.69. --- gdb/aix-thread.c | 41 ++++++++++++----------------------------- gdb/config.in | 7 ------- gdb/configure | 17 ----------------- gdb/configure.ac | 5 ----- gdb/nat/gdb_ptrace.h | 20 +++++++------------- gdbserver/config.in | 3 --- gdbserver/configure | 1 - gdbsupport/common.m4 | 1 - gdbsupport/config.in | 3 --- gdbsupport/configure | 1 - 10 files changed, 19 insertions(+), 80 deletions(-) diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 869947b902f..7596bd844cf 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 . @@ -19,7 +19,7 @@ along with this program. If not, see . */ -/* 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 #include -#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 @@ -347,14 +338,10 @@ 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. */ +/* Call ptrace64 (REQ, ID, ADDR, DATA, BUF). Return success. */ -#ifdef HAVE_PTRACE64 -# define ptracex(request, pid, addr, data, buf) \ - ptrace64 (request, pid, addr, data, buf) -#endif +#define ptracex(request, pid, addr, data, buf) \ + ptrace64 (request, pid, addr, data, buf) static int ptrace64aix (int req, int id, long long addr, int data, int *buf) @@ -363,17 +350,13 @@ 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 +/* On all supported AIX releases ptrace64 is available and addr is + always a long long. addr_ptr is used as the type of the addr + parameter to ptrace32(). */ + +#define ptrace(request, pid, addr, data, buf) \ + ptrace64 (request, pid, addr, data, buf) +#define addr_ptr long long 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 b/gdb/configure index 810e9ed7a37..e0ecf0ef8d6 100755 --- a/gdb/configure +++ b/gdb/configure @@ -20321,7 +20321,6 @@ fi pipe \ pipe2 \ poll \ - ptrace64 \ sbrk \ setns \ setpgid \ @@ -31139,22 +31138,6 @@ $as_echo "$gdb_cv_have_aix_thread_debug" >&6; } 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_fn_c_check_decl "$LINENO" "getthrds" "ac_cv_have_decl_getthrds" "#include -" -if test "x$ac_cv_have_decl_getthrds" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETTHRDS $ac_have_decl -_ACEOF - fi ;; esac 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 ]]) fi ;; esac diff --git a/gdb/nat/gdb_ptrace.h b/gdb/nat/gdb_ptrace.h index e0607164260..c8ae89cd19e 100644 --- a/gdb/nat/gdb_ptrace.h +++ b/gdb/nat/gdb_ptrace.h @@ -121,21 +121,15 @@ # endif #endif -/* Some systems, at least AIX and HP-UX have a ptrace with five - arguments. Since we never use the fifth argument, define a ptrace - macro that calls the real ptrace with the last argument set to - zero. */ +/* AIX has a ptrace with five arguments. Since we never use the fifth + argument, define a ptrace macro that calls ptrace64 with the last + argument set to 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) \ diff --git a/gdbserver/config.in b/gdbserver/config.in index ead66ce7a57..4223c68d4af 100644 --- a/gdbserver/config.in +++ b/gdbserver/config.in @@ -245,9 +245,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 the target supports PTRACE_GETFPXREGS for extended register access. */ #undef HAVE_PTRACE_GETFPXREGS diff --git a/gdbserver/configure b/gdbserver/configure index dd749fcb55b..327f3fec124 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -8525,7 +8525,6 @@ fi pipe \ pipe2 \ poll \ - ptrace64 \ sbrk \ setns \ setpgid \ diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index 6bf15fff670..bce8f19e803 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -71,7 +71,6 @@ AC_CHECK_HEADERS([ \ pipe \ pipe2 \ poll \ - ptrace64 \ sbrk \ setns \ setpgid \ diff --git a/gdbsupport/config.in b/gdbsupport/config.in index 2957ee0f030..321e1aaecf8 100644 --- a/gdbsupport/config.in +++ b/gdbsupport/config.in @@ -202,9 +202,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 to 1 if you have the header file. */ #undef HAVE_PTRACE_H diff --git a/gdbsupport/configure b/gdbsupport/configure index 0bc9ff1db9a..df932c4c5dd 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -11424,7 +11424,6 @@ fi pipe \ pipe2 \ poll \ - ptrace64 \ sbrk \ setns \ setpgid \ -- 2.51.2