开发者

Trouble debugging minidump in VS 2010

I'm calling MiniDumpWriteDump from .NET to generate a minidump, and that works fine. However, when I load the resulting dump into VS 2010, I don't see any useful info. In particular, the Call Stack window looks something like this:

Trouble debugging minidump in VS 2010

It doesn't contain any managed frames, although I'm writing the dump while in an开发者_如何学运维 exception handler in managed code. Also, it doesn't contain any frames located in my exe.

Any idea why this happens?

BTW when I create a dump manually from the VS debugger, the dump does contain managed frames as expected.

Edit:

I've found a Microsoft Connect issue about this. It says:

Currently the CLR does not support managed processes taking their own dumps.

Anyone know if that's still true?


I've found my mistake. I was looking at the call stack of the wrong thread (I didn't realize there was more than one thread running). Now I can see the managed call stack just fine.


I do something similar in my application (i.e. calling MiniDumpWriteDump and then investigate the dumps in the debugger).

Whenever I have this problem, there are two possible causes:

  • either the symbol information is missing
  • or the DLL or EXE that was used by the process at the time of the dump is missing

The first cause is easy to solve. In VS2010 you can simply right click the DLL in the call stack or in the Modules window and choose 'Load Symbols from Microsoft Servers'.

The second cause is more difficult to solve. If the DLL or EXE is missing, the debugger refuses to let you debug it, and even refuses to look at the symbols. The trick is to generate a dummy DLL/EXE from the DMP file. Look at http://www.debuginfo.com/tools/modulerescue.html for the utility MODULERESCUE. This utility can generate dummy DLL's and EXE's for a given DMP file, just enough to satisfy the debugger so that it wants to load the symbols again.


Keep in mind that you should call MiniDumpWriteDump from an exception filter which is supported by VB.NET but not by C#.

Have a look at these links:

Getting good dumps when an exception is thrown

Writing Minidumps from Exceptions in C#

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