diff options
author | Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com> | 2024-01-25 06:28:29 -0600 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2024-01-25 14:55:27 +0100 |
commit | 0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb (patch) | |
tree | f815259bd70fe77de32f7338cedfc27ed51965f3 | |
parent | 3eb33b8875a032678c375a76f689f928f57dfb15 (diff) | |
download | binutils-0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb.zip binutils-0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb.tar.gz binutils-0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb.tar.bz2 |
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.
-rw-r--r-- | gdb/testsuite/gdb.base/attach-twice.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; |