Re: [0/2] Inspect extra signal information

Daniel Jacobowitz
2009-02-04T00:24:47Z

On Tue, Feb 03, 2009 at 07:51:44PM +0000, Pedro Alves wrote:
> I was thinking on doing this in the arch specific native files, e.g,
> gdb/amd64-linux-nat.c, gdb/ppc-linux-nat.c, etc., and something similar in
> gdbserver too.
>
> Just to make sure, where you perhaps thinking of something
> entirely different? I don't see how to make this in a common native
> file.

What Doug described is pretty similar to what I had in mind; it does
not fix the issue for gdbserver, but does for gdb. Read each field of
the ptrace buffer, then use gdbarch to retrieve the type this would be
expected to have in the inferior. Use gdb's type/value machinery to
store the raw fields into the new value. Pass that value's contents
back through the target layer to gdb, which will see the right values
because it uses the same gdbarch to interpret them.

Now, whether those hoops are worth it is another question. If we have
to do this in gdbserver anyway, we could use the same method in gdb.
I vaguely remember having to do something similar for Solaris's
procfs.

Only biarch platforms would have this problem, and fortunately there
aren't too many.

--
Daniel Jacobowitz
CodeSourcery