From 0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb Mon Sep 17 00:00:00 2001 From: Aditya Vidyadhar Kamath Date: Thu, 25 Jan 2024 06:28:29 -0600 Subject: Fix attach-twice.c testcase for AIX. Currently, in AIX attach-twice.exp testcase is untested due to the below error. gdb/testsuite/gdb.base/attach-twice.c:43:7: error: too few arguments to function 'ptrace' This is because in AIX ptrace has five arguments. This patch is a fix for the same such that this test case runs in AIX and other targets as well. --- gdb/testsuite/gdb.base/attach-twice.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gdb/testsuite/gdb.base/attach-twice.c b/gdb/testsuite/gdb.base/attach-twice.c index ecb882a..7b0af35 100644 --- a/gdb/testsuite/gdb.base/attach-twice.c +++ b/gdb/testsuite/gdb.base/attach-twice.c @@ -38,9 +38,15 @@ main (void) exit (1); case 0: errno = 0; + #if defined(_AIX) && defined (__64BIT__) + ptrace64 (PTRACE_ATTACH, getppid (), NULL, 0, NULL); + #elif defined(_AIX) && !defined (__64BIT__) + ptrace (PTRACE_ATTACH, getppid (), NULL, 0, NULL); + #else /* The 4th argument to ptrace () is 0 on purpose, as it is compatible between kernels that accept void* (like Linux) and int (NetBSD). */ ptrace (PTRACE_ATTACH, getppid (), NULL, 0); + #endif if (errno != 0) perror ("PTRACE_ATTACH"); break; -- cgit v1.1