mirror of
https://git.suyu.dev/suyu/breakpad.git
synced 2026-01-04 05:34:45 +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
|
|
@ -32,81 +32,83 @@
|
|||
//
|
||||
// Author: Mark Mentovai
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <string>
|
||||
#include <cstdio>
|
||||
|
||||
#include "google_airbag/processor/minidump.h"
|
||||
|
||||
|
||||
using std::string;
|
||||
using namespace google_airbag;
|
||||
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
int main(int argc, char **argv) {
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "usage: %s <file>\n", argv[0]);
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
|
||||
Minidump minidump(argv[1]);
|
||||
if (!minidump.Read()) {
|
||||
printf("minidump.Read() failed\n");
|
||||
exit(1);
|
||||
return 1;
|
||||
}
|
||||
minidump.Print();
|
||||
|
||||
int error = 0;
|
||||
int errors = 0;
|
||||
|
||||
MinidumpThreadList* threadList = minidump.GetThreadList();
|
||||
if (!threadList) {
|
||||
error |= 1 << 2;
|
||||
MinidumpThreadList *thread_list = minidump.GetThreadList();
|
||||
if (!thread_list) {
|
||||
++errors;
|
||||
printf("minidump.GetThreadList() failed\n");
|
||||
} else {
|
||||
threadList->Print();
|
||||
thread_list->Print();
|
||||
}
|
||||
|
||||
MinidumpModuleList* moduleList = minidump.GetModuleList();
|
||||
if (!moduleList) {
|
||||
error |= 1 << 3;
|
||||
MinidumpModuleList *module_list = minidump.GetModuleList();
|
||||
if (!module_list) {
|
||||
++errors;
|
||||
printf("minidump.GetModuleList() failed\n");
|
||||
} else {
|
||||
moduleList->Print();
|
||||
module_list->Print();
|
||||
}
|
||||
|
||||
MinidumpMemoryList* memoryList = minidump.GetMemoryList();
|
||||
if (!memoryList) {
|
||||
error |= 1 << 4;
|
||||
MinidumpMemoryList *memory_list = minidump.GetMemoryList();
|
||||
if (!memory_list) {
|
||||
++errors;
|
||||
printf("minidump.GetMemoryList() failed\n");
|
||||
} else {
|
||||
memoryList->Print();
|
||||
memory_list->Print();
|
||||
}
|
||||
|
||||
MinidumpException* exception = minidump.GetException();
|
||||
MinidumpException *exception = minidump.GetException();
|
||||
if (!exception) {
|
||||
error |= 1 << 5;
|
||||
// Exception info is optional, so don't treat this as an error.
|
||||
printf("minidump.GetException() failed\n");
|
||||
} else {
|
||||
exception->Print();
|
||||
}
|
||||
|
||||
MinidumpSystemInfo* systemInfo = minidump.GetSystemInfo();
|
||||
if (!systemInfo) {
|
||||
error |= 1 << 6;
|
||||
MinidumpSystemInfo *system_info = minidump.GetSystemInfo();
|
||||
if (!system_info) {
|
||||
++errors;
|
||||
printf("minidump.GetSystemInfo() failed\n");
|
||||
} else {
|
||||
systemInfo->Print();
|
||||
system_info->Print();
|
||||
}
|
||||
|
||||
MinidumpMiscInfo* miscInfo = minidump.GetMiscInfo();
|
||||
if (!miscInfo) {
|
||||
error |= 1 << 7;
|
||||
MinidumpMiscInfo *misc_info = minidump.GetMiscInfo();
|
||||
if (!misc_info) {
|
||||
++errors;
|
||||
printf("minidump.GetMiscInfo() failed\n");
|
||||
} else {
|
||||
miscInfo->Print();
|
||||
misc_info->Print();
|
||||
}
|
||||
|
||||
MinidumpAirbagInfo *airbag_info = minidump.GetAirbagInfo();
|
||||
if (!airbag_info) {
|
||||
// Airbag info is optional, so don't treat this as an error.
|
||||
printf("minidump.GetAirbagInfo() failed\n");
|
||||
} else {
|
||||
airbag_info->Print();
|
||||
}
|
||||
|
||||
// Use return instead of exit to allow destructors to run.
|
||||
return(error);
|
||||
return errors == 0 ? 0 : 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue