This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 3/5] powerpc64-aix inf-ptrace patch
- From: Raunaq 12 <raunaq12 at in dot ibm dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org, mark dot kettenis at xs4all dot nl, tromey at redhat dot com
- Date: Tue, 23 Jul 2013 18:26:01 +0530
- Subject: Re: [PATCH 3/5] powerpc64-aix inf-ptrace patch
- References: <OF8903680D dot BD89C8FA-ON65257BB1 dot 001EA3F4-65257BB1 dot 001EB66B at in dot ibm dot com> <201307230901 dot r6N91Tfu005129 at glazunov dot sibelius dot xs4all dot nl>
Thanks a lot for the feedback Mark.
> No this will break other systems. Instead, make sure PTRACE_TYPE_ARG3
> gets defined to the proper type of the 3rd argument of ptrace64 when
> you choose to use it. I'd expect that if you add the autoconf check I
> mentioned you could simply change the #ifdef PTRACE_TYPE_ARG5 in
> gdb_ptrace.h to something like:
>
> #ifdef PTRACE_TYPE_ARG5
> # 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
The above suggestion of defining PTRACE_TYPE_ARG3 in gdb_ptrace.h works
very fine.
Thanks for that
I can add an autoconf check like -
AC_CHECK_FUNCS(ptrace64)
and then in gdb_ptrace.h i can add -
#ifdef PTRACE_TYPE_ARG5
# if defined (__64BIT__) && defined (HAVE_PTRACE64)
# ....
Note:- ptrace64 is defined in both 32 and 64 bit mode. But we need to use
ptrace64 only when we compile gdb in 64 BIT mode hence the __64BIT__ check.
Or I can also use the AC_CHECK_SIZEOF(long) to check if we are in 64 bit
mode.
Which do you suggest? or, is there a better way of checking this ?