aboutsummaryrefslogtreecommitdiff
path: root/src/google_breakpad/processor
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-02 17:43:57 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2009-12-02 17:43:57 +0000
commit0314e487e46a45229e275eb78b09f0538a5a7769 (patch)
treee8703a4ed915335696767a5ae3362effd5940f45 /src/google_breakpad/processor
parentUpstreaming several patches from Chrome: (diff)
downloadbreakpad-0314e487e46a45229e275eb78b09f0538a5a7769.tar.xz
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/google_breakpad/processor')
-rw-r--r--src/google_breakpad/processor/minidump.h41
-rw-r--r--src/google_breakpad/processor/minidump_processor.h5
-rw-r--r--src/google_breakpad/processor/process_state.h6
3 files changed, 52 insertions, 0 deletions
diff --git a/src/google_breakpad/processor/minidump.h b/src/google_breakpad/processor/minidump.h
index f08a1c18..d3a7b92b 100644
--- a/src/google_breakpad/processor/minidump.h
+++ b/src/google_breakpad/processor/minidump.h
@@ -639,6 +639,46 @@ class MinidumpException : public MinidumpStream {
MinidumpContext* context_;
};
+// MinidumpAssertion wraps MDRawAssertionInfo, which contains information
+// about an assertion that caused the minidump to be generated.
+class MinidumpAssertion : public MinidumpStream {
+ public:
+ virtual ~MinidumpAssertion();
+
+ const MDRawAssertionInfo* assertion() const {
+ return valid_ ? &assertion_ : NULL;
+ }
+
+ string expression() const {
+ return valid_ ? expression_ : "";
+ }
+
+ string function() const {
+ return valid_ ? function_ : "";
+ }
+
+ string file() const {
+ return valid_ ? file_ : "";
+ }
+
+ // Print a human-readable representation of the object to stdout.
+ void Print();
+
+ private:
+ friend class Minidump;
+
+ static const u_int32_t kStreamType = MD_ASSERTION_INFO_STREAM;
+
+ explicit MinidumpAssertion(Minidump* minidump);
+
+ bool Read(u_int32_t expected_size);
+
+ MDRawAssertionInfo assertion_;
+ string expression_;
+ string function_;
+ string file_;
+};
+
// MinidumpSystemInfo wraps MDRawSystemInfo and provides information about
// the system on which the minidump was generated. See also MinidumpMiscInfo.
@@ -788,6 +828,7 @@ class Minidump {
MinidumpModuleList* GetModuleList();
MinidumpMemoryList* GetMemoryList();
MinidumpException* GetException();
+ MinidumpAssertion* GetAssertion();
MinidumpSystemInfo* GetSystemInfo();
MinidumpMiscInfo* GetMiscInfo();
MinidumpBreakpadInfo* GetBreakpadInfo();
diff --git a/src/google_breakpad/processor/minidump_processor.h b/src/google_breakpad/processor/minidump_processor.h
index f313bf71..756a868b 100644
--- a/src/google_breakpad/processor/minidump_processor.h
+++ b/src/google_breakpad/processor/minidump_processor.h
@@ -141,6 +141,11 @@ class MinidumpProcessor {
return (p != PROCESS_SYMBOL_SUPPLIER_INTERRUPTED);
}
+ // Returns a textual representation of an assertion included
+ // in the minidump. Returns an empty string if this information
+ // does not exist or cannot be determined.
+ static string GetAssertion(Minidump *dump);
+
private:
SymbolSupplier *supplier_;
SourceLineResolverInterface *resolver_;
diff --git a/src/google_breakpad/processor/process_state.h b/src/google_breakpad/processor/process_state.h
index 8247f707..23014227 100644
--- a/src/google_breakpad/processor/process_state.h
+++ b/src/google_breakpad/processor/process_state.h
@@ -61,6 +61,7 @@ class ProcessState {
bool crashed() const { return crashed_; }
string crash_reason() const { return crash_reason_; }
u_int64_t crash_address() const { return crash_address_; }
+ string assertion() const { return assertion_; }
int requesting_thread() const { return requesting_thread_; }
const vector<CallStack*>* threads() const { return &threads_; }
const vector<MinidumpMemoryRegion*>* thread_memory_regions() const {
@@ -92,6 +93,11 @@ class ProcessState {
// this will be the address of the instruction that caused the fault.
u_int64_t crash_address_;
+ // If there was an assertion that was hit, a textual representation
+ // of that assertion, possibly including the file and line at which
+ // it occurred.
+ string assertion_;
+
// The index of the thread that requested a dump be written in the
// threads vector. If a dump was produced as a result of a crash, this
// will point to the thread that crashed. If the dump was produced as