Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MiniDumpWriteDump

67 views
Skip to first unread message

eynav

unread,
Nov 22, 2004, 10:23:54 AM11/22/04
to
Hello.

I'm trying to create a dmp file that will match the Visual Studio debugger
"Save dump as" option.
I've managed to load MINIDUMPWRITEDUMP function from dbghelp.dll and to
create dmp file upon exception using the following call:
pDump( GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal,
&ExInfo, NULL, NULL );

But when trying to create a dmp file when no exception occurs (ExInfo is
NULL),
the dmp file created has no call stack information:
pDump( GetCurrentProcess(), GetCurrentProcessId(), hFile,
MiniDumpWithDataSegs, NULL, NULL, NULL );

Any idea?
Thanks,

Eynav.


Oleg Starodumov

unread,
Nov 23, 2004, 5:09:22 AM11/23/04
to

You can simulate an exception and get the exception context.

Something like this:

void MakeDump()
{
__try
{
// raise any kind of exception here
}
__except( WriteDump( GetExceptionInformation() ) )
{
}
}

LONG __stdcall WriteDump( EXCEPTION_POINTERS* pep )
{
// Call MiniDumpWriteDump here, pass "pep" to it

return EXCEPTION_EXECUTE_HANDLER;
}

Call MakeDump when you need a dump without exception context.
Then all stack frames above MakeDump will be visible.

Regards,
Oleg


eynav

unread,
Dec 9, 2004, 4:50:52 AM12/9/04
to
Dear Oleg.

Lots of thanks. I've raised an EXCEPTION_BREAKPOINT and it does lead to a
fully detailed call stack!
(havent used __stdcall in WriteDump function declaration but it looks ok as
is).
Great!
One more thing I'm wondering about is why call to
SetUnhandledExceptionFilter(Handler) doesnt seem to 'work',
i.e an unhandled exception is not caught by handler set!
I have a Com application (i.e C++ code operated by a web site).
When using same code on a regular exe application it works ok.
Any idea?

Thanks again,
eynav.


"Oleg Starodumov" <com-dot-debuginfo-at-oleg> wrote in message
news:OgqADSU0...@tk2msftngp13.phx.gbl...

Oleg Starodumov

unread,
Dec 9, 2004, 6:02:14 AM12/9/04
to

> One more thing I'm wondering about is why call to
> SetUnhandledExceptionFilter(Handler) doesnt seem to 'work',
> i.e an unhandled exception is not caught by handler set!
> I have a Com application (i.e C++ code operated by a web site).
> When using same code on a regular exe application it works ok.
> Any idea?
>

If the COM server's method is called via proxy/stub, and there is an unhandled
exception in the method, the stub will handle the exception and return an error code
to the caller.

There is a way to disable this behavior (e.g. to verify whether it is the case or not):
http://support.microsoft.com/default.aspx?scid=kb;en-us;198623
(note: system restart is required after changing the Registry, and the KB article also applies
to XP even though it is not mentioned in the list of operating systems there)

Regards,
Oleg

0 new messages