Re: [0/2] Inspect extra signal information

Pedro Alves
2009-02-03T23:50:40Z

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