how can i set windbg to automatically download all the symbols?
Asked Answered
C

2

5

am new to programming and debugging in general.

i spent a lot of time offline (without internet), and am reading Inside Windows Debugging book, but from time to time, i found myself in need to a pdb file.

i did some digging and i found this URL: http://msdn.microsoft.com/en-us/windows/hardware/gg463028.aspx, but too many versions, i spend some time trying to figure out how to find the right version.

i did find the right build, and i did downloaded it, but no luck (took me more than 6 hour to download 200 Mb), but i found myself on the beginning of the circle (pdb are not the right one, even if the build is a match), and i need active internet to continue reading my book, which i can not get during to the country policies.

my question is simple, how can i make windbg download all the symbols for all the binaries all at once.

os info: Version: windows 7 ultimate (x86) Build: 7601.win7sp1_gdr.130104-1431

thank, for being patient and read my bad English :)

Corner answered 6/5, 2014 at 18:25 Comment(0)
D
6

I think you're looking for the article Building a Debugging Environment

Basically it downloads symbols for all files you have currently installed. I did that two months ago for a Windows 7 installation and it worked fine - but it took 8.3 GB of disk space and of course a long time to download.

The concept is to go through all DLLs and EXEs in the Windows directory, add the file to a local symbol store and then check for symbols online.

SET PATH=%PATH%;"C:\Program Files\Debugging Tools for Windows"
REM Copy all .DLL files
SYMSTORE add /r /f C:\Windows\*.dll /s C:\SymbolStore\OSSymbols /t "Microsoft Windows" /v ""
REM Download symbols for .DLL files
SYMCHK /r C:\Windows\*.dll /s SRV*C:\SymbolStore\OSSymbols*http://msdl.microsoft.com/download/symbols
REM Copy all .EXE files
SYMSTORE add /r /f C:\Windows\*.exe /s C:\SymbolStore\OSSymbols /t "Microsoft Windows" /v ""
REM Download symbols for .EXE files
SYMCHK /r C:\Windows\*.exe /s SRV*C:\SymbolStore\OSSymbols*http://msdn.microsoft.com/download/symbols

When the script is interrupted, you can just run it again. The DLLs and EXEs are stored using a hash. The hash should not have changed if the file has not changed. Symstore is smart enough to pick up only the missing files according the documentation: "SymChk always searches the downstream store before querying the symbol server.

Dene answered 6/5, 2014 at 21:9 Comment(1)
yes exactly Thomas, that is what am after for. am gonna test your script and let you updated with the result, tnx :)Corner
C
5

When you are attached to the application you want to debug or have a .dmp-file open, type

.reload /f

That should force loading all symbols for the binaries.

Make sure you have configured your symbol servers properly before.

Coal answered 6/5, 2014 at 18:31 Comment(1)
thanx tehlexx for reply but that's not what i need .., what i need is to download all pdbs, for all the binaries of the windows system, not for the application am currently debugging, theoretically i could write an app that load all dll within system32, then debug it, that should trick windbg to download symbols, but seriously, do i have to go that way?Corner

© 2022 - 2024 — McMap. All rights reserved.