wukenaihe / google-breakpad

Automatically exported from code.google.com/p/google-breakpad
0 stars 0 forks source link

handle pure virtual function calls in VC++ #162

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Visual C++ uses a method called _purecall to handle pure virtual function
calls.  Unfortunately the CRT implementation throws up an error dialog and
aborts the app.  It would be nice if Breakpad intercepted this and
generated a minidump instead.  You can do this by defining _purecall as
follows:

extern "C"
int __cdecl _purecall()
{
  // handle here...
  return 0;
}

Original issue reported on code.google.com by ted.mielczarek on 5 May 2007 at 2:51

GoogleCodeExporter commented 9 years ago
You want _set_purecall_handler, see
http://msdn2.microsoft.com/en-us/library/t296ys27(VS.80).aspx

And I'm pretty sure you want to terminate the process after we crash-report, 
instead
of "return 0"...

Original comment by bsmedb...@gmail.com on 7 May 2007 at 2:00

GoogleCodeExporter commented 9 years ago
This handles this basically the same way as the invalid parameter handler.  I'm 
not
super happy with either of them, since we don't get much useful info out of
minidump_stackwalk with them.

Original comment by ted.mielczarek on 8 May 2007 at 7:10

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by ted.mielczarek on 9 May 2007 at 1:29

GoogleCodeExporter commented 9 years ago
Ted, do you want review for this?  Too late!

+//static

Space between // and static.

+void ExceptionHandler::HandlePureVirtualCall(void)
+{

These two should be a single line.  Also, I tend to hate the (void) parameter 
and we
don't use it elsewhere.  (That also applies to the header).

A few lines above your context in minidump_format.h, I had this:

/* For (MDRawAssertionInfo).info: */

That should say .type instead of .info.

Original comment by mmento...@gmail.com on 9 May 2007 at 6:32

GoogleCodeExporter commented 9 years ago

Original comment by ted.mielczarek on 10 May 2007 at 5:12