[0/2] Inspect extra signal information

Pedro Alves pedro@codesourcery.com
Tue Feb 3 23:50:00 GMT 2009


On Tuesday 03 February 2009 23:18:40, Doug Evans wrote:

> One can either read the struct info buffer returned by ptrace directly
> (as in the above "mumble = siginfo.si_signo;") 

Right, this is something similar to what the kernel does
in its conversion routines for 32-bit userspace support.

> or one can use a 
> constructed gdbarch siginfo type that maps directly to a struct
> siginfo buffer returned by ptrace and use that to access it.  Then one
> could write a routine that given either of those (pick one), and a
> pointer to the desired siginfo type, and returns a new value in the
> desired type.

When connected to a 64-bit gdbserver that is debugging a 32-bit
inferior, how would gdb know that the binary blob that is coming out
of TARGET_OBJECT_SIGNAL_INFO has the 64-bit layout, and that it
needs to be converted?  All gdbarchs that we have accessible tell us
about the inferior arch, which is 32-bit.  gdb has no idea that the
gdbserver is running a 64-bit ptrace.

> 
> With this gdbserver can continue to just pass the raw buffer back to
> gdb.  

I don't see how given that missing link.

> Otherwise I guess you'd have to switch to passing back a 
> semi-formatted buffer of values from gdbserver that gdb can then
> parse.
> 
> 
> Does that make sense?

-- 
Pedro Alves



More information about the Gdb-patches mailing list