Replies: 6 comments 10 replies
-
I don't know, but I'm not surprised. Debuggers usually ask gdb to do the disassembly, at least this is how Eclipse does. I suggest you test directly with gdb in a terminal. If the disassembly is incorrect, then the issue is in gdb. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I tried -g and -g3 with no changes in results. I ran the cortex-debug with gdb showDevDebugOutput set to raw and logged for 11.2.1 and 10.3.1 I noticed in 11.2.1:
Note the i2c_master.cpp file has no functions called in this file, so it is stripped from binary. While in 10.3.1:
I will research some more and see what I find. |
Beta Was this translation helpful? Give feedback.
-
I first started with the latest release and had the issue, I started moving down major releases until issue went away. I have found that the 10.3.1
11.2.1
|
Beta Was this translation helpful? Give feedback.
-
Version 14.1 rel1 of the arm GNU toolchain has same issue. I found it appears to be a difference in the elf file generated, as if I do objdump with newer objdump and older elf it works correctly. |
Beta Was this translation helpful? Give feedback.
-
I think what is happening is that the unused functions still have their symbol in the elf file. As such the tools are placing these functions at address zero. I am not sure how the gdb/objdump picks which symbol (source file/function) to assign but it picks one, and often the wrong one. |
Beta Was this translation helpful? Give feedback.
-
I found that when using cortex-debug in vscode or using ozone (segger.com) when I single step through code or view the disassembly the source code reference is incorrect for any version of gcc after 10.3.1-2.2.1.
If I do an objdump -dlr of the elf file, then the disassembly and source code is shown correctly, but when accessing through the gdb interface on cortex-debug or ozone the source file is shown incorrect. The assembly (binary) code is correct but the link back to source code (symbol table?) appears to be wrong.
Does anyone know if there a change in gcc that created this issue?
Has anyone else seen this issue?
Beta Was this translation helpful? Give feedback.
All reactions