This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Make corefile support in arm-linux generic for arm-* ?
- From: "sarah at hederstierna dot com" <fredrik at hederstierna dot com>
- To: "gdb at sourceware dot org" <gdb at sourceware dot org>
- Date: Fri, 20 Jul 2012 09:01:19 +0200
- Subject: Make corefile support in arm-linux generic for arm-* ?
Hi
I'm looking into getting core-file support for ARM non-linux targets.
Looking into 'arm-tdep.c' and 'arm-linux-tdep.c' I just wonder if it would be possible to move possible generic parts up to 'arm-tdep.c' ?
I was thinking core-file default support could possibly be initiated in 'arm-tdep.c' before calling
/* Hook in the ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
I was thinking of eg. (from 'arm-linux-tdef.c':
/* Core file support. */
set_gdbarch_regset_from_core_section (gdbarch,
arm_linux_regset_from_core_section);
set_gdbarch_core_read_description (gdbarch, arm_linux_core_read_description);
if (tdep->have_vfp_registers)
set_gdbarch_core_regset_sections (gdbarch, arm_linux_vfp_regset_sections);
else if (tdep->have_fpa_registers)
set_gdbarch_core_regset_sections (gdbarch, arm_linux_fpa_regset_sections);
Just renaming stuff excluding '_linux_' and move functions to 'arm-tdef.c' ? eg.
arm_linux_regset_from_core_section ---> arm_regset_from_core_section
arm_linux_core_read_description ---> arm_core_read_description
arm_linux_vfp_regset_sections ---> etc
arm_linux_fpa_regset_sections
As I see it some parts seems quite generic and could be re-used for default corefile hanlding, eg. bare-metal arm-targets.
It would be really nice if it was possible to be able to run 'generate-corefile' and similar out-of-the-box from an ARM bare-metal toolchain.
What do you think?
Any other further ideas how to get default core-file support for ARM bare-metal non-linux targets are also welcome! :-)
Thanks and Best Regards
/Fredrik