From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0cKPHqMUrWqz7hoAWB0awg (envelope-from ) for ; Fri, 18 Sep 2026 06:38:27 -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=Qbf1cQwc; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6E6B41E01F; Fri, 18 Sep 2026 06:38:27 -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 EBDDC1E01F for ; Fri, 18 Sep 2026 06:38:24 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 892AC4BA2E0A for ; Fri, 18 Sep 2026 10:38:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 892AC4BA2E0A 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=Qbf1cQwc Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by sourceware.org (Postfix) with ESMTPS id C95454BA2E0A for ; Fri, 18 Sep 2026 10:37:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C95454BA2E0A 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 C95454BA2E0A Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::632 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789727876; cv=none; b=huljc8I1WNNMhT8Z4Z5dMTBpJXWV6Wb6Dtjqslq2P/KBETibp9rLVfwkWEdVyiYKoA7VjmdC4+6zp1kOT5zyxjO4aPu2Av3bRg8ZdOADVLurZJWow6zmfFXztK2E09A15lfjB8j73CzTbMALGDz5yC7QcBMMgQfNaJfzNAP6TDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1789727876; c=relaxed/simple; bh=Ai0VNRBEV34fhB+XxDqybU8yrPgPwhoX8nYgnamqTPM=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=dbIoQcq11LXKzTllz4I2PbI7J3PERZUs0v1OSIOo2gt0tMWf/JUQs3o3oacMN+S88SXu5zdjPpRui+tsZX+znNIBprHc7Lg1ENYS9wwupp2HgVzRnc8s2o3vmPu98QPbklPZpZSgTtIK++UQLNxht7juN/I0Wp8kUfprHpPBa2Q= 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=Qbf1cQwc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C95454BA2E0A Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-2dd1dcdcf95so3905985ad.1 for ; Fri, 18 Sep 2026 03:37:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789727875; x=1790332675; 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=D3k/Ow2al/XHfxcn1bI9+a8nHT40TlMsFSyhCT6ag+o=; b=Qbf1cQwcBxQxg5NewjTsdeIRzt03IWp0vjXp2jCgT20mhe0+DeQapnCwV6XS/VsWet ZZ03jpoOogtxLgQuy2wa3nNhJdBAPorux5F96eMYemANw0MSntAFc8oNBVy5SVATu9ge LwzWkLWKE0qOColhQTDXMvyBv7oZSTx9yiJmVt6SgfXnnlN3XIctrJe/EO8vcrvqC/eJ RS85au465jd8gcSbEhlQIWny88YHmcnfknSz1uSbnCI3KCW4I4q33nebzMUV0qEflpL1 VZq8tD23zLPl8yWN5kNFMKXIPO13amms1D9D/AJKdEKmlKu5DB0vNRt9p4SWmmP+B593 b6zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789727875; x=1790332675; 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=D3k/Ow2al/XHfxcn1bI9+a8nHT40TlMsFSyhCT6ag+o=; b=PtuFwEXbFKw7XQ6a5+gnCX/cXH14KCuOsKuSOFMUacJGu5SIndU9lGmzWWddb2+cSy 0EUNP3rRsxoRuLqJyRuBdSlYMP8sqMVmZ8BE8F/6vLXsq37jsmZW1iyPj44C4OV1Inyy U3LcDvwmPwjLjiqTjSBuh4Mz69EVqq89RK/jYnzLYkF4HlgoIngoJomyVPi1t9VomeNz oTfdm5CsYTtMKKr2Vdf6fjFSbpwjTywGQx14+6wxI7keR1LuzknW1pflHz3Io3Mc3sxJ gXGcV3mjISlkJ8Q+MBY5ED8+2sBxxsSLx+uErZGt2770LzpF64CQQ4fPjwdXchbUQoWU OfUA== X-Gm-Message-State: AFuF++nR/rHL0W8Ldj53PBKMzGFpshXbn5ijAL+edQR6XSyl5FqXNiIJ MIUx0kWpgChr33LNX6rUK+DFJc9EK35S9WZUJv4oa4F/cgPz9ZTE8KAKL/sQR64T X-Gm-Gg: AYBFou3d8aC9+ejOAa7eVpY+AVJosntxgqPIQszFDqnSv9xM2J1/4+NIuCsXpWE6YCz qQRehnLZyMms6hbTbvI00oa78N5o7N6gcc5RPLijrnPeREkL2LyaB5CHf8PjyzEBTfCNYoOjxDp mQMJ93tN1QNPMUEimI9V9cTo5ThUINkeYs6Jf5eO7sHFgMtnPxYCPh8bUUxs1D+Un1skixLEsu5 LZoU2Ro4qx+x2+7LjE3mDSX291hn8DCpYR4eY1H/s4OOY2E7EioZGLiRDCnESi/KIXUVdLwCIQL ucXkckJViU0KihDgLHGLGJBZcrRrXMaNgym4LteGJ32g4VM7oOmQPdYyiMa08OzhZAH1GvIb4ed 3HT/oulS4xX4G5xHfgo9HIwREi3mcwzl4S23X3VpjNuV7IRYGQZKDWYJCqW+e/6jCC4/obK9ED4 RXk08fAY2IpSzzZmFpAhj3+spK9ZWd1ziU7vMz6nfqSPfjp0opXNLfIuUdsqotqEHHfXwh3P9VN ixcW2u4Ra24rkVGk4Hr2NBVXAJq X-Received: by 2002:a17:902:e74b:b0:2dd:ad7d:72e5 with SMTP id d9443c01a7336-2ddad7d7521mr40154845ad.28.1789727874523; Fri, 18 Sep 2026 03:37:54 -0700 (PDT) Received: from localhost.localdomain ([122.171.19.232]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33c2890b915sm3355692eec.30.2026.09.18.03.37.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 18 Sep 2026 03:37:54 -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 Subject: [PATCH v2] Remove stale pre-AIX-7.2 compatibility guards Date: Fri, 18 Sep 2026 16:06:51 +0530 Message-ID: <20260918103650.36233-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 Kamath 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. Remove the HAVE_DECL_GETTHRDS configure check since aix-thread.c was the last user of that macro. Merge ptrace64aix and ptrace32 into a single ptrace_aix function since they became identical after this cleanup, and collapse all call sites that branched on arch64 just to pick between the two. Also clean up rs6000-aix-nat.c by removing the ARCH3264 and HAVE_PTRACE64 guards along with the ptracex fallback in rs6000_ptrace32 and rs6000_ptrace64, which are now simple wrappers around ptrace64. Also as per https://www.ibm.com/docs/en/aix/7.2.0?topic=p-ptrace-ptracex-ptrace64-subroutine ptrace64 will also support 32-bit debugees. --- gdb/aix-thread.c | 216 +++++++++++-------------------------------- gdb/config.in | 4 - gdb/configure | 16 ---- gdb/configure.ac | 5 - gdb/rs6000-aix-nat.c | 47 +--------- 5 files changed, 61 insertions(+), 227 deletions(-) diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 5ac71d22237..b4b9efca5d4 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,40 +306,13 @@ 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) +ptraceaix (int req, int id, long long addr, int data, int *buf) { errno = 0; - 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) -{ - 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 @@ -444,14 +408,14 @@ pdc_read_regs (pthdb_user_t user_current_pid, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_GPRS, tid, + if (!ptraceaix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL)) memset (gprs64, 0, sizeof (gprs64)); memcpy (context->gpr, gprs64, sizeof(gprs64)); } else { - if (!ptrace32 (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL)) + if (!ptraceaix (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL)) memset (gprs32, 0, sizeof (gprs32)); memcpy (context->gpr, gprs32, sizeof(gprs32)); } @@ -460,7 +424,7 @@ pdc_read_regs (pthdb_user_t user_current_pid, /* Floating-point registers. */ if (flags & PTHDB_FLAG_FPRS) { - if (!ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL)) + if (!ptraceaix (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL)) memset (fprs, 0, sizeof (fprs)); memcpy (context->fpr, fprs, sizeof(fprs)); } @@ -470,14 +434,14 @@ pdc_read_regs (pthdb_user_t user_current_pid, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_SPRS, tid, + if (!ptraceaix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, NULL)) memset (&sprs64, 0, sizeof (sprs64)); memcpy (&context->msr, &sprs64, sizeof(sprs64)); } else { - if (!ptrace32 (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL)) + if (!ptraceaix (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL)) memset (&sprs32, 0, sizeof (sprs32)); memcpy (&context->msr, &sprs32, sizeof(sprs32)); } @@ -487,36 +451,18 @@ pdc_read_regs (pthdb_user_t user_current_pid, __vmx_context_t vmx; if (__power_vmx() && (flags & PTHDB_FLAG_REGS)) { - if (data->arch64) - { - if (!ptrace64aix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0)) - memset (&vmx, 0, sizeof (vmx)); - memcpy (&context->vmx, &vmx, sizeof(__vmx_context_t)); - } - else - { - if (!ptrace32 (PTT_READ_VEC, tid, (long long) &vmx, 0, 0)) - memset (&vmx, 0, sizeof (vmx)); - memcpy (&context->vmx, &vmx, sizeof(__vmx_context_t)); - } + if (!ptraceaix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0)) + memset (&vmx, 0, sizeof (vmx)); + memcpy (&context->vmx, &vmx, sizeof (__vmx_context_t)); } /* vsx registers. */ __vsx_context_t vsx; if (__power_vsx() && (flags & PTHDB_FLAG_REGS)) { - if (data->arch64) - { - if (!ptrace64aix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0)) - memset (&vsx, 0, sizeof (vsx)); - memcpy (&context->vsx, &vsx, sizeof(__vsx_context_t)); - } - else - { - if (!ptrace32 (PTT_READ_VSX, tid, (long long) &vsx, 0, 0)) - memset (&vsx, 0, sizeof (vsx)); - memcpy (&context->vsx, &vsx, sizeof(__vsx_context_t)); - } + if (!ptraceaix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0)) + memset (&vsx, 0, sizeof (vsx)); + memcpy (&context->vsx, &vsx, sizeof (__vsx_context_t)); } return 0; } @@ -547,51 +493,23 @@ pdc_write_regs (pthdb_user_t user_current_pid, /* General-purpose registers. */ if (flags & PTHDB_FLAG_GPRS) - { - if (data->arch64) - ptrace64aix (PTT_WRITE_GPRS, tid, - (unsigned long) context->gpr, 0, NULL); - else - ptrace32 (PTT_WRITE_GPRS, tid, (uintptr_t) context->gpr, 0, NULL); - } + ptraceaix (PTT_WRITE_GPRS, tid, (long long) context->gpr, 0, NULL); - /* Floating-point registers. */ + /* Floating-point registers. */ if (flags & PTHDB_FLAG_FPRS) - { - ptrace32 (PTT_WRITE_FPRS, tid, (uintptr_t) context->fpr, 0, NULL); - } + ptraceaix (PTT_WRITE_FPRS, tid, (long long) context->fpr, 0, NULL); /* Special-purpose registers. */ if (flags & PTHDB_FLAG_SPRS) - { - if (data->arch64) - { - ptrace64aix (PTT_WRITE_SPRS, tid, - (unsigned long) &context->msr, 0, NULL); - } - else - { - ptrace32 (PTT_WRITE_SPRS, tid, (uintptr_t) &context->msr, 0, NULL); - } - } + ptraceaix (PTT_WRITE_SPRS, tid, (long long) &context->msr, 0, NULL); /* vector registers. */ if (__power_vmx() && (flags & PTHDB_FLAG_REGS)) - { - if (data->arch64) - ptrace64aix (PTT_WRITE_VEC, tid, (unsigned long) &context->vmx, 0, 0); - else - ptrace32 (PTT_WRITE_VEC, tid, (uintptr_t) &context->vmx, 0, 0); - } + ptraceaix (PTT_WRITE_VEC, tid, (long long) &context->vmx, 0, 0); /* vsx registers. */ if (__power_vsx() && (flags & PTHDB_FLAG_REGS)) - { - if (data->arch64) - ptrace64aix (PTT_WRITE_VSX, tid, (unsigned long) &context->vsx, 0, 0); - else - ptrace32 (PTT_WRITE_VSX, tid, (uintptr_t) &context->vsx, 0, 0); - } + ptraceaix (PTT_WRITE_VSX, tid, (long long) &context->vsx, 0, 0); return 0; } @@ -1078,12 +996,8 @@ aix_thread_target::resume (ptid_t ptid, int step, enum gdb_signal sig) ptid.lwp ()); tid[1] = 0; - if (data->arch64) - 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, - gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid); + ptraceaix (PTT_CONTINUE, tid[0], (long long) 1, + gdb_signal_to_host (sig), (PTRACE_TYPE_ARG5) tid); } } @@ -1357,14 +1271,14 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_GPRS, tid, + if (!ptraceaix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL)) memset (gprs64, 0, sizeof (gprs64)); supply_gprs64 (regcache, gprs64); } else { - if (!ptrace32 (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL)) + if (!ptraceaix (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL)) memset (gprs32, 0, sizeof (gprs32)); for (i = 0; i < ppc_num_gprs; i++) supply_reg32 (regcache, tdep->ppc_gp0_regnum + i, gprs32[i]); @@ -1377,9 +1291,9 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, int ret = 0; __vmx_context_t vmx; if (data->arch64) - ret = ptrace64aix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); + ret = ptraceaix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); else - ret = ptrace32 (PTT_READ_VEC, tid, (uintptr_t) &vmx, 0, 0); + ret = ptraceaix (PTT_READ_VEC, tid, (uintptr_t) &vmx, 0, 0); if (ret < 0) memset(&vmx, 0, sizeof(__vmx_context_t)); for (i = 0; i < ppc_num_vrs; i++) @@ -1394,9 +1308,9 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, __vsx_context_t vsx; int ret = 0; if (data->arch64) - ret = ptrace64aix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); + ret = ptraceaix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); else - ret = ptrace32 (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); + ret = ptraceaix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); if (ret < 0) memset(&vsx, 0, sizeof(__vsx_context_t)); for (i = 0; i < ppc_num_vshrs; i++) @@ -1410,7 +1324,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, || (regno >= tdep->ppc_fp0_regnum && regno < tdep->ppc_fp0_regnum + ppc_num_fprs))) { - if (!ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL)) + if (!ptraceaix (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL)) memset (fprs, 0, sizeof (fprs)); supply_fprs (regcache, fprs); } @@ -1421,7 +1335,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_SPRS, tid, + if (!ptraceaix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, NULL)) memset (&sprs64, 0, sizeof (sprs64)); supply_sprs64 (regcache, sprs64.pt_iar, sprs64.pt_msr, @@ -1430,7 +1344,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, } else { - if (!ptrace32 (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL)) + if (!ptraceaix (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL)) memset (&sprs32, 0, sizeof (sprs32)); supply_sprs32 (regcache, sprs32.pt_iar, sprs32.pt_msr, sprs32.pt_cr, sprs32.pt_lr, sprs32.pt_ctr, sprs32.pt_xer, @@ -1783,16 +1697,16 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, if (data->arch64) { /* Pre-fetch: some regs may not be in the cache. */ - ptrace64aix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL); + ptraceaix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL); fill_gprs64 (regcache, gprs64); - ptrace64aix (PTT_WRITE_GPRS, tid, (unsigned long) gprs64, 0, NULL); + ptraceaix (PTT_WRITE_GPRS, tid, (unsigned long) gprs64, 0, NULL); } else { /* Pre-fetch: some regs may not be in the cache. */ - ptrace32 (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL); + ptraceaix (PTT_READ_GPRS, tid, (uintptr_t) gprs32, 0, NULL); fill_gprs32 (regcache, gprs32); - ptrace32 (PTT_WRITE_GPRS, tid, (uintptr_t) gprs32, 0, NULL); + ptraceaix (PTT_WRITE_GPRS, tid, (uintptr_t) gprs32, 0, NULL); } } @@ -1804,9 +1718,9 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, && regno < tdep->ppc_fp0_regnum + ppc_num_fprs))) { /* Pre-fetch: some regs may not be in the cache. */ - ptrace32 (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL); + ptraceaix (PTT_READ_FPRS, tid, (uintptr_t) fprs, 0, NULL); fill_fprs (regcache, fprs); - ptrace32 (PTT_WRITE_FPRS, tid, (uintptr_t) fprs, 0, NULL); + ptraceaix (PTT_WRITE_FPRS, tid, (uintptr_t) fprs, 0, NULL); } /* Special-purpose registers. */ @@ -1816,47 +1730,29 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, if (data->arch64) { /* Pre-fetch: some registers won't be in the cache. */ - ptrace64aix (PTT_READ_SPRS, tid, - (unsigned long) &sprs64, 0, NULL); + ptraceaix (PTT_READ_SPRS, tid, + (unsigned long) &sprs64, 0, NULL); fill_sprs64 (regcache, &sprs64.pt_iar, &sprs64.pt_msr, &sprs64.pt_cr, &sprs64.pt_lr, &sprs64.pt_ctr, &sprs64.pt_xer, &sprs64.pt_fpscr); - ptrace64aix (PTT_WRITE_SPRS, tid, - (unsigned long) &sprs64, 0, NULL); + ptraceaix (PTT_WRITE_SPRS, tid, + (unsigned long) &sprs64, 0, NULL); } 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); + ptraceaix (PTT_READ_SPRS, tid, (uintptr_t) &sprs32, 0, NULL); - 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 (tdep->ppc_mq_regnum)) regcache->raw_collect (tdep->ppc_mq_regnum, &sprs32.pt_mq); - ptrace32 (PTT_WRITE_SPRS, tid, (uintptr_t) &sprs32, 0, NULL); + ptraceaix (PTT_WRITE_SPRS, tid, (uintptr_t) &sprs32, 0, NULL); } } @@ -1869,16 +1765,16 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, if (__power_vmx()) { if (data->arch64) - ret = ptrace64aix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); + ret = ptraceaix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); else - ret = ptrace32 (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); + ret = ptraceaix (PTT_READ_VEC, tid, (long long) &vmx, 0, 0); if (ret > 0) { fill_altivec(regcache, &vmx); if (data->arch64) - ret = ptrace64aix (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); + ret = ptraceaix (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); else - ret = ptrace32 (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); + ret = ptraceaix (PTT_WRITE_VEC, tid, (long long) &vmx, 0, 0); if (ret < 0) perror_with_name (_("Unable to store AltiVec register after read")); } @@ -1894,16 +1790,16 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, if (__power_vsx()) { if (data->arch64) - ret = ptrace64aix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); + ret = ptraceaix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); else - ret = ptrace32 (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); + ret = ptraceaix (PTT_READ_VSX, tid, (long long) &vsx, 0, 0); if (ret > 0) { fill_vsx (regcache, &vsx); if (data->arch64) - ret = ptrace64aix (PTT_WRITE_VSX, tid, (long long) &vsx, 0, 0); + ret = ptraceaix (PTT_WRITE_VSX, tid, (long long) &vsx, 0, 0); else - ret = ptrace32 (PTT_WRITE_VSX, tid, (long long) &vsx, 0, 0); + ret = ptraceaix (PTT_WRITE_VSX, tid, (long long) &vsx, 0, 0); if (ret < 0) perror_with_name (_("Unable to store VSX register after read")); } diff --git a/gdb/config.in b/gdb/config.in index 74745665d4d..b68cc29d587 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 diff --git a/gdb/configure b/gdb/configure index f411113ea66..0ed570e0571 100755 --- a/gdb/configure +++ b/gdb/configure @@ -31138,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 5d8e2d6628f..20d4bef68d4 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1914,11 +1914,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/rs6000-aix-nat.c b/gdb/rs6000-aix-nat.c index 276df378824..ada24b19779 100644 --- a/gdb/rs6000-aix-nat.c +++ b/gdb/rs6000-aix-nat.c @@ -60,24 +60,9 @@ /* Header files for alti-vec reg. */ #include -/* On AIX4.3+, sys/ldr.h provides different versions of struct ld_info for - debugging 32-bit and 64-bit processes. Define a typedef and macros for - accessing fields in the appropriate structures. */ - -/* In 32-bit compilation mode (which is the only mode from which ptrace() - works on 4.3), __ld_info32 is #defined as equivalent to ld_info. */ - -#if defined (__ld_info32) || defined (__ld_info64) -# define ARCH3264 -#endif - /* Return whether the current architecture is 64-bit. */ -#ifndef ARCH3264 -# define ARCH64() 0 -#else -# define ARCH64() (register_size (current_inferior ()->arch (), 0) == 8) -#endif +#define ARCH64() (register_size (current_inferior ()->arch (), 0) == 8) class rs6000_nat_target final : public inf_ptrace_target { @@ -246,42 +231,20 @@ regmap (struct gdbarch *gdbarch, int regno, int *isfloat) return -1; } -/* Call ptrace(REQ, ID, ADDR, DATA, BUF). */ +/* Call ptrace64(REQ, ID, ADDR, DATA, BUF). */ static int rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf) { -#ifdef HAVE_PTRACE64 - int ret = ptrace64 (req, id, (uintptr_t) addr, data, buf); -#else - int ret = ptrace (req, id, (int *)addr, data, buf); -#endif -#if 0 - printf ("rs6000_ptrace32 (%d, %d, 0x%x, %08x, 0x%x) = 0x%x\n", - req, id, (unsigned int)addr, data, (unsigned int)buf, ret); -#endif - return ret; + return ptrace64 (req, id, (uintptr_t) addr, data, buf); } -/* Call ptracex(REQ, ID, ADDR, DATA, BUF). */ +/* Call ptrace64(REQ, ID, ADDR, DATA, BUF). */ static int rs6000_ptrace64 (int req, int id, long long addr, int data, void *buf) { -#ifdef ARCH3264 -# ifdef HAVE_PTRACE64 - int ret = ptrace64 (req, id, addr, data, (PTRACE_TYPE_ARG5) buf); -# else - int ret = ptracex (req, id, addr, data, (PTRACE_TYPE_ARG5) buf); -# endif -#else - int ret = 0; -#endif -#if 0 - printf ("rs6000_ptrace64 (%d, %d, %s, %08x, 0x%x) = 0x%x\n", - req, id, hex_string (addr), data, (unsigned int)buf, ret); -#endif - return ret; + return ptrace64 (req, id, addr, data, (PTRACE_TYPE_ARG5) buf); } /* Store the vsx registers. */ -- 2.51.2