I am really stuck on this issue: I'm trying to get debugging working, which was successful before when I've only compiled one single file (https://github.com/maxgerhardt/stm8-headers-pio). Now I'm compiling STMicro's SPL framework, a simple SPL-Blink example. The resulting ELF file however has broken DWARF information, and stm8-gdb (stm8-binutils-gdb.sourceforge.io/) as well as readelf -wi complain about this, making debugging impossible.
<2><b0>: Abbrev Number: 3 (DW_TAG_structure_type)
<b1> DW_AT_sibling : <0x105>
<b5> DW_AT_name : GPIO_struct
<c1> DW_AT_byte_size : 5
<3><c2>: Abbrev Number: 4 (DW_TAG_volatile_type)
<c3> DW_AT_type : <0x11a>readelf: Warning: Unable to find entry for abbreviation 117
[...]
<1><411>: Abbrev Number: 15 (DW_TAG_variable)
<412> DW_AT_location : 5 byte block: 3 0 0 80 8c (DW_OP_addr: 808c)
<418> DW_AT_name : __str_0
<420> DW_AT_type : <0x405>readelf: Warning: Unable to find entry for abbreviation 0
<1><424>: Abbrev Number: 0
<0><425>: Abbrev Number: 0
readelf: Warning: Bogus end-of-siblings marker detected at offset 425 in .debug_info section
<-1><426>: Abbrev Number: 0
readelf: Warning: Bogus end-of-siblings marker detected at offset 426 in .debug_info section
Compilation Unit @ offset 0x427:
Using latest SDCC 4.1.
sdcc --version
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/gbz80/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15 4.1.0 #12072 (MINGW64)
published under GNU General Public License (GPL)
Exact compiler invocations are listed per https://pastebin.com/5GBbzL89
Full readelf -wi output is listed per https://pastebin.com/tz2Sjver
Reproduction:
patch-1 branch build_type = debug to the end of the platformio.inipio run -e stm8sblue in the project folder to compile it. readelf -wi .pio/build/stm8sblue/firmware.elf Dwarf Error: Could not find abbrev number 117 in CU at offset 0x0
(no debugging symbols found)...done.
Any help is appreciated.
Woops, one misplaced formatting option makes the above text a bit hard to read, but I can't edit my tickets to fix it. Needs a moderator?
Diff:
The "Bogus end-of-siblings marker detected..." problems should be fixed in [r12536]
However, I haven't been able to reproduce the "Could not find abbrev number ..." problem. This may be because I could not find the patch-1 branch and used the develop branch instead, or this may be totally unrelated. The pastebin files seem to have evaporated by the time I had free time to look at this ticket, so there is nothing helpful there. If you still have it, please attach the firmware.elf file that you are trying to debug directly to this ticket.
Thanks, I'll have another shot at reproducing this with the latest released development version, and reupload the pastebin files if necessary / still occurring.
This is still not fixed. Getting the exact same error when using https://sourceforge.net/projects/sdcc/files/snapshot_builds/x86_64-w64-mingw32/sdcc-snapshot-x86_64-w64-mingw32-20211003-12697.zip/download as my toolchain.
Getting
in
stm8-gdbwhen using that toolchain in PlatformIO. (Which I do by addingin my
platformio.ini, the above folder (sourced from the referenced snapshot) needs to have apackage.jsonfile in it as attached.The build log and ELF file are attached.
Still struggling with the same problem :(.
reupload the pastebin files
Please do not use pastebin, github or any other upload website. Sourceforge can perfectly handle uploads right here.