mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2025-12-30 03:04:54 +01:00
Suppress handler thread from appearing in MinidumpProcessor's ProcessState
(#65). r=bryner - Interface change: (ProcessState).crash_thread is now requesting_thread and will be populated for non-crash dumps. If the requesting thread cannot be determined, requesting_thread is set to -1. http://groups.google.com/group/airbag-dev/browse_thread/thread/c422ec481a2db440 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@62 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
5ac32b6534
commit
76f052f8fb
16 changed files with 22370 additions and 15417 deletions
49
src/processor/testdata/test_app.cc
vendored
49
src/processor/testdata/test_app.cc
vendored
|
|
@ -28,47 +28,32 @@
|
|||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// This file is used to generate minidump2.dmp and minidump2.sym.
|
||||
// cl /Zi /Fetest_app.exe test_app.cc dbghelp.lib
|
||||
// cl /Zi test_app.cc /Fetest_app.exe /I airbag/src \
|
||||
// airbag/src/client/windows/releasestaticcrt/exception_handler.lib \
|
||||
// ole32.lib
|
||||
// Then run test_app to generate a dump, and dump_syms to create the .sym file.
|
||||
|
||||
#include <windows.h>
|
||||
#include <dbghelp.h>
|
||||
#include <cstdio>
|
||||
|
||||
static LONG HandleException(EXCEPTION_POINTERS *exinfo) {
|
||||
HANDLE dump_file = CreateFile("dump.dmp",
|
||||
GENERIC_WRITE,
|
||||
FILE_SHARE_WRITE,
|
||||
NULL,
|
||||
CREATE_ALWAYS,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
NULL);
|
||||
#include "client/windows/handler/exception_handler.h"
|
||||
|
||||
MINIDUMP_EXCEPTION_INFORMATION except_info;
|
||||
except_info.ThreadId = GetCurrentThreadId();
|
||||
except_info.ExceptionPointers = exinfo;
|
||||
except_info.ClientPointers = false;
|
||||
|
||||
MiniDumpWriteDump(GetCurrentProcess(),
|
||||
GetCurrentProcessId(),
|
||||
dump_file,
|
||||
MiniDumpNormal,
|
||||
&except_info,
|
||||
NULL,
|
||||
NULL);
|
||||
|
||||
CloseHandle(dump_file);
|
||||
return EXCEPTION_EXECUTE_HANDLER;
|
||||
void callback(const std::wstring &id, void *context, bool succeeded) {
|
||||
if (succeeded) {
|
||||
printf("dump guid is %ws\n", id.c_str());
|
||||
} else {
|
||||
printf("dump failed\n");
|
||||
}
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void CrashFunction() {
|
||||
int *i = NULL;
|
||||
int *i = reinterpret_cast<int*>(0x45);
|
||||
*i = 5; // crash!
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
__try {
|
||||
CrashFunction();
|
||||
} __except(HandleException(GetExceptionInformation())) {
|
||||
}
|
||||
int main(int argc, char **argv) {
|
||||
google_airbag::ExceptionHandler eh(L".", callback, NULL, true);
|
||||
CrashFunction();
|
||||
printf("did not crash?\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue