# Debug symbol

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Debug_symbol
> Markdown URL: https://mediated.wiki/source/Debug_symbol.md
> Source: https://en.wikipedia.org/wiki/Debug_symbol
> Source revision: 1295258397
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

Type of identifier in computer science

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Debug symbol" – news · newspapers · books · scholar · JSTOR (December 2013) (Learn how and when to remove this message)

A **debug symbol** is a special kind of [symbol](/source/Symbol_(computing)) that attaches additional information to the [symbol table](/source/Symbol_table) of an [object file](/source/Object_file), such as a [shared library](/source/Shared_library) or an [executable](/source/Executable). This information allows a [symbolic debugger](/source/Symbolic_debugger) to gain access to information from the [source code](/source/Source_code) of the binary, such as the names of identifiers, including [variables](/source/Variable_(programming)) and routines.

The symbolic information may be compiled together with the module's [binary file](/source/Binary_file), or distributed in a separate file, or simply discarded during the [compilation](/source/Compiler) and/or [linking](/source/Linker_(computing)).

This information can be helpful while trying to investigate and fix a [crashing](/source/Crash_(computing)) application or any other fault.[1]

## 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](/source/Block_scope) or [global scope](/source/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](/source/Z%2FOS), the debug information contains more than just the symbol tabled, e.g., the ADATA discussed in [§ OS/390 et al](#OS/390_et_al) 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.[2] 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](/source/Strip_(Unix)) command in [Unix](/source/Unix). If the debugging information is in separate files, those files are usually not shipped with the distribution.

## Embedded symbols

### Unix-like systems

[stabs](/source/Stabs) was an early format for debugging symbols on [Unix-like](/source/Unix-like) systems. The newer [DWARF](/source/DWARF) 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](/source/GNU_Debugger) (GDB), to gain access and display these symbols.

### IBM

This section needs expansion. You can help by adding missing information. (July 2024)

The compilers for the IBM mainframe line descended from the [System/360](/source/System%2F360) have a TEST option that causes the compiler to include debugging information[3][4][5] in the object file. Similarly, the [Binder](/source/Support_programs_for_OS%2F360_and_successors#Binder) and [linkage editors](/source/Linkage_editor) have a TEST option that causes the debug information to be retained[6] in the load module. Various debug tools, e.g., [OS/360](/source/OS%2F360) TESTRAN, [TSO](/source/Time_sharing_option) TEST, have the ability to use the embedded symbol definitions.

## External debug files

This section needs expansion. You can help by adding missing information. (July 2024)

### [OS/390](/source/OS%2F390) et al

The [IBM High Level Assembler](/source/IBM_High_Level_Assembler) (HLASM) and other compilers running on, e.g., [z/OS](/source/Z%2FOS), have an ADATA option that produces an *Associated data* (ADATA) file[7] 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](/source/Microsoft) compilers generate a [program database](/source/Program_database) (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](/source/Mozilla_Corporation)) allow downloading debug symbols from the Internet. The [WinDbg](/source/WinDbg) debugger and the [Visual Studio](/source/Visual_Studio) IDE can be configured to automatically download debug symbols for [Windows](/source/Windows) [dynamic-link libraries](/source/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](/source/Mozilla_Corporation) has similar infrastructure but distributes full debug information.

### Apple

On [Apple](/source/Apple_Inc.) platforms, debug symbols are optionally emitted during the build process as dSYM files. Apple uses the term "symbolicate" to refer to the replacement of addresses in diagnostic files with human readable values.[8]

## History

Symbolic debuggers have existed since the [mainframe](/source/Mainframe_computer) era, almost since the first introduction of suitable [computer displays](/source/Computer_display) on which to display the symbolic debugging information (and even earlier with symbolic [dumps](/source/Core_dump) on paper). They were not restricted to high level [compiled](/source/Compiler) languages and were available also for [assembly language](/source/Assembly_language) programs. For the [IBM/360](/source/IBM%2F360), 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](/source/CA%2FEZTEST)

- [Debugging data format](/source/Debugging_data_format)

- [Microsoft SYMDEB](/source/Microsoft_SYMDEB)

## References

