Use Microsoft symbol server to obtain the debugging symbol File

Source: Internet
Author: User
Tags server website microsoft website

You must have symbolic information when using Microsoft tools to debug applications. Symbolic files are included in executable files and dynamic link libraries (DLL)
The placeholder space of the function. In addition, the symbol file can also represent the function call roadmap that has reached the failure point. For example, you must have a symbol when dumping the call stack in the debugger. This article discusses how to specify
The following URLs of the debugging tool are used to use Microsoft symbol Server:

Http://msdl.microsoft.com/download/symbols

Note:
:Http://msdl.microsoft.com/download/symbols
Is not browsed and only applicable to access by the debugger.

More information using symbol server technology

Microsoft symbol server is built using the symsrv Technology (symsrv. dll) attached to the debugging tools for Windows software package. Symsrv generates a local symbol cache for fast and automatic symbol parsing.

It is as simple as using the corresponding syntax in the symbolic path. Generally, the syntax format is as follows:

SRV * Your local symbol folder
* Http://msdl.microsoft.com/download/symbols

WhereYour local symbol folder
Is any drive or share used as the symbol target location.

For example, to set the symbolic path in the windbg debugger, type the following command in the Command window of the debugger:

. Sympath SRV * F:/localsymbols * http://msdl.microsoft.com/download/symbols

To obtain the latest symsrv function, you must install the latest debugging software package. To obtain the latest version of debugging tools for Windows, visit the following Microsoft Website:

Microsoft debugging tool
Http://www.microsoft.com/whdc/devtools/ddk/default.mspx


Http://www.microsoft.com/whdc/devtools/ddk/default.mspx)

For more information about the symbol server technology, see the debuggers. chm help file provided with the debugging tools for Windows software package.

Back to Top

Set the _ nt_symbol_path environment variable

If you provide correctSymsrv
Syntax. Common Microsoft debugging tools use symsrv technology. These tools automatically include any content that you provide as the symbolic path in the variable.

You can set this variable to a system variable or a user environment variable. To perform this operation from the desktop, right-clickMy computer
And then clickAttribute
. InAdvanced
Tab, clickEnvironment Variable
.

You can also set this variable temporarily at the command prompt. If this method is used, all applications started from the command prompt will inherit this setting. For example:

Set _ nt_symbol_path = symsrv * symsrv. dll * F:/localsymbols * http://msdl.microsoft.com/download/symbols
Back to Top

Use Microsoft symbol server and windbg together

To use the symbol server website in windbg, follow these steps:

1. Start Windows debugger (windbg.exe ).
2. InFile
ClickSymbol file path
.
3. InSymbol path
In the dialog box, enter the following command:

SRV *Your local folder for symbols
* Http://msdl.microsoft.com/download/symbols

WhereYour local folder for symbols
Is the folder where the local symbol cache is copied. The debugging symbol is downloaded to this location.

Note:
: You can point to any local path or shared location that can be reached by the computer. This location does not have to be a location on the computer's hard disk.

You can also use. Sympath
Command to set the symbol path.

You canSymsrv
The syntax is combined with other symbolic paths. For example, use the following syntax to specify two or more symbol paths:

F:/busobjsymbols; SRV * F:/localsymbols * http://msdl.microsoft.com/download/symbols

This syntax uses semicolons to separate the number path.

When you start debugging A failover file or application, the Windows debugger checks whether the symbolic information of the module it loads is in a local folder. If the symbol information of the module is not in the local folder, windbg will try to download the corresponding symbol file or file from the symbol server.

For example
If you use the same local cache when debugging applications on computers with different file versions, the symbols of different versions will be downloaded and stored together with the first batch of symbols. Symstore
The format stores files according to the image Timestamp and size (or checksum. Therefore, symbols from different product versions can coexist in parallel. (Symstore.exe is
Debugging tools for a utility used to generate a symbolic server in the Windows software package. For more information, see the product documentation .)

Since it takes some time to download the symbolic file, remember that when you debug the application for the first time, the debugger may seem to have stopped the response (suspended ). This is because most symbolic files (such as NTDLL. dll, kernel32.dll, and other files) must be downloaded ).

Back to Top

Use the symchk.exe utility to download symbols.

You can use symchk.exe
A utility that verifies symbols and generates a local symbol cache in a convenient and non-intrusive manner. The symchk.exe utility is used with debugging tools
The Windows software package is provided. Symchk.exe is a command line tool. You may need
To access the tool from any command prompt.

To use the symchk.exe utility to download the symbolic files of all components in the Windows/system32 folder, run the following command:

Symchk/r c:/Windows/system32/s SRV * C:/symbols/* http://msdl.microsoft.com/download/symbols

In this example:

"/R c:/Windows/system32" searches for all the symbol files in the System32 folder and all subfolders.
"/S SRV * C: * http://msdl.microsoft.com/download/symbols#specifies the signature of the symbol used. In this example, "C:/Symbols" is the local folder where the symbol will be copied from the symbol server.

To obtain more information about the symchk.exe command line options, enter symchk /?
. Other options include specifying the name or PID of the running executable file.

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.