This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/5] powerpc64-aix inf-ptrace patch


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 ?



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]