How to write a sample code that will crash and produce dump file?

后端 未结 9 1424
礼貌的吻别
礼貌的吻别 2020-12-12 23:15

I started learned windbg and I found this good post How to use WinDbg to analyze the crash dump for VC++ application?

Now I want to follow the instructions and do it

9条回答
  •  情话喂你
    2020-12-12 23:34

    This will produce a null pointer dereference exception: *((int*) 0) = 0;

    This will produce integer division by zero: int a = 0; int b = 5 / a;

    EDIT: Post-Mortem Debugging Your Application with Minidumps and Visual Studio .NET contains a lot of sample code and theory on using minidumps.

提交回复
热议问题