A debug symbol is a special kind of
symbol
A symbol is a mark, Sign (semiotics), sign, or word that indicates, signifies, or is understood as representing an idea, physical object, object, or wikt:relationship, relationship. Symbols allow people to go beyond what is known or seen by cr ...
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, symbol, constant, procedure and function in a program's source code is associated with information ...
of an
object file
An object file is a file that contains machine code or bytecode, as well as other data and metadata, generated by a compiler or assembler from source code during the compilation or assembly process. The machine code that is generated is kno ...
, such as a
shared library
In computing, a library is a collection of System resource, resources that can be leveraged during software development to implement a computer program. Commonly, a library consists of executable code such as compiled function (computer scienc ...
or an
executable
In computer science, 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), in ...
. This information allows a
symbolic debugger to gain access to information from the
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
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 files ...
, 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.
[
]
Debugging information
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), the size, and, for classes, the name of the class, and the methods and members in it.
Part of the 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.
This information may be stored in the symbol table of an object file, executable file, or shared library, or may be in a separate file.
On some systems, e.g., z/OS
z/OS is a 64-bit operating system for IBM z/Architecture mainframes, introduced by IBM in October 2000. It derives from and is the successor to OS/390, which in turn was preceded by a string of MVS versions.Starting with the earliest:
...
, the debug information contains more than just the symbol tabled, e.g., the ADATA discussed in contains source code.
Debugging 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
Strip, Strips or Stripping may refer to:
Places
* Aouzou Strip, a strip of land following the northern border of Chad that had been claimed and occupied by Libya
* Caprivi Strip, narrow strip of land extending from the Okavango Region of Nami ...
command in Unix
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user 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 ...
. If the debugging information is in separate files, those files are usually not shipped with the distribution.
Embedded symbols
Unix-like systems
stabs was an early format for debugging symbols on Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
systems. The newer DWARF
Dwarf, dwarfs or dwarves may refer to:
Common uses
*Dwarf (folklore), a supernatural being from Germanic folklore
* Dwarf, a human or animal with dwarfism
Arts, entertainment, and media Fictional entities
* Dwarf (''Dungeons & Dragons''), a sh ...
format, for which formal specifications exist, has largely supplanted it. The specification allows any compatible compiler or assembler to create debug symbols in a standardized format, and for any debugger, such as the GNU Debugger
The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, Assembly, C, C++, D, Fortran, Haskell, Go, Objective-C, OpenCL C, Modula-2, Pascal, Rust, and par ...
(GDB), to gain access and display these symbols.
IBM
The compilers for the IBM mainframe line descended from the System/360
The IBM System/360 (S/360) is a family of mainframe computer systems announced by IBM on April 7, 1964, and delivered between 1965 and 1978. System/360 was the first family of computers designed to cover both commercial and scientific applicati ...
have a TEST option that causes the compiler to include debugging information in the object file. Similarly, the Binder and linkage editors have a TEST option that causes the debug information to be retained in the load module. Various debug tools, e.g., OS/360
OS/360, officially known as IBM System/360 Operating System, is a discontinued batch processing operating system developed by IBM for their then-new System/360 mainframe computer, announced in 1964; it was influenced by the earlier IBSYS/IBJOB a ...
TESTRAN, TSO TEST, have the ability to use the embedded symbol definitions.
External debug files
OS/390 et al
The IBM High Level Assembler (HLASM) and other compilers running on, e.g., z/OS
z/OS is a 64-bit operating system for IBM z/Architecture mainframes, introduced by IBM in October 2000. It derives from and is the successor to OS/390, which in turn was preceded by a string of MVS versions.Starting with the earliest:
...
, have an ADATA option that produces an ''Associated data'' (ADATA) file[
] containing more information than that produced by the old TEST option. In particular, the ADATA file includes lines of source code and their metadata.
Microsoft debug symbols
Microsoft
Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
compilers generate a program database
Program database (PDB) is a file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE). PDB files commonly have a .pdb extension. A PDB file is typically creat ...
(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
The Mozilla Corporation 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 open-source developers, s ...
) allow downloading debug symbols from the Internet. The WinDbg
WinDbg is a multipurpose debugger for the Microsoft Windows computer operating system, distributed by Microsoft. It can be used to debug user mode applications, device drivers, and the operating system itself in kernel mode.
Overview
Like the ...
debugger and the Visual Studio
Visual Studio is an integrated development environment (IDE) developed by Microsoft. It is used to develop computer programs including web site, websites, web apps, web services and mobile apps. Visual Studio uses Microsoft software development ...
IDE can be configured to automatically download debug symbols for Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
dynamic-link libraries (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 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 open-source developers, s ...
has similar infrastructure but distributes full debug information.
Apple
On Apple
An apple is a round, edible fruit produced by an apple tree (''Malus'' spp.). Fruit trees of the orchard or domestic apple (''Malus domestica''), the most widely grown in the genus, are agriculture, cultivated worldwide. The tree originated ...
platforms, debug symbols are optionally emitted during the build process as files. 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.
T ...
s on which to display the symbolic debugging information (and even earlier with symbolic dump
Deoxyuridine monophosphate (dUMP), also known as deoxyuridylic acid or deoxyuridylate in its conjugate acid and conjugate base forms, respectively, is a deoxynucleotide.
It is an intermediate in the metabolism of deoxyribonucleotides. Biosynthes ...
s on paper). They were not restricted to high level compiled languages and were available also for assembly language
In computing, assembly language (alternatively 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 bet ...
programs. For the IBM/360
The IBM System/360 (S/360) is a family of mainframe computer systems announced by IBM on April 7, 1964, and delivered between 1965 and 1978. System/360 was the first family of computers designed to cover both commercial and scientific applicati ...
, 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 informa ...
* Microsoft SYMDEB
References
External links
* http://referencesource.microsoft.com/ Microsoft Reference Source Server
* https://firefox-source-docs.mozilla.org/taskcluster/using-the-mozilla-source-server.html Mozilla Source Server
* http://www.symbolsource.org/ .NET libraries at SymbolSource
{{DEFAULTSORT:Debug Symbol
Debugging