diff options
author | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-12-02 17:43:57 +0000 |
---|---|---|
committer | ted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-12-02 17:43:57 +0000 |
commit | 0314e487e46a45229e275eb78b09f0538a5a7769 (patch) | |
tree | e8703a4ed915335696767a5ae3362effd5940f45 /src/processor/minidump_processor.cc | |
parent | 096992fac73756cfa0974a94754329f30fd4e786 (diff) | |
download | google-breakpad-0314e487e46a45229e275eb78b09f0538a5a7769.tar.gz |
issue 170 - Report assertion type in minidump_stackwalk output. r=mark at http://breakpad.appspot.com/45001
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@433 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/processor/minidump_processor.cc')
-rw-r--r-- | src/processor/minidump_processor.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc index 0ce19e38..24b03e9d 100644 --- a/src/processor/minidump_processor.cc +++ b/src/processor/minidump_processor.cc @@ -86,6 +86,9 @@ ProcessResult MinidumpProcessor::Process( dump, &process_state->crash_address_); } + // This will just return an empty string if it doesn't exist. + process_state->assertion_ = GetAssertion(dump); + MinidumpModuleList *module_list = dump->GetModuleList(); // Put a copy of the module list into ProcessState object. This is not @@ -1006,4 +1009,57 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, u_int64_t *address) { return reason; } +// static +string MinidumpProcessor::GetAssertion(Minidump *dump) +{ + MinidumpAssertion *assertion = dump->GetAssertion(); + if (!assertion) + return ""; + + const MDRawAssertionInfo *raw_assertion = assertion->assertion(); + if (!raw_assertion) + return ""; + + string assertion_string; + switch (raw_assertion->type) { + case MD_ASSERTION_INFO_TYPE_INVALID_PARAMETER: + assertion_string = "Invalid parameter passed to library function"; + break; + case MD_ASSERTION_INFO_TYPE_PURE_VIRTUAL_CALL: + assertion_string = "Pure virtual function called"; + break; + default: { + char assertion_type[32]; + sprintf(assertion_type, "0x%08x", raw_assertion->type); + assertion_string = "Unknown assertion type "; + assertion_string += assertion_type; + break; + } + } + + string expression = assertion->expression(); + if (!expression.empty()) { + assertion_string.append(" " + expression); + } + + string function = assertion->function(); + if (!function.empty()) { + assertion_string.append(" in function " + function); + } + + string file = assertion->file(); + if (!file.empty()) { + assertion_string.append(", in file " + file); + } + + if (raw_assertion->line != 0) { + char assertion_line[32]; + sprintf(assertion_line, "%u", raw_assertion->line); + assertion_string.append(" at line "); + assertion_string.append(assertion_line); + } + + return assertion_string; +} + } // namespace google_breakpad |