1. **[^](#cite_ref-Microsoft_WDC_1-0)** ["Debugging with Symbols"](https://msdn.microsoft.com/en-us/library/windows/desktop/ee416588%28v=vs.85%29.aspx). *Windows Dev Center*. [Microsoft](/source/Microsoft). [Archived](https://web.archive.org/web/20200111221925/https://docs.microsoft.com/de-de/windows/win32/dxtecharts/debugging-with-symbols?redirectedfrom=MSDN) from the original on 2020-01-11. Retrieved 2020-01-11.

1. **[^](#cite_ref-TechNet_Symbols_2-0)** ["What are Symbols For?"](https://web.archive.org/web/20141226213408/http://blogs.technet.com/b/askperf/archive/2008/07/15/what-are-symbols-for.aspx). *[TechNet](/source/Microsoft_TechNet)*. [Microsoft](/source/Microsoft). 2008-07-15. Archived from [the original](http://blogs.technet.com/b/askperf/archive/2008/07/15/what-are-symbols-for.aspx) on 2014-12-26. Retrieved 2015-01-04.

1. **[^](#cite_ref-3)** ["Appendix D: TESTRAN Editor Input Record Formats"](https://ia804503.us.archive.org/14/items/bitsavers_ibm360testProgramLogicManual197104_9236226/GY28-6611-0_TESTRAN_Program_Logic_Manual_197104.pdf#page=123) (PDF). [*IBM System/360 Operating System - TESTRAN - Program Logic Manual - Program Number 3605-PT-516*](https://ia804503.us.archive.org/14/items/bitsavers_ibm360testProgramLogicManual197104_9236226/GY28-6611-0_TESTRAN_Program_Logic_Manual_197104.pdf) (PDF). TNL GN26-8016. [IBM](/source/IBM). 1971-04-01. pp. 119–120. GY28-6611-0. Retrieved 2024-07-11.

1. **[^](#cite_ref-4)** ["Appendix. Input conventions and Record Formats"](http://bitsavers.org/pdf/ibm/370/MVS/LY26-3921-0_MVS-370_Linkage_Editor_and_Loader_Logic_1st_ed_198304.pdf#page=204) (PDF). [*MVS/370 - Linkage Editor Logic - Data Facility Product 5665-295 - Release 1.0*](http://bitsavers.org/pdf/ibm/370/MVS/LY26-3921-0_MVS-370_Linkage_Editor_and_Loader_Logic_1st_ed_198304.pdf) (PDF) (First ed.). [IBM](/source/IBM). April 1983. pp. 195–206. LY26-3921-0. Retrieved 2024-07-11.

1. **[^](#cite_ref-FOOTNOTELY26-3921-0195[httpbitsaversorgpdfibm370MVSLY26-3921-0_MVS-370_Linkage_Editor_and_Loader_Logic_1st_ed_198304pdfpage205_Figure_69._SYM_Input_Record_(Card_Image)]_5-0)** [LY26-3921-0](#CITEREFLY26-3921-0), p. 195, [Figure 69. SYM Input Record (Card Image)](http://bitsavers.org/pdf/ibm/370/MVS/LY26-3921-0_MVS-370_Linkage_Editor_and_Loader_Logic_1st_ed_198304.pdf#page=205).

1. **[^](#cite_ref-FOOTNOTELY26-3921-0199[httpbitsaversorgpdfibm370MVSLY26-3921-0_MVS-370_Linkage_Editor_and_Loader_Logic_1st_ed_198304pdfpage209_Figure_76._SYM_Record_(Load_Module)]_6-0)** [LY26-3921-0](#CITEREFLY26-3921-0), p. 199, [Figure 76. SYM Record (Load Module)](http://bitsavers.org/pdf/ibm/370/MVS/LY26-3921-0_MVS-370_Linkage_Editor_and_Loader_Logic_1st_ed_198304.pdf#page=209).

1. **[^](#cite_ref-7)** ["Appendix C. Associated data file output"](https://publibz.boulder.ibm.com/epubs/pdf/asmp1022.pdf#page=251) (PDF). [*High Level Assembler for z/OS & z/VM & z/VSE - Programmer's Guide - Version 1 Release 6*](https://publibz.boulder.ibm.com/epubs/pdf/asmp1022.pdf) (PDF). [IBM](/source/IBM). 2015. pp. 227–275. SC26-4941-07. Retrieved 2024-07-11.

1. **[^](#cite_ref-Apple_DL_8-0)** ["Understanding and Analyzing iOS Application Crash Reports"](https://developer.apple.com/library/ios/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-INTRODUCTION). *iOS Developer Library*. [Apple, Inc.](/source/Apple%2C_Inc.) 2018-01-08 [2009-01-29]. Technical Note TN2151. [Archived](https://web.archive.org/web/20191219103522/https://developer.apple.com/library/archive/technotes/tn2151/_index.html) from the original on 2019-12-19. Retrieved 2020-01-11.

## External links

- [http://referencesource.microsoft.com/](http://referencesource.microsoft.com/) Microsoft Reference Source Server

- [https://firefox-source-docs.mozilla.org/taskcluster/using-the-mozilla-source-server.html](https://firefox-source-docs.mozilla.org/taskcluster/using-the-mozilla-source-server.html) Mozilla Source Server

- [http://www.symbolsource.org/](http://www.symbolsource.org/) .NET libraries at SymbolSource

---
Adapted from the Wikipedia article [Debug symbol](https://en.wikipedia.org/wiki/Debug_symbol) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Debug_symbol?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
