debugging - How to set up symbols in WinDbg? -


i using debugging tools windows , following error message when starting windbg / cdb or ntsd:

symbol search path is: *** invalid *** **************************************************************************** * symbol loading may unreliable without symbol search path.           * * use .symfix have debugger choose symbol path.                   * * after setting symbol path, use .reload refresh symbol locations. * **************************************************************************** 

when executing arbitrary commands, error message

*** error: module load completed symbols not loaded <module>.<ext> 

and following seems related:

********************************************************************* * symbols can not loaded because symbol path not initialized. * *                                                                   * * symbol path can set by:                                    * * using _nt_symbol_path environment variable.                   * * using -y <symbol_path> argument when starting debugger.   * * using .sympath , .sympath+                                      * ********************************************************************* 

in !analyze -v have seen

default_bucket_id:  wrong_symbols 

and

************************************************************************* ***                                                                   *** *** either specified unqualified symbol, or debugger      *** *** doesn't have full symbol information. unqualified symbol          *** *** resolution turned off default. please either specify      *** *** qualified symbol module!symbolname, or enable resolution    *** *** of unqualified symbols typing ".symopt- 100". note        *** *** enabling unqualified symbol resolution network symbol        *** *** server shares in symbol path may cause debugger        *** *** appear hang long periods of time when incorrect         *** *** symbol name typed or network symbol server down.        *** ***                                                                   *** *** commands work properly, symbol path              *** *** must point .pdb files have full type information.         *** ***                                                                   *** *** .pdb files (such public os symbols) not         *** *** contain required information. contact group          *** *** provided these symbols if need command       *** *** work.                                                             *** ***                                                                   *** ************************************************************************* 

how set windbg find symbols?

disclaimer: intended canonical question wrong symbols posts in .

symbols can set correctly in various different ways.

warning: examples here use \\server\symbols typically network storage not available. adapt local server or leave part out if don't have one. non-existent server may cause delays etc.

tldr version 80% of cases

create new folder c:\symbols symbols provided microsoft. type

.symfix+ c:\symbols .reload 

(or reload -f if necessary)

make sure have internet connection, since contact microsoft servers , download symbols there.

in 80+% of cases, might solve symbols problem. if not, read on.

fixing symbols commands

windbg symbols in order appear in symbol path. therefore it's idea put local symbols first, company local network share , download symbols internet , store copy locally.

.sympath c:\mysymbols ; *** symbols of application, locally, flat list of pdb files .sympath+ cache*c:\symbolcache ; *** (optional) create cache .sympath+ \\server\symbols ; *** symbols provided network share .symfix+ c:\symbols ; *** microsoft symbols 

fixing symbols menu

in windbg (but not command line equivalents) can set symbol path file/symbol file path... or pressing ctrl+s. enter in following format

c:\mysymbols;cache*c:\symbolcache;\\server\symbols;srv*c:\symbols*http://msdl.microsoft.com/download/symbols 

fixing symbols command line

windbg takes -y command line switch if prefer having different desktop links different symbol path setups.

windbg -y "<symbol path>" 

note need complete path here, in form like

c:\mysymbols;cache*c:\symbolcache;\\server\symbols;srv*c:\symbols*http://msdl.microsoft.com/download/symbols 

fixing symbols environment variable

there environment variable called _nt_symbol_path can set symbol path well. use following syntax:

c:\mysymbols;cache*c:\symbolcache;\\server\symbols;srv*c:\symbols*http://msdl.microsoft.com/download/symbols 

note not windbg evaluates variable, visual studio, process explorer, process monitor , potentially other software. may experience performance impact setting environment variable.

saving symbol path part of workspace

if have rather complex symbol setup includes several paths, become familiar concept of windbg workspaces.

workspaces allow save symbol path don't have re-type commands in every debugging session.

once you're satisfied workspace, create link windbg include -q means " suppress annoying "save workspace?" question".

so far i'm happy having save symbols part of base workspace.

deferred symbols

deferred symbols (indicated such during lm command) not problem. windbg load them whenever needed. force loading of them, type

ld* 

debugging symbol issues

if symbols (pdbs) not work expected, use the

!sym noisy 

to more information windbg doing when resolving symbols.

when found solution, turn off with

!sym quiet 

to check individual symbols correctness, can use symchk tool comes windbg.

symchk /if <exe> /s <symbol path> /av /od /pf /if = input file /s  = symbol file path /od = details /av = verify /pf = check if private symbols available 

or chkmatch bit easier use

chkmatch -c <exe file> <pdb file> 

if have trouble accessing symbols network share, make sure logged on network share before. afair, windbg not ask credentials.

official documentation

use microsoft symbol server obtain debug symbol files (should redirect here redirection broken)

symbol path windows debuggers


Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -