A debug symbol is a special kind of
symbol
A symbol is a mark, sign, or word that indicates, signifies, or is understood as representing an idea, object, or relationship. Symbols allow people to go beyond what is known or seen by creating linkages between otherwise very different conc ...
that attaches additional information to the
symbol table of an
object file, such as a
shared library or an
executable
In computing, executable code, an executable file, or an executable program, sometimes simply referred to as an executable or binary, causes a computer "to perform indicated tasks according to encoded instruction (computer science), instructi ...
. 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.
[
]
Embedded symbols
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.
]
SysV ABI
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.
Microsoft debug symbols
Microsoft compilers generate a file called a PDB file containing debug symbols. Some companies ship the PDB on their CD/DVD to enable troubleshooting and other companies (like Microsoft, and the Mozilla Corporation) allow downloading debug symbols from the Internet. The WinDBG debugger and the Visual Studio IDE can be configured to automatically download debug symbols for Windows DLLs on demand. The PDB debug symbols that Microsoft distributes include only public functions, global variables and their data types. The Mozilla Corporation has similar infrastructure but distributes full debug information.
Both Microsoft and Mozilla also offer the source code (Microsoft provides certain components, such as most of the .NET Framework
The .NET Framework (pronounced as "''dot net"'') is a proprietary software framework developed by Microsoft that runs primarily on Microsoft Windows. It was the predominant implementation of the Common Language Infrastructure (CLI) until bein ...
, whereas Mozilla offers full source) to make debugging easier.
Apple
On Apple platforms, debug symbols are optionally emitted during the build process as dSYM file(s). Apple uses the term "symbolicate" to refer to the replacement of addresses in diagnostic files with human readable values.[
]
History
Symbolic debuggers have existed since the mainframe
A mainframe computer, informally called a mainframe or big iron, is a computer used primarily by large organizations for critical applications like bulk data processing for tasks such as censuses, industry and consumer statistics, enterprise ...
era, almost since the first introduction of suitable computer displays on which to display the symbolic debugging information (and even earlier with symbolic dump
Dump generally refers to a place for disposal of solid waste, a rubbish dump, or landfill. The word has other uses alone or in combination, and may refer to:
* Midden, historically a dump for domestic waste
* Dump job, a term for criminal disposal ...
s on paper). They were not restricted to high level compiled languages and were available also for Assembly language
In computer programming, assembly language (or assembler language, or symbolic machine code), often referred to simply as Assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence be ...
programs. For the IBM/360, these produced object code (on request) that included "SYM cards". These were usually ignored by the program loader but were useful to a symbolic debugger as they were kept on the same program library as the executable logic code.
See also
* CA/EZTEST
* Debugging data format
* Microsoft SYMDEB
CodeView is a standalone debugger created by David Norris at Microsoft in 1985 as part of its development toolset. It originally shipped with Microsoft C 4.0 and later. It also shipped with Visual Basic for MS-DOS, Microsoft BASIC PDS, and a nu ...
References
Public symbol and source servers
* Microsoft Symbol Server
Microsoft Symbol Server is a Windows technology used to obtain symbol debugging information. It is built by using the SymSrv technology that is bundled with the Debugging Tools for Windows package. The SymChk.exe utility can be used to verify symbo ...
* Microsoft Reference Source Server: http://referencesource.microsoft.com/
* Mozilla Source Server: https://firefox-source-docs.mozilla.org/taskcluster/using-the-mozilla-source-server.html
* .NET libraries at SymbolSource: http://www.symbolsource.org/
{{DEFAULTSORT:Debug Symbol
Debugging