还在苦苦敲代码开发APP?你out啦! 试试积木搭建APP吧~

How To Capture A Minidump: Let Me Count The Ways

来源:个人博客     2016-04-14 12:01:40    人气:     我有话说( 0 人参与)

As I was waiting for a minidump I was grabbing on a very large and busy server application to finish writing,...

As I was waiting for a minidump I was grabbing on a very large and busy server application to finish writing, my mind wandered and I realized there were quite a few ways to grab a minidump today. Back in the old Windows days, when we had to program up hill in the snow both ways, there was only WinDBG. Now it seems like an application isn’t complete unless it produced a minidump. I thought I’d throw out all the ways I know off the top of my head. Of course, I’m sure there are other ways so please add them in the comments!

Note: I’m only using Windows 7 and Server 2008 R2 these days so some of these might not work on legacy Windows operating systems.

ADPlus/WinDBG’s .dump Command

The original heavy duty way to create a minidump. To create a full memory minidump, which you’ll need in order to work with .NET’s SOS/SOSEX/PSSCOR2 extensions or for native code to follow all memory like linked lists, use the /ma option.

Visual Studio

With Visual Studio 2010, the wonderful “Save Dump As…” menu option now appears on the Debug menu for both native and managed debugging. Any time you need a minidump while debugging, just grab one. Add in the fact that Visual Studio 2010 has the awesome minidump reading capabilities, especially for .NET code, we can now spend way less time in WinDBG.

TaskManager

Many people don’t realize that TaskManager knows all about minidumps. When you’re either in the Applications or the Processes tabs, right click on the process and select Create Dump File.

After the minidump is finished, you’ll see the dialog showing you where the dump was created. A nice hidden treat is that the path shown is a read only edit control you can select and copy so you don’t have to try to remember a long path.

You might be wondering what type of minidump TaskManager makes. How about I leave that as an exercise for the reader? OK, that’s cruel. All TaskManager created dumps are full memory minidumps.

Process Explorer

TaskManager is fine, but real developers use Process Explorer to fulfill our task management needs. Right clicking on a process lets you choose a minidump or a full memory minidump.

MiniDumpWriteDump

As I am trying to create a complete list I do need to include the Windows API that actually creates the minidumps themselves: MiniDumpWriteDump. There’s nothing stopping you from writing your own program that creates minidumps.

ProcDump

The sweet SysInternals ProcDump tool is designed to get you a minidump when specific nasty issues happen to your processes. It’s great for snagging dumps when you have intermittent CPU spikes or memory usage. I find that I’m using this tool constantly on production servers to get minidumps of those hard to reproduce problems. Everyone using computers needs to know about this tool, even your grandmother!

DebugDiag

Got IIS problems? DebugDiag is for you. The ability to script when the dump occurs is pretty interesting. The always brilliant Tess Ferrandez has a great blog post that helps you to decide when you should use ADPlus/WinDBG vs. DebugDiag that’s worth reading.

Windows Error Reporting (WER)

If your company signs up for Windows Error Reporting you’ll get the same minidumps Microsoft gets. For native developers, WER is a wonderful resource but for .NET developers you only get basic minidumps so it’s not as useful.

Do you know of any other ways to capture a minidump?

Related Posts:

No related posts.

Minidump dump

本文源自互联网,采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可,
版权归原作者,如有问题请联系service@tsingfun.com (编辑:admin)
分享到: