[zz]Creating Your Very Own Symbol Server
2012-08-13 19:05
791 查看
http://chadaustin.me/2009/03/reporting-crashes-in-imvu-creating-your-very-own-symbol-server/
Existing tools such as WinDbg and Visual Studio play nicely with symbol servers.
Creating a symbol server is easy: it requires a single download and a directory on a network share.
Symbol servers can be cascaded. Microsoft runs a symbol server for their operating system DLLs, so entries from both your code and system DLLs will be displayed in a single call stack.
Create a directory on an accessible network share. Note the full path; you’ll need it later. Ours is
Every time you release your software, add the generated PDBs to the symbol server. Our release script runs this command:
This command takes a while to run, but it simply searches for PDBs and indexes them in the
The syntax for
The last entry in the list is Microsoft’s public symbol server. This allows the debugger to find function names for Microsoft operating system DLLs.
Each debugger generally has its own mechanism for configuring symbol servers. Here’s Visual Studio 2005’s symbol path editor:
To save time, you may prefer using
I hope this information was useful. I certainly wish we’d discovered it years ago. Happy debugging!
Why should I run my own symbol server?
Once you create a symbol server, you can easily debug a release build of your program from any computer with network access to the symbol server.Existing tools such as WinDbg and Visual Studio play nicely with symbol servers.
Creating a symbol server is easy: it requires a single download and a directory on a network share.
Symbol servers can be cascaded. Microsoft runs a symbol server for their operating system DLLs, so entries from both your code and system DLLs will be displayed in a single call stack.
What is a symbol server?
If you compile your program with the correct options, the compiler and linker will generate symbol files (PDBs). PDBs contain information required to parse stack traces and locate identifiers in your program. A PDB also contains the signature of the DLL or EXE associated with it. A symbol server is a directory of PDBs, organized by signature. Thus, given a DLL or EXE, you can find its PDB signature (the PdbSig70 and PdbAge fields in the corresponding debug PE header) and look up the PDB in the symbol server directory.Creating the symbol server
Download and install the Debugging Tools for Windows. Make suresymstore.exeis in your path.
Create a directory on an accessible network share. Note the full path; you’ll need it later. Ours is
\\hydra\devel\SymbolServer.
Every time you release your software, add the generated PDBs to the symbol server. Our release script runs this command:
symstore.exe add /s \\hydra\devel\SymbolServer /compress /r /f *.pdb /t IMVUClient
This command takes a while to run, but it simply searches for PDBs and indexes them in the
SymbolServerdirectory by their signature so Visual Studio and WinDbg can find them later.
Using the symbol server
There are generally two ways to coerce your debugger to resolve call stacks with your symbol server. You can either set the_NT_SYMBOL_PATHenvironment variable or configure the debugger with the paths directly.
The syntax for
_NT_SYMBOL_PATHis a bit wonky, but it should look something like this:
srv*c:\localsymbols*\\hydra\devel\SymbolServer*http://msdl.microsoft.com/download/symbols
_NT_SYMBOL_PATHbehaves just like any other
PATH: paths are searched in order until the appropriate PDB is found. To make future lookups faster, if a PDB is found on the network, it will be copied to the local path.
The last entry in the list is Microsoft’s public symbol server. This allows the debugger to find function names for Microsoft operating system DLLs.
Each debugger generally has its own mechanism for configuring symbol servers. Here’s Visual Studio 2005’s symbol path editor:
To save time, you may prefer using
_NT_SYMBOL_PATHover per-debugger configuration, since it will work with all debuggers.
I hope this information was useful. I certainly wish we’d discovered it years ago. Happy debugging!
相关文章推荐
- Reporting Crashes in IMVU: Creating Your Very Own Symbol Server
- Creating Your Own Server: The Socket API, Part 1
- How to get your very own RStudio Server and Shiny Server with DigitalOcean
- Creating Your Own Server: The Socket API, Part 2
- Creating Your Own Widgets using SWT
- Build your own cryptographically safe server/client protocol
- Creating your own ODS Style Template for PDF Output
- Creating Your Own Validation
- Creating Your Own Rails API Documentation
- Android:Creating Your Own Spelling Checker Service(创建拼写检查服务)
- How to set up your own private RTMP server using nginx
- Run Your Own Web Server Using Linux & Apache
- 创建你自己的PDB符号服务器create your pdb symbol server
- PowerTip of the Day-Creating Your Own Types
- Add your own symbols to symbol store
- Write your own http server
- 用你自己的插件扩展jQuery(Extend jQuery with Your Very Own Plugin)
- How to Build Your Own Blockchain 1 Creating, Storing, Syncing, Displaying, Mining, and Proving Work
- Creating your own SAP Customized Main Menu