I just have run across a problem: I received a project for the S08QE128, and when I started a debug session with MCU10.2, the debugger was showing “no source available”. Ahhrg. Something must be wrong…
Well, at least I can debug on assembly level. But this is not the point. I have the sources, but somehow the debugger does not find them?
I terminated the debug session. The problem let me think about an eclipse view which is not used very often, but can be extremely helpful: the Executable View in eclipse.
Looking at my LCD_QE.abs file, it did not show any source files, while the other executable do. Hmmm. Checked then the CodeWarrior Projects view. Here I see the ELF (Executable and Linkable) objects, but no sources.
So definitely the DWARF debugging information is missing. And this finally gave the hint about what could be wrong: I knew that most linkers allow to strip of the debugging information. And indeed: the -S linker option was set in that project:
Unchecked the -S option, rebuilding the project and the binary showed up as expected:
Notice the difference between and: this should have gave me the hint about the problem right away: the first one indicates something to debug, the second one something to execute only. Well, next time I will know right away.
One question remains: why would someone strip of the debugging information? I can think of following reasons:
- Reduce the disk file size of the executable: with the debug information removed from the binary the file size is much smaller. But do you care today with having terabytes available?
- If you have a system or boot loader which reads ELF files, then you might not need the DWARF information. Removing the DWARF again would save you bandwidth and improve performance.
- You intentionally do not want pass information about your source files. Maybe you have a secure project and you only want to give the minimal information. But then I suggest you should use a different format like S19.
If you have other reasons why you would strip off debug information, then comment and let me know.
Happy debugging 🙂