Scott Davies
Scott Davies

Reputation: 3755

When debugging or linking, what does the word "symbol" refer to?

I am doing some work with gdb and have found references in the documentation to "symbols". Is this another word for externally (exported) visible variables ?

Thanks,

Scott

Upvotes: 4

Views: 182

Answers (4)

SamB
SamB

Reputation: 9224

And debugging symbols (probably so named because of the way "STABS", for example, stored them in the symbol table) refers also to data above & beyond what the linker needs, such as line number/address mappings, type information, local variables, and lets not forget "static" symbols (which the linker clearly does not need, but which are obviously of great importance for debugging).

Of course, PE images don't need (or typically posses) "symbol tables" as such anyway -- just import/export tables. So, in the context of Windows, "symbols" and "debugging symbols" tend to be used interchangeably to refer to any symbols left over after linking; with MS's toolchain these (almost?) always go into "pdb" files. (See .)

Upvotes: 0

Clifford
Clifford

Reputation: 93446

A 'symbol' is a symbolic identifier including function and variable names.

The compiler/linker create a symbol table during the build and this is used by the debugger to provide source-level symbolic names to these entities, as opposed to plain addresses (hence the name "symbolic debugger" which you may come across).

Upvotes: 4

secmask
secmask

Reputation: 8107

Symbols are human names of variable, function, class... without symbols, you'll see everything just is data at address.
example:
with symbols:

call printf

without symbol

call dword ptr 0x804480 

Upvotes: 3

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798446

They're entries in the code's symbol table, generated when compiling it. Variables, functions, etc.

Upvotes: 3

Related Questions