public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Fix attach-twice.c testcase for AIX.
@ 2024-01-25 13:55 Ulrich Weigand
0 siblings, 0 replies; only message in thread
From: Ulrich Weigand @ 2024-01-25 13:55 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb
commit 0759c1bc9f0eb096ac5a04ce4abb1510e9963fbb
Author: Aditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>
Date: Thu Jan 25 06:28:29 2024 -0600
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.
Diff:
---
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 ecb882a0e7b..7b0af35a566 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-01-25 13:55 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-25 13:55 [binutils-gdb] Fix attach-twice.c testcase for AIX Ulrich Weigand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).