No Source Available…

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…

No Source Available

No Source Available?

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.

Executable View in eclipse and MCU10

Executable View in eclipse and MCU10

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.

QE project in CodeWarrior Projects View

QE project in CodeWarrior Projects View

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:

Linker strips symbolic information

Linker strips symbolic information

Unchecked the -S option, rebuilding the project and the binary showed up as expected:

QE project with debug information and source files

QE project with debug information and source files

Notice the difference between QE binary with debug information andQE without debug information: 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:

  1. 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?
  2. 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.
  3. 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 🙂

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.