Hello
I'm working to debug embedded software for cortex M4, on a virtual platform including a fast model of Cortex M4, with the latest version of both ARM DS & ARM Fast Model (11.23)
ARM DS connects correctly to the VP, but unfortunately, I'm unable to put breakpoints into my embedded software.
I've imported my makefile c++ project into ARM DS without any problem, compiling for the M4 target and with -g -O0 options to be able to debug correctly.
I'm unable to put breakpoints into the C code, so I cannot debug my software.
I have added the debugger command add-symbol-file to allow the debugger to know where to load the debug symbols:
add-symbol-file "${workspace_loc:/demo/main.elf}"
I have the following errors displaying in the command view:
Breakpoint 2 unsilencedadd-symbol-file "${workspace_loc:/demo/main.elf}" ERROR(CMD685-COR11-IMG34): ! Failed to load symbols for "main.elf"! Failed to read the symbols from demo/main.elf! Section .debug_info offset 0x4: DWARF version 5 is not supported. To use the DWARF 5 format, enable the LLVM DWARF parser.See https://developer.arm.com/documentation/101470/2023-0/Reference/Standards-compliance-in-Arm-Debugger
It seems that the debug symbols cannot be loaded for my elf file. Could you please explain how to proceed here ? (I have no access to the URL provided by the error message)
Many thanks for your support
Best Regards
Frederic
Hello Stephen,
thanks for your answer, I can now put breakpoints in the assembly code executed before entering the main entry point of the C code.
It seems nevertheless than I cannot put breakpoints in the C code, after entering the main. The M4 code seems to be executed in privileged mode, is this the reason why i cannot put BP ?
Is there a setting to enable the ability to put breakpoints in Privileged mode ?
Many thanks
Best regards
Hi FredericCortex-M4 has a single address space, so breakpoints should work the same for both privileged and unprivileged modes.Which compiler are you using? GCC?Are you able to set a breakpoint on main() itself, or does the issue only affect C functions after main()? There should be no difference between main() or other functions, unless the compilation tools have inlined them or removed them as unused.If you are building with GCC, then use "objdump --debugging" or "readelf --debug-dump" to check that the executable contains debug information. If building with the Arm Compiler, use "fromelf -g". Do you see a DW_AT_name entry for "main" ?Do you see DW_AT_name entry for other functions of interest?In the Debugger's Commands view, enter "info functions".Are your functions of interest listed there?What errors, if any, are shown when you try to set a breakpoint?Does your C code get moved/relocated to a different address at run-time? If so, you might need to add an appropriate offset to the add-symbol-file command.Take a look at the ready-made "startup_Cortex-M4_AC6" example provided in the Arm DS Examples. Breakpoints on C code work OK there.Hope this helpsStephen