diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2020-11-30 12:14:38 +0000 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2021-03-05 17:21:41 +0000 |
commit | 0897bb7d6dc4e803cd99d4656186c965f099d01c (patch) | |
tree | c41cc4d854484dbc98aa8f63ff904a85862cfaed /gdb | |
parent | 95ce627aeb9df14bdaf70faf67054cb953678797 (diff) | |
download | gdb-0897bb7d6dc4e803cd99d4656186c965f099d01c.zip gdb-0897bb7d6dc4e803cd99d4656186c965f099d01c.tar.gz gdb-0897bb7d6dc4e803cd99d4656186c965f099d01c.tar.bz2 |
bfd/riscv: prepare to handle bare metal core dump creation
When creating a core file GDB will call the function
elfcore_write_prstatus to write out the general purpose registers
along with the pid/tid for the thread (into a prstatus structure) and
the executable name and arguments (into a prpsinfo_t structure).
However, for a bare metal RISC-V tool chain the prstatus_t and
prpsinfo_t types are not defined so the elfcore_write_prstatus
function will return NULL, preventing core file creation.
This commit provides the `elf_backend_write_core_note' hook and uses
the provided function to write out the required information.
In order to keep changes in the non bare metal tools to a minimum, the
provided backend function will itself return NULL when the prstatus_t
or pspsinfo_t types are available, the consequence of this is that the
generic code in elfcore_write_prstatus will be used just as before.
But, when prstatus_t or prpsinfo_t is not available, the new backend
function will write out the information using predefined offsets.
This new functionality will be used by a later GDB commit that will
add bare metal core dumps for RISC-V.
bfd/ChangeLog:
* elfnn-riscv.c (PRPSINFO_PR_FNAME_LENGTH): Define.
(PRPSINFO_PR_PSARGS_LENGTH): Define.
(riscv_write_core_note): New function.
(riscv_elf_grok_psinfo): Make use of two new length defines.
(elf_backend_write_core_note): Define.
Diffstat (limited to 'gdb')
0 files changed, 0 insertions, 0 deletions