Electronics > Microcontrollers
RISC-V Compiling and Debugging
GromBeestje:
Some more testing... now, I can remove all my startup code again and revert to the minimal startup to reduce the complexity of the output.
The conclusion is, the produced binary contains the same code. That is
--- Code: ---riscv-none-elf-objdump -d
--- End code ---
produces the same output (except the filename of course)
This means, the problem is not in the code produces. As the problem occurs while debugging, my suspect is the produced DWARF.
Looking into the DWARF, I've used dwarfdump on the elf files,
The bad elf file gives me some errors in the output, while the good elf file doesn't
--- Code: ---ERROR: on getting fde details for fde row for address 0x0000006a
ERROR: Printing fde 0 fails. Error DW_DLE_DF_FRAME_DECODING_ERROR: instr opcode 0x18 unknown
ERROR: printing fdes fails. DW_DLE_DF_FRAME_DECODING_ERROR: instr opcode 0x18 unknown Attempting to continue.
There were 3 DWARF errors reported: see ERROR above.
--- End code ---
This looks to me like I've hit a bug in gcc binutils.
Edit 1: test case on github: https://github.com/a-v-s/riscv_gcc_debug_issue
Edit 2: I think I have found the trigger. Generating the assembly listing when compiling the C file seems to result in the DWARF error.
Edit 3: As the request to generate assembly listing is passed to the assembler, I'd say the problem is located in binutils
Navigation
[0] Message Index
[*] Previous page
Go to full version