Project

General

Profile

Possible to recreate .elf file with dwarf info for debugging purpose?

Added by Runar Tenfjord 12 months ago

Hi,

I was wondering if there is any possibility to merge the .dbg file with
the raw binary created for debugging purposes?

Currently I just run this:

objcopy.exe --input-target=binary --output-target=elf32-little test.rom test.elf

in order to create a .elf file for gdb.

The dbgdwarf command creates dwarf information which might be
merged with the .elf file (or perhaps loaded into gdb as a separate step)?

I tried to search for a solution, but could not find any. Likely due to the
common terms "elf" and "dwarf" which trigger a lot of false searches or
google has degraded in quality.

Best regards


Replies (2)

RE: Possible to recreate .elf file with dwarf info for debugging purpose? - Added by Florian Negele 12 months ago

Sorry, but DWARF debugging information is only available when linking against a runtime that directly generates ELF files at the moment. Maybe it is possible the other way round: Use objcopy to extract the binary from a generated ELF file that contains debugging information?

RE: Possible to recreate .elf file with dwarf info for debugging purpose? - Added by Runar Tenfjord 12 months ago

Excellent.

I will try this and creating a runtime
from the code in armt32linuxrun.asm
to create the .elf file with debug information.

The target is an MCU (STM32) and it should be
possible to write to flash memory from the .elf file.

If that does not work I can just create the .rom file separately
and flash that separately as I do now.

    (1-2/2)