Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 :)

like image 847
ziquvaxi Avatar asked May 06 '14 18:05

ziquvaxi


People also ask

How do I download WinDbg symbols?

The easiest way to get Windows symbols is to use the Microsoft public symbol server. The symbol server makes symbols available to your debugging tools as needed. After a symbol file is downloaded from the symbol server it is cached on the local computer for quick access.

How do I load a symbol path in WinDbg?

To control the symbol path in WinDbg, do one of the following: Choose Symbol File Path from the File menu or press CTRL+S. Use the . sympath (Set Symbol Path) command.

What are symbol files in WinDbg?

Symbol files are created when images are compiled and are used for debugging an image. They allow someone with the correct tools to view code as the software is running.

How do I set up WinDbg?

Launch Notepad and attach WinDbg Navigate to your installation directory, and open WinDbg.exe. On the File menu, choose Open Executable. In the Open Executable dialog box, navigate to the folder that contains notepad.exe (typically, C:\Windows\System32). For File name, enter notepad.exe.


2 Answers

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.

like image 81
Thomas Weller Avatar answered Nov 15 '22 08:11

Thomas Weller


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.

like image 22
tehlexx Avatar answered Nov 15 '22 08:11

tehlexx