*** Welcome to piglix ***

Symbolic debugging


A debug symbol is a special kind of symbol that attaches additional information to the symbol table of an object file, such as a shared library or an executable. This information allows a symbolic debugger to gain access to information from the source code of the binary, such as the names of identifiers, including variables and routines.

The symbolic information may be compiled together with the module's binary file, or distributed in a separate file, or simply discarded during the compilation and/or linking.

This information can be helpful while trying to investigate and fix a crashing application or any other fault.

Debug symbols typically include not only the name of a function or global variable, but also the name of the source code file in which the symbol occurs, as well as the line number at which it is defined. Other information includes the type of the symbol (integer, float, function, exception, etc.), the scope (block scope or global scope), the size, and, for classes, the name of the class, and the methods and members in it. All of this additional information can take up quite a bit of space, especially the filenames and line numbers. Thus, binaries with debug symbols can become quite large, often several times the stripped file size. To avoid this extra size, most operating system distributions ship binaries that are stripped, i.e. from which all of the debugging symbols have been removed. This is accomplished, for example, with the strip command in unix.

Some compilers will output the symbolic debugging information into a separate file, rather than placing it together with the binary.

The SysV Application Binary Interface includes a specification for the format of debug symbols. This allows any compatible compiler or assembler to create debug symbols in a standardized format, and for any debugger, such as GDB, to gain access and display these symbols. For example, part of the important debug information includes the line of code in the source file which defines that symbol (a function or global variable), as well as symbols associated with exception frames.


...
Wikipedia

...