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
In computer science, a symbol table is a data structure used by a language translator such as a compiler or interpreter, where each identifier (or symbols), constants, procedures and functions in a program's source code is associated with inf ...
of an
object file
An object file is a computer file containing object code, that is, machine code output of an assembler or compiler. The object code is usually relocatable, and not usually directly executable. There are various formats for object files, and the ...
, such as a
shared library
In computer science, a library is a collection of non-volatile memory, non-volatile resources used by computer programs, often for software development. These may include configuration data, documentation, help data, message templates, Code r ...
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 instructions", as opposed to a data fil ...
. This information allows a
symbolic debugger
A debugger or debugging tool is a computer program used to test and debug other programs (the "target" program). The main use of a debugger is to run the target program under controlled conditions that permit the programmer to track its execu ...
to gain access to information from the
source code
In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
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
A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document fi ...
, or distributed in a separate file, or simply discarded during the
compilation
Compilation may refer to:
*In computer programming, the translation of source code into object code by a compiler
**Compilation error
**Compilation unit
*Product bundling, a marketing strategy used to sell multiple products
*Compilation thesis
M ...
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
In computer programming, the scope of a name binding (an association of a name to an entity, such as a variable) is the part of a program where the name binding is valid; that is, where the name can be used to refer to the entity. In other parts ...
or
global scope
In computer programming, the scope of a name binding (an association of a name to an entity, such as a variable) is the part of a program where the name binding is valid; that is, where the name can be used to refer to the entity. In other parts ...
), 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
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
.
Some compilers will output the symbolic debugging information into a separate file, rather than placing it together with the binary.
SysV ABI
The
SysV
Unix System V (pronounced: "System Five") is one of the first commercial versions of the Unix operating system. It was originally developed by AT&T and first released in 1983. Four major versions of System V were released, numbered 1, 2, 3, an ...
Application Binary Interface
In computer software, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user.
An ...
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
The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C, C++, Objective-C, Free Pascal, Fortran, Go, and partially others.
History
GDB was first written by ...
, 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
Microsoft Corporation is an American multinational corporation, multinational technology company, technology corporation producing Software, computer software, consumer electronics, personal computers, and related services headquartered at th ...
compilers generate a file called a
PDB PDB may refer to:
* Chess Problem Database Server (PDB Server)
* 1,4-Dichlorobenzene (paradichlorobenzene)
* Party of German-speaking Belgians, (German: '), a political party and predecessor of the ProDG
* PDB (Palm OS), a container format for reco ...
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
The Mozilla Corporation (stylized as moz://a) is a wholly owned subsidiary of the Mozilla Foundation that coordinates and integrates the development of Internet-related applications such as the Firefox web browser, by a global community of op ...
) allow downloading debug symbols from the Internet. The
WinDBG
WinDbg is a multipurpose debugger for the Microsoft Windows computer operating system, distributed by Microsoft. Debugging is the process of finding and resolving errors in a system; in computing it also includes exploring the internal operatio ...
debugger and the
Visual Studio
Visual Studio is an integrated development environment (IDE) from Microsoft. It is used to develop computer programs including websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development platforms such ...
IDE can be configured to automatically download debug symbols for
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
DLLs on demand. The PDB debug symbols that Microsoft distributes include only public functions, global variables and their data types. The
Mozilla Corporation
The Mozilla Corporation (stylized as moz://a) is a wholly owned subsidiary of the Mozilla Foundation that coordinates and integrates the development of Internet-related applications such as the Firefox web browser, by a global community of op ...
has similar infrastructure but distributes full debug information.
Both Microsoft and Mozilla also offer the
source code
In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
(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
An apple is an edible fruit produced by an apple tree (''Malus domestica''). Apple trees are cultivated worldwide and are the most widely grown species in the genus '' Malus''. The tree originated in Central Asia, where its wild ances ...
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, enterpris ...
era, almost since the first introduction of suitable
computer display
A computer monitor is an output device that displays information in pictorial or textual form. A discrete monitor comprises a visual display, support electronics, power supply, housing, electrical connectors, and external user controls.
The ...
s 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 dispos ...
s on paper). They were not restricted to high level
compile
In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily ...
d languages and were available also for
Assembly language programs. For the
IBM/360
The IBM System/360 (S/360) is a family of mainframe computer systems that was announced by IBM on April 7, 1964, and delivered between 1965 and 1978. It was the first family of computers designed to cover both commercial and scientific applica ...
, 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
A debugging data format is a means of storing information about a compiled computer program for use by high-level debuggers. Modern debugging data formats store enough information to allow source-level debugging.
High-level debuggers need informat ...
*
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