From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4RXtMIuaw2rKZjwAWB0awg (envelope-from ) for ; Mon, 05 Oct 2026 08:39:39 -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=sQneRr+a; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BAD7B1E04E; Mon, 05 Oct 2026 08:39:39 -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 C0C7B1E04E for ; Mon, 05 Oct 2026 08:39:38 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2D38D4BA2E25 for ; Mon, 5 Oct 2026 12:39:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2D38D4BA2E25 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=sQneRr+a Received: from mail-oa2-x10.google.com (mail-oa2-x10.google.com [IPv6:2607:f8b0:4864:30::10]) by sourceware.org (Postfix) with ESMTPS id A3B144BA2E13 for ; Mon, 5 Oct 2026 12:39:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A3B144BA2E13 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 A3B144BA2E13 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:30::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791203952; cv=none; b=Vb0rma8rJFSg17zdl5XnOjSJ/LzcYm2MY3HC2k72chmpx/dvswH1IVGLGZG8v0GI7Haki/5/WnQbaQRJmkcriF0HvTF+/ckeN7/PWZE+EkuK9cOPfU26w313BzvnjKuse1wKzmGY+5cWyfh343e32KHH3vzh9e2ovaXp6fgp9r4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1791203952; c=relaxed/simple; bh=i/mBFJ/bI2EEYgjF0GQl8YmR0jO+07hQF8KKbv8DsJg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tRirmaJMwOyy3UTTm4pMPui0+OFs5CcNvKwQVjQYN5KCPOVJg513U45/MbGJ6FP/WmnpAMecGoX8Rj261eZdaftsgj/K2nWyV/L+tGT68VH/vfe8R2Fx8sM+7brX8db4pAZoE1PqfioiiEufYc2kYsTTKyL5WK/iVfxjMFSdbaA= 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=sQneRr+a DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A3B144BA2E13 Received: by mail-oa2-x10.google.com with SMTP id 586e51a60fabf-47c57070c52so398663fac.0 for ; Mon, 05 Oct 2026 05:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791203952; x=1791808752; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=qOjReA8jHyxKv9bLTPxKJzDI1B1NGI6a0nxCYpxPmf8=; b=sQneRr+aepqXMcoB2CBahiNaKmZaJzpFYXrx64uSKszm7OGRi+8G6ZOnj1n8S6igzr Wic8Wxk2I2Jy5uj4PhHdPraJAZOyo7k1274kfxxJ9anpXFJkXJFNCxznvutKFk+P3XKj 3MGw2Gdjj7b4EtM9QvBGCWWbs8sAWrVFtcUKa3QpIM2uj2vcnP/+8QGFIsQxVAnEIbPt mXWCFgUvTkZhwqtLAnJUmMmJfwpObjoqUXB26ME9AdORC/vwIGG4D7vJYMVg3HzS30QQ pCUDETQii3ycbfuOXDC0ffuddWM6sl7fgTFrPYJjDhtAX4M2O76NbKarFh9/tEkWWNzL Ew1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791203952; x=1791808752; h=content-transfer-encoding:mime-version: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=qOjReA8jHyxKv9bLTPxKJzDI1B1NGI6a0nxCYpxPmf8=; b=DppeLAcEpfgGI+j/ulb/DRbYWfShHcZW+sD7D3hCZdSh0fxw4MB68zawPSddrk/JpL vXVCp4iAl4lAVkSBIt2qobwdsrApuKES4Hja26uQSDrzIRHgq9Rijk+ZTzmH8tY0NhWQ Hr227rXUw1DEnFFmbEycudmvFphkGif+Hyx8+BKJZBPpgKGi8Cxo4RTF8IPWjFhOtn/F R0gj4SPg8SOTj0w1NyAKwXPHr1rQLdklUssZY9QylXPgwnLeDs/4027dmgm1mZ8dY6t4 3C4lMD4hi/yQ0Qjhgkhzv2VqNhwky6xsJdwNFzdzJfcSBoGb8nat7KeSR+8JqU9VHH7l NV5w== X-Gm-Message-State: AFuF++kUvnTLLHcgXSQkbqO9NKdKcsNJgMNr4DXK+LuBWqUBpkyVuXqf ZMkIxwhnHn4NFWdR+jtWNo0PMAaZTgOfDvx60j3Eu1KACoE36SKl0kC+ X-Gm-Gg: AYBFou00z7jc7BjHn3oGNkYjM5rFRbyiM4R3KSOKCXZjb4V9ANub2fBjvpVbUCCn2w5 Q0ayUA3T2n0mvADVe5DiG1eKVHDvQAAbZliIqfOPtxaVV8rcIs0INeIpqZ9AyLVaYxKHKk6nDUC luxICS2WtTxBYLLLra5auKp9difva1JdcGgRawkw0ZdtnH68j4n5Bkk6mPa738JQyZv7559l2yC ndb8rstMq/VOJX79BJk8KF9KsnlOBUbj6BPiFeMW/fIGXSNUYPNjLsy+ck+Olm2HhvcNsusnbKx 8qNjeZWfq3G9PZzJlXMq6TSiHEsUoRUS1cYznIFF2QzAOuEE/O15xAxSEWRDeWXRGLLLbhLkrST GPqDO6aCqD7KU2ls0dz4H2o4oM41q32xs+qxlOCMRjt3y6NkoS8hPNT4n93CvT3B+YLVEmFFk64 e10GpJ+k2HOq/Pd9x4F7a3vSl2XBpwlD/zRDDmDQVC1wtrJ6AWzMwUr71+nOrAfHtFoOvDv/7HZ llw9etoV5nwemcgJet2fYWcbyo= X-Received: by 2002:a05:6820:c452:20b0:6da:389:5c70 with SMTP id 006d021491bc7-6df33a9ef78mr4531484eaf.20.1791203951837; Mon, 05 Oct 2026 05:39:11 -0700 (PDT) Received: from localhost.localdomain ([122.171.21.153]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-6df37fe2a90sm10938778eaf.2.2026.10.05.05.39.08 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 05 Oct 2026 05:39:11 -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 v4 3/4] Remove obsolete getthrds and HAVE_PTRACE64 configure checks. Date: Mon, 5 Oct 2026 18:08:55 +0530 Message-ID: <20261005123854.31854-2-akamath996@gmail.com> X-Mailer: git-send-email 2.43.0 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 AIX supported releases, getthrds is there declared, and ptrace64 is in 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 . @@ -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 @@ -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 ]]) 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