This is the mail archive of the
mailing list for the GDB project.
Re: core regs vs. proc-service regs mess
- From: "Mark Kettenis" <mark dot kettenis at xs4all dot nl>
- To: "David S. Miller" <davem at davemloft dot net>
- Cc: drow at false dot org, gdb at sources dot redhat dot com
- Date: Wed, 5 Apr 2006 10:25:21 +0200 (CEST)
- Subject: Re: core regs vs. proc-service regs mess
- References: <firstname.lastname@example.org>
> In trying to get core files working properly again on Linux/Sparc and
> Daniel I now see the problems you referred to the other day.
> What we have currently on Linux/Sparc is:
> 1) ptrace() interfaces have one layout for regsets
> 2) ELF core files store regsets in a different
> Now proc-service.c wants fill_gregset() et al. to
> provide things in the ptrace() style layout, that is
> what libthread_db expects under Linux.
> But linux_nat_make_corefile_notes() expects the fill_gregset()
> et al. to provide ELF core file format registers.
Yes this is annoying, and ultimately caused because the ptrace(2) and
core(5) interfaces on Linux were never properly designed (heck they're not
even fully documented) and inconsistent between the different hardware
platforms. For most platforms the ptrace(2) and core(5) layout are the
same, but not on sparc (presumably because ptrace(2) on sparc tries to
be compatible with SunOS/Solaris).
> This is completely contradictory, and I don't have any idea how to
> cleanly resolve this outside of duplicating the entirety of
> linux_nat_make_corefile_notes() on Linux/Sparc which is silly.
> Daniel any ideas? :-) Maybe we can have a "linux_tdep" struct where we
> can place a "->to_fill_core_gregset()" type method or similar?
What really should happen is to convert linux_nat_make_corefile_notes() to
use the regset_from_core_section() interface. Unfortunately that is quite
a bit of work since most Linux targets don't provide that interface yet.