Question

I am debugging a embedded system in my company using Lauterbauch.

I was told by my collegue that we require binary to be running in target and we required same source code of which binary (src) is running and symbol table file (.elf)

My question is

  1. Why does we require symbol table for debugging purpose?

  2. In windows we debug binary where as here we are using bin+elf file for debugging? Why there is seperate elf file.

Above application is written in C++, compiled with gcc and OS is vxworks.

I am trying to understand the concepts and begineer. Request to explain in lay man terms for beginner with simple examples.

Thanks

Était-ce utile?

La solution

To debug in terms of source code, one needs to know which address corresponds to which source line or variable name. This information is stored in a symbol table which is normally a part of the executable file. The table is not loaded to RAM for execution, but is used by various tools that read executable files, like debuggers and linkers.

When debugging a program on the same machine, the debugger can look up symbols directly within the binary file being debugged.

When debugging a remote program, there's no binary file available, just a little tiny server that can do simple commands like stop, start, show memory etc. Even if the remote binary contains symbols, the little server lacks intelligence to look them up and pass to the remote debugger. So the debugger must use symbols ftom a separate local binary file that corresponds exactly to the one being debugged.

Autres conseils

You need the symbol table in the binary so you get symbols in the debugger instead of just addresses.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top