* GDB coredump support: reading NT_PRSTATUS instead of section ".reg"
@ 2022-01-30 21:36 William Tambe
2022-01-31 18:24 ` John Baldwin
0 siblings, 1 reply; 2+ messages in thread
From: William Tambe @ 2022-01-30 21:36 UTC (permalink / raw)
To: gdb-patches
set_gdbarch_iterate_over_regset_sections() is used to add coredump support.
However, in most examples found in the code base, we look for a
section called ".reg", which fails with "Couldn't find general-purpose
registers in core file." if such a section could not be found.
In our port, Linux stores coredump registers in NT_PRSTATUS of the core file.
How does one get GDB to use core file NT_PRSTATUS instead of section
".reg" to retrieve general-purpose registers ?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: GDB coredump support: reading NT_PRSTATUS instead of section ".reg"
2022-01-30 21:36 GDB coredump support: reading NT_PRSTATUS instead of section ".reg" William Tambe
@ 2022-01-31 18:24 ` John Baldwin
0 siblings, 0 replies; 2+ messages in thread
From: John Baldwin @ 2022-01-31 18:24 UTC (permalink / raw)
To: William Tambe, gdb-patches
On 1/30/22 1:36 PM, William Tambe via Gdb-patches wrote:
> set_gdbarch_iterate_over_regset_sections() is used to add coredump support.
>
> However, in most examples found in the code base, we look for a
> section called ".reg", which fails with "Couldn't find general-purpose
> registers in core file." if such a section could not be found.
>
> In our port, Linux stores coredump registers in NT_PRSTATUS of the core file.
>
> How does one get GDB to use core file NT_PRSTATUS instead of section
> ".reg" to retrieve general-purpose registers ?
Normally libbfd adds pseudo-sections corresponding to register notes.
Normally NT_PRSTATUS is handled in bfd/elf.c:elfcore_grok_note() or
the like called from elf_parse_notes() in the same file.
--
John Baldwin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-01-31 18:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-30 21:36 GDB coredump support: reading NT_PRSTATUS instead of section ".reg" William Tambe
2022-01-31 18:24 ` John Baldwin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).