Re: [PATCH 4/5] powerpc64-aix ptrace64 when defined.

Raunaq 12
2013-08-12T12:02:00Z

David Edelsohn <dje.gcc@gmail.com> wrote on 08/09/2013 09:23:42 PM:

> From: David Edelsohn <dje.gcc@gmail.com>
> To: Raunaq 12/India/IBM@IBMIN, Mark Kettenis <mark.kettenis@xs4all.nl>,
Ulrich Weigand
> <Ulrich.Weigand@de.ibm.com>
> Cc: gdb-patches@sourceware.org
> Date: 08/09/2013 09:22 PM
> Subject: Re: [PATCH 4/5] powerpc64-aix ptrace64 when defined.
>
> > 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.
>
> Have you tested the patch in both 32 bit mode and 64 bit mode for both
host GDB and target
> debugee?

Yes, ran the tests in testsuite/gdb.base and any new failures did not arise
when

>I tried the earlier version of this patch from last year and experienced
problems
> debugging in 32 bit mode (I no longer could debug GCC).

The earlier version of this patch was using ptrace64 only if BFD64 was
defined,
i.e. when GDB was built in 64 BIT mode.
Did you build 32 bit gdb?
If so, according to the previous version of this patch,
no ptrace related calls were changed as ptrace64 was only
called if BFD64 was defined. Could you please resend the error you got
while debugging
32 bit GCC to my mail id? I can look into it to see where the problem is
coming from.

> ptrace, ptracex and ptrace64 are defined in syscalls.exp.
>
> ptrace64                syscall3264
> # 32
> ptrace                  syscall32
> ptracex                 syscall32

> As you wrote, ptrace and ptracex are 32 bit only API; ptrace64 is
available as 32 bit and 64 bit
> API. ptrace64 is suppose to support 32 bit debugee targets, but I
experienced problems.
>
> ptrace64 will be discovered as supported by configure when building 32
bit GDB.

> Is your intention to always use ptrace64 when it is available or only to
use it for GDB hosted on
> 64 bit mode?

My initial intention was to use ptrace64 only if ptrace64 was available and
GDB was built in 64 BIT. But after a few discussions over this, I decided
to use ptrace64 when ever the API is defined.

So, this present patch would use
ptrace64 even for a 32 bit build as you rightly noticed.
This did not change the test results for a 32 bit build of GDB.

Thanks,
Raunaq M. Bathija