This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Core file support for bare metal ARM eabi/elf-none-targets?
- From: Fredrik Hederstierna <fredrik dot hederstierna at securitas-direct dot com>
- To: gdb at sourceware dot org
- Date: Wed, 11 Apr 2012 16:28:58 +0200
- Subject: Core file support for bare metal ARM eabi/elf-none-targets?
- References:
Hi
I use bare-metal GCC/GDB arm-none-elf and arm-non-eabi toolchains.
It would be great if also 'non-Linux' targets could benefit from core-file support.
Systems using just a simple scheduler, or a simple embedded OS, could possibly generate core-files 'by hand' when crashing or asserting.
Our system eg. does put all RAM in a dedicated flash sector when asserting, then after reboot system, a core-file is generated and retrieved by a developer at a later time.
I guess this is a common and simple way of generating a core-file in an embedded system.
Also the core-files can be sent in from the field from real customers, and not only while being connected with GDB and JTAG.
The problem is that the 'bare-metal' GDB seems not to support core-files, I guess to arm-none format is undefined.
So currently we 'fake' the core-file to be an Linux-core, but this does not seem right (even though it works fine).
If I look in "arm-tdep.c" in function "arm_gdbarch_init()", there is no support for core-file in the setup.
The 'configure.tgt' does not even include 'corelow.o' for none-target:
arm*-*-*)
??? # Target: ARM embedded system
??? gdb_target_obs="arm-tdep.o"
??? gdb_sim=../sim/arm/libsim.a
??? ;;
In "arm-linux-tdep.c" there is support for Linux-core in the setup, making calls like:
/* 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);
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
What if some of this could be moved up to 'arm-tdep.c', or could it possibly be defined a basic core-file for a 'arm-none-target'?
This core format could possibly be used by all bare metal ARM systems for basic debugging?
Thanks & Best Regards,
Fredrik Hederstierna