方式一:類似下面的,遞歸式獲取某一目錄下所有文件的符號文件:(windbg的幫助文件及網絡上都能查到)
要使用 SymChk.exe 實用程序下載 Windows\System32 文件夾中所有組件的符號文件,請使用以下命令行命令:
- “/r c:\windows\system32”查找 System32 文件夾和所有子文件夾中的所有符號文件。
- “/s SRV*c:*http://msdl.microsoft.com/download/symbols”指定用於符號解析的符號路徑。在此例中,“c:\symbols”是將在其中從符號服務器複製符號的本地文件夾。
方式二:使用Manifest文件,這個少有人提及,References: http://msdn.microsoft.com/en-us/library/windows/hardware/ff560061(v=vs.85).aspx
Using a Manifest File with SymChk
n some cases, you might need to retrieve symbols for files that are on an isolated computer; that is, a computer that is either not on any network or is on a network that has no symbol store. In that situation, you can use the following procedure to retrieve symbols.
-
Run SymChk with the /om parameter to create a manifest file that describes the files for which you want to retrieve symbols.
-
Move the manifest file to a network that has a symbol store.
-
Run SymChk with /im parameter to retrieve symbols for the files described int the manifest file.
-
Move the symbol files back to the isolated computer.
Example
Suppose yourApp.exe is running on an isolated computer. The following command creates a manifest file that describes all the symbols needed to debug the yourApp.exe pocess.
C:\>SymChk /om c:\Manifest\man.txt /ie yourApp.exe SYMCHK: FAILED files = 0 SYMCHK: PASSED + IGNORED files = 28
Now assume you have moved the manifest file to a different computer that is on a network that has access to a symbol store. The following command retrieves the symbols described in the manifest file and places them in the mySymbols folder.
C:\>SymChk /im c:\FolderOnOtherComputer\man.txt /s srv*c:\mysymbols*\\aServer\symbols SYMCHK: myApp.exe ERROR - Unable to download file. Error reported was 2 . . . SYMCHK: FAILED files = 28 SYMCHK: PASSED + IGNORED files = 28
Now you can move the symbols to the isolated computer and use them for debugging.