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: PR gdb/13969: GDBserver doesn't check unsupported binary


On Thu, Apr 12, 2012 at 9:38 AM, Pedro Alves <palves@redhat.com> wrote:
> On 04/12/2012 05:25 PM, H.J. Lu wrote:
>
>> On Thu, Apr 12, 2012 at 8:57 AM, Pedro Alves <palves@redhat.com> wrote:
>>> On 04/12/2012 04:37 PM, H.J. Lu wrote:
>>>
>>>> It doesn't work since x32 is a 32-bit process. ?Although x32
>>>> GDBserver can get registers of 64-bit process, ?it can't handle 64-bit address
>>>
>>>> in 64b-bit process, like setting break points.
>>>
>>> Oh yeah... ?PowerPC has PPC_PTRACE_PEEKDATA_3264/PPC_PTRACE_POKEDATA_3264
>>> for that, but well, it's PowerPC specific.
>>>
>>
>> Also x32 siginfo is different from 64bit signfo. X32 ptrace can't get 64bit
>> siginfo due to address fields in siginfo.
>
>
> Are you certain about that? ?With a 64-bit debugger vs 32-bit process,
> PTRACE_GETSIGINFO returns the siginfo in 64-bit layout. ?I could see the
> kernel returning 64-bit siginfo for x32 too (it's a question of whether
> the kernel returns its native layout, or the debugger's).
>
> In the 64x32 case, GDB has to go through contortions to
> translate the siginfo layout (in both directions), for the
> $_siginfo convenience variable's support. ?This ends up needing to
> replicate what the kernel's compat layer does. ?IMO, a PTRACE_
> method that always returned the siginfo object in the layout of the
> inferior would be nice.
>

x32 ptrace returns x32 siginfo, which is compatible with
ia32 inferior, but not 64bit inferior, due to

	/* SIGILL, SIGFPE, SIGSEGV, SIGBUS.  */
	struct
	  {
	    void *si_addr;	/* Faulting insn/memory ref.  */
	  } _sigfault;

si_addr is 32bit for x32 ptrace.


-- 
H.J.


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