开发者

WinDbg !heap command not working due to missing symbols

开发者 https://www.devze.com 2023-03-25 01:28 出处:网络
I am trying to use WinDbg debug my .NET application with C++ unmanaged memory allocations. When I try to run the !heap command, I get the following error message:

I am trying to use WinDbg debug my .NET application with C++ unmanaged memory allocations.

When I try to run the !heap command, I get the following error message:

0:022> !heap
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for C:\Windows\system32\KERNEL32.dll - 
*************************************************************************
***                                                                   ***
***                                                                   ***
***    Your debugger is not using the correct symbols                 ***
***                                                                   ***
***    In order for this command to work properly, your symbol path   ***
***    must point to .pdb files that have full type information.      开发者_JAVA百科***
***                                                                   ***
***    Certain .pdb files (such as the public OS symbols) do not      ***
***    contain the required information.  Contact the group that      ***
***    provided you with these symbols if you need this command to    ***
***    work.                                                          ***
***                                                                   ***
***    Type referenced: ntdll!_HEAP_ENTRY                             ***
***                                                                   ***
*************************************************************************
Invalid type information

How can I fix this error?


Use the following commands to fix your symbol path:

.symfix
.reload


Configure a symbol server. Follow there steps:

  1. Create a local directory for downloaded symbols. I'll use "C:\Symbols".
  2. Select "Symbol File Path..." from the "File" menu.
  3. Enter "SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols" and press "OK".
  4. Try again. Initially there'll be a delay while the symbols are download. In future the local copies (step 1) will be used.

See here for more details.


You need to set the symbols for your application and also have it point to windows symbol server. For windows symbol server you can do what Steve says.

"SRV*C:\Symbols*http://msdl.microsoft.com/download/symbols"

After that, set !sym noisy which will do symbol loading in verbose mode.

Do .reload and this lets you know which symbols are needed but not found.

If you already know the location of pdbs for your application make the symbol path point to that and repeat the steps above to make sure all required symbols are loaaded.

0

精彩评论

暂无评论...
验证码 换一张
取 消