From: Raunaq 12 <raunaq12@in.ibm.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>,
Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
gdb-patches@sourceware.org
Cc: tromey@redhat.com
Subject: Re: [PATCH 4/5] powerpc64-aix ptrace64 when defined.
Date: Wed, 07 Aug 2013 13:36:00 -0000 [thread overview]
Message-ID: <OF255B53E6.ACC02537-ON65257BC0.0049EB72-65257BC0.004AB472@in.ibm.com> (raw)
In-Reply-To: <201308011325.r71DPfva000959@glazunov.sibelius.xs4all.nl>
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
> > When GDB is compiled in 64 BIT mode ptrace and ptracex calls are not
> > defined on AIX.
> > So, instead we check if ptrace64 is defined, if it is then we call that
> > instead of ptrace/x.
> >
> > Kindly review this. Thanks.
>
> I'm basically happy with the gdb_ptrace.h bit. You could apply some
> of the advice about avoiding unecessary casts to rs600-nat.c
Hi Mark,
Removed the unnecessary casts from pid in rs6000-nat.c as well.
If it is Okay to commit, Ulrich, kindly find the Changelog and
attached patch below.
This patch changes configure.ac so configure and config.in should
be regenerated.
---
Changelog :-
* gdb_ptrace.h: Use ptrace64 instead of ptrace if HAVE_PTRACE64 is defined.
* rs6000-nat.c: Check for __ld_info64_ if compiling 64 BIT gdb.
(rs6000_ptrace32): Call ptrace64 instead of ptrace if present.
(rs6000_ptrace64): Call ptace64 instead of ptracex if present.
* configure.ac: Check for ptrace64.
* configure, config.in: Regenerate.
(See attached file: gdb-7.6-defptrace64.patch)
Thanks,
Raunaq M. Bathija
[-- Attachment #2: gdb-7.6-defptrace64.patch --]
[-- Type: application/octet-stream, Size: 2271 bytes --]
Index: ./gdb/gdb_ptrace.h
===================================================================
--- ./gdb.orig/gdb_ptrace.h
+++ ./gdb/gdb_ptrace.h
@@ -135,7 +135,15 @@
zero. */
#ifdef PTRACE_TYPE_ARG5
-# define ptrace(request, pid, addr, data) ptrace (request, pid, addr, data, 0)
+# 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
#endif
#endif /* gdb_ptrace.h */
Index: ./gdb/rs6000-nat.c
===================================================================
--- ./gdb.orig/rs6000-nat.c
+++ ./gdb/rs6000-nat.c
@@ -66,7 +66,7 @@
/* 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. */
-#ifdef __ld_info32
+#if defined (__ld_info32) || defined (__ld_info64)
# define ARCH3264
#endif
@@ -132,7 +132,11 @@
static int
rs6000_ptrace32 (int req, int id, int *addr, int data, int *buf)
{
+ #ifdef HAVE_PTRACE64
+ int ret = ptrace64 (req, id, (long long) 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);
@@ -146,7 +150,11 @@
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, buf);
+ #else
int ret = ptracex (req, id, addr, data, buf);
+ #endif
#else
int ret = 0;
#endif
Index: ./gdb/configure.ac
===================================================================
--- ./gdb.orig/configure.ac
+++ ./gdb/configure.ac
@@ -1180,7 +1180,7 @@
sigaction sigprocmask sigsetmask socketpair syscall \
ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
setrlimit getrlimit posix_madvise waitpid lstat \
- fdwalk pipe2])
+ fdwalk pipe2 ptrace64])
AM_LANGINFO_CODESET
# Check the return and argument types of ptrace. No canned test for
next prev parent reply other threads:[~2013-08-07 13:36 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-01 11:28 Raunaq 12
2013-08-01 13:26 ` Mark Kettenis
2013-08-02 6:56 ` Raunaq 12
[not found] ` <OF21D042FF.CF4E8435-ON65257BBB.0024F10A-65257BBB.00261FEF@LocalDomain>
2013-08-07 11:39 ` Raunaq 12
2013-08-07 13:36 ` Raunaq 12 [this message]
2013-08-07 14:44 ` Ulrich Weigand
[not found] <CAGWvnynVeLt6F-QREsP_CtQvwvtZgwqHxtcS6pn58LMf=AX=GA@mail.gmail.com>
2013-08-12 12:02 ` Raunaq 12
2013-08-12 15:53 ` David Edelsohn
2013-08-12 12:11 ` Raunaq 12
2013-08-12 19:43 ` David Edelsohn
2013-08-22 23:32 ` Joel Brobecker
-- strict thread matches above, loose matches on Subject: below --
2013-08-10 2:57 David Edelsohn
2013-07-29 6:17 Raunaq 12
2013-07-24 13:01 Raunaq 12
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=OF255B53E6.ACC02537-ON65257BC0.0049EB72-65257BC0.004AB472@in.ibm.com \
--to=raunaq12@in.ibm.com \
--cc=Ulrich.Weigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=mark.kettenis@xs4all.nl \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox