Windows symbol files

Source: Internet
Author: User

Windows symbol files

1. What is symbol file?

Symbol files hold a variety of data which are not actually needed when running the binaries (DLL, exe...), but which cocould be very useful in the debugging process(It's a good partner for vc6 ++ and windbg ).

In general, symbol file is a file that contains the debugging information of related binary files (exe, DLL. PDB is the extension. For example, if there is a gdi32.dll in WINXP, Microsoft will generate a gdi32.pdb file when compiling the DLL. programmers can use it for debugging if they have the PDB file, tracking the gdi32.dll!

This file is closely related to the compiled version of the binary file. For example, if you modify the DLL output function and then compile the DLL, the original PDB file will become obsolete, you cannot perform debugging any more. At this time, you need to compile the generated PDB file after modification.

When compiling with vc6, you will find that the PDB file exists in the debug/release directory (for details about how to generate the release version of PDB, see 4. how to compile the PDB file that generates the binary file of the release version in vc6 ++ ?).

Typically, symbol files might contain:

1. Global Variables)

2. Local Variables)

3. function names and their endpoints (function names and the addresses of their entry points)

4. FPO data (frame pointer omission), frame pointer is a method used to call a stack) find the row number (source-line numbers) of the source code of the data structure of the function to be called)

Symbol files

A symbol file contains the same debugging information that an executable file wowould contain. however, the information is stored in a debug (. DBG) file or a program database (. PDB), rather than the executable file. therefore, you can install only the symbol files you will need during debugging. this operation CES the file size of the executable, saving load time and disk storage.

The operating system dynamic-Link Libraries (DLL) have associated symbol files. these. PDB files are not installed during installation. to install the system symbol files, create a directory on your hard disk, and copy the files from your system installation compact disc (CD ). the symbol files are located in the support \ debug \ i386 \ symbols directory tree.

A debug symbol is information that tells you which programming-language constructs generated a specific piece of machine code in a given executable module. sometimes the symbolic information is compiled together with the module's binary file, or distributed in separate file, or simply discarded during the compilation and/or linking. this information enables a person using a symbolic debugger to gain additional information about the binary, such as the names of variables and routines from the original source code. this information is sometimes extremely helpful while trying to investigate and fix a crashing application or any other fault.

When the debug symbols are embedded in the binary itself, the file can then grow significantly larger (sometimes by several megabytes ). to avoid this extra size, modern compilers and early mainframe debugging systems output the symbolic information into a separate file (for Microsoft compilers, this file is called a PDB file ). some companies ship the PDB on their CD/DVD to enable troubleshooting and other companies (like Microsoft) have special online servers from which it's possible to download the debug symbols separately. when using Microsoft's windbg debugger it automatically downloads debug symbols for Windows DLLs on demand as they are needed. however, the PDB debug symbols that Microsoft distributes are only partial (they include only public functions, global variables and their data types ). other vendors, such as the Mozilla Corporation have similar infrastructure but their symbol server distributes full debug information, making it easier to find bugs because this data contains all functions, all variables and all data types.

In 2008, Microsoft also started to offer the source code for certain components (most of. net Framework for instance) to make debugging easier and some debuggers, like windbg and Microsoft Visual Studio, will actually download the code on demand in a fashion similar to how Debug symbols are retrieved (there is a special source server that serves the requested code ). mozilla operated such a source server several years before this.

From http://hi.baidu.com/donghaozheng/blog/item/af5f0d3b628eb7e214cecb6c.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.