What are symbols in the .NET Framework?

5

How do symbols work in the .NET Framework (and on other platforms)? How do they make it possible to remotely debug an application even without having the source code on the machine? What is its relation to .pdb ?

    
asked by anonymous 15.05.2017 / 15:14

1 answer

2

Symbols

Symbols are names. In fact this is suitable for any application. They are bound to some address, but not necessarily a physical or fixed address, it can be a relative indicator of a relative position in the stack that will be absolute only at the time of execution. Symbols are code identifiers, but we call it that when we treat a slightly lower level. Although there is a 1: 1 relationship between the identifiers and the symbols, we only consider the symbols that survive the compilation.

Normally everything that is public needs a symbol to map the object (in a broad sense of the word). So functions, types, global variables need to have their symbols always available so that other components refer to them without knowing their address. This is especially necessary in dynamic linking . In theory a static linking could eliminate all symbols, at least in most situations.

What is private or local does not need to provide these symbols because the code can solve everything right there. But to debug you need a mapping of the binary code to the source. This is where you enter the additional information entered in the executable or in a separate file.

Symbol file

A symbol file usually has much more information than symbols. Only the pure mapping would be more easily placed inside the executable, that is, it would suffice to keep all symbols in a table, not just those needed for normal use. It has data from public members in addition to its name that facilitates debugging.

You can even have the source code in this file. If not, at least you can map the binaries to the font that is available on the machine. This way it is known which part of the source code generated a certain instruction of the machine and thus allows to control the execution of simple form.

Obviously, if you want to debug directly in target code you do not need symbols. Only it gets very difficult. Hacker really does it a lot.

The file may contain information on how to display data of certain types to be better viewed.

In general you can set the level of detail information that will be available.

PDB file

Microsoft uses the .pdb format to save this information.

The term is used in some code contexts:

More details can be obtained on MSDN .

About PDB:

See Arthur's comment on the question.

    
15.05.2017 / 15:46