Your Search Results

    Debugging a minidump

    この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

    The minidump file format contains data about a crash on Windows.  It is used by Breakpad and also by various Windows debugging tools.

    Using the MS Visual Studio debugger

    1. set up the debugger to use the Mozilla symbol server
    2. install the relevant release of Firefox (for example from here), and add the directory it is in (e.g., "C:\Program Files\Mozilla Firefox 3.6 Beta 1\") to the same dialog in which you set up the symbol server (in case the binary location in the minidump is not the same as the one on your machine). Note that you can install the relevant release anywhere. Just make sure to configure the symbol server to the directory where you installed it.
    3. Get the source for that release of Firefox
    4. make sure the minidump has the .dmp file extension (that is, rename it from *.dump to *.dmp)
    5. double-click on the minidump file to open it in the debugger
    6. when it loads, click the green icon in the visual studio debugger toolbar that looks like a play button
    7. When the first source file is loaded, you will need to tell the debugger where your corresponding source tree is.

     Then you'll be able to examine:

    the stack trace
    The debugger shows the stack trace.  You can right-click on any frame in the stack, and then choose "go to disassembly" or "go to source".  (Choosing "go to dissassembly" from the source view might not get you to the right place due to optimizations.)  When looking at the source, beware that the debugging information will associate all inlined functions as part of the line into which they were inlined, and compiler (with PGO) inlines very aggressively (including inlining virtual functions).  You can often figure out where you really are by reading the disassembly.
    In the Registers tab (Debug -> Windows -> Registers if you don't have it open), you can look at the registers associated with each stack frame, but only at the current state (i.e., the time of the crash).  Registers that Visual Studio can't figure out will be grayed-out and 00000000.
    stack memory
    You open a window (Memory 1, etc.) that shows contiguous segments of memory using the Debug -> Windows -> Memory menu item.  You can then enter the address of the stack pointer (ESP register) in this window and look at the memory on the stack.  (The minidump doesn't have the memory on the heap.)  It's a good idea to change the "width" dropdown in the top right corner of the window from its default "Auto" to either "8" or "16" so that the memory display is word-aligned.  If you're interested in pointers, which is usually the case, you can right click in this window and change the display to show 4-byte words (so that you don't have to reverse the order due to little-endianness).  This view, combined with the disassembly, can often be used to reconstruct information beyond what in shown the function parameters.
    local variables
    In the Watch 1 (etc.) window (which, if you don't have open, you can get from Debug -> Windows -> Watch), you can type an expression (e.g., the name of a local variable) and the debugger will show you its value (although it sometimes gets confused).  If you're looking at a pointer to a variable that happens to be on the stack, you can even examine member variables by just typing expressions.  If Visual Studio can't figure something out from the minidump, it might show you 00000000 (is this true?).

    Manually unwinding the stack in a minidump

    Sometimes unwinding the stack doesn't work very well. In those case you can resort to doing it by hand. Here's what I do.

    1. Grab breakpad
    2. Apply this
    3. Run minidump_dump on the minidump file
    4. You should get a dump of values on the stack of the crashing thread
    5. Figuring out where xul.dll and any other dlls you care about are mapped. xul.dll is usually at 0x10000000.
    6. Look for any values that look like they are in the range of where xul.dll is mapped. Assume these are return addresses
    7. Get the symbol file for xul.dll. Search xul.sym for a FUNC area that contains the return symbol. Assume that this is the caller
    8. Rinse and repeat.

    If you have any questions or need any help with this ask Jeff Muizelaar

    Ted has written a tool that does this automatically

    Document Tags and Contributors

    Contributors to this page: Jdaggett, Sicking, DBaron, jrmuizel
    最終更新者: DBaron,