Symbol file--windows application debugging Prerequisites

Source: Internet
Author: User
Tags variables microsoft website

First, what is the symbol file?

Symbol files is a data information file that contains debugging information for application binaries (such as: EXE, DLL, etc.) and is designed for debugging purposes, and the resulting executable file does not need this symbol file at run time. But all of the variable information in your program is recorded in this file. So when debugging an application, this file is very important. This file is used when debugging programs with Visual C + + and WINDBG.

In Windows systems, symbol files are extended with. PDB, for example: There is a GDI32.dll file under each Windows operating system, and the compiler produces a gdi32.pdb file when compiling the DLL, and once you have the PDB file, you can To use it to debug and trace into the GDI32.dll. This file is closely related to the compiled version of the binaries, such as modifying the output function of the DLL, and then compiling the DLL, the original PDB file is obsolete and the old PDB file cannot be used for debugging, and the latest PDB file version must be used.

Visual C + + compiles the code and generates a PDB file in the Debug or release directory. In general, the symbol file includes the following data information:

global variable (variables);

Local variables (locally variables);

function names and their entry addresses (function names and the addresses of their entry points);

FPO data (frame pointer omission): Frame pointer is a sequence number (Source-line numbers) that is used to locate the next function in the call stack that will be called, the source code of the data structure;

How to get and install symbol files?

First determine your operating system (OS) version;

Download the corresponding symbol file to the Microsoft website;

Install symbol files, no special requirements for the installation location of symbol files, can be installed in any directory;

Set environment variables so that debugging tools (such as Visual C + +, WINDBG, NTSD, DrWatson, etc.) can find symbol files;

Considerations for installing Symbol files:

If you are installing a symbol file manually, it is important to note that the symbol file on the host (Hostt Computer) must match the version of Windows on the destination machine (target Computer).

Here the so-called host refers to the machine running the debugging session, in the typical dual-system debugging session environment, the host can be connected to the target machine any machine. The target machine refers to a machine that has failed to run software components, system services, applications, or operating systems. It is also the machine that needs to be debugged, which is the focus of the debugging session. The target machine can be near or in a completely different place. Sometimes we also call the target machine-the debugger (debuggee), and the host can be called the Debugger (debugger).

Iii. ways to use symbolic files in Visual C + +

How to use in Visual C + + 6.0:

Open the Workspace file (*.dsw) for Visual C + + 6.0;

Enter the Tools menu, select Options menu item (tools->options);

Click the Directoties tab;

In the show directories for Drop-down list, select executable files;

Adds the path of the symbol file to the list of "directories" paths;

Click OK to complete;

How to use in Visual C + +. NET 2003:

Open the Visual C + +. NET project file (*.vcproj);

In Solution Manager, select the project for which you want to use symbol files;

Right-click to enter the Project Properties dialog box;

Select Debug in Configuration properties;

There is a "symbol path" in the action option corresponding to debug, where you can add a path to the symbol file;

Click "OK" to complete;

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.