aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Marchand <sebmarchand@chromium.org>2016-04-01 10:11:10 -0400
committerSebastien Marchand <sebmarchand@chromium.org>2016-04-01 10:11:10 -0400
commitd9c532217e8321a60091c917a8163e39d4ed606c (patch)
treea61409e1bd128d602caaf7de342670b32752807c
parentRefactor sym_upload in tools to extract code into common/linux, and minor fixes (diff)
downloadbreakpad-d9c532217e8321a60091c917a8163e39d4ed606c.tar.xz
Add the TID to the CallStack.
R=ivanpe@chromium.org Review URL: https://codereview.chromium.org/1849933002 .
-rw-r--r--src/google_breakpad/processor/call_stack.h12
-rw-r--r--src/processor/call_stack.cc1
-rw-r--r--src/processor/minidump_processor.cc1
-rw-r--r--src/processor/minidump_processor_unittest.cc1
4 files changed, 14 insertions, 1 deletions
diff --git a/src/google_breakpad/processor/call_stack.h b/src/google_breakpad/processor/call_stack.h
index 21f595e7..7c4a06f5 100644
--- a/src/google_breakpad/processor/call_stack.h
+++ b/src/google_breakpad/processor/call_stack.h
@@ -45,6 +45,7 @@
#ifndef GOOGLE_BREAKPAD_PROCESSOR_CALL_STACK_H__
#define GOOGLE_BREAKPAD_PROCESSOR_CALL_STACK_H__
+#include <cstdint>
#include <vector>
namespace google_breakpad {
@@ -61,15 +62,24 @@ class CallStack {
// Resets the CallStack to its initial empty state
void Clear();
-
+
const vector<StackFrame*>* frames() const { return &frames_; }
+ // Set the TID associated with this call stack.
+ void set_tid(uint32_t tid) { tid_ = tid; }
+
+ uint32_t tid() { return tid_; }
+
private:
// Stackwalker is responsible for building the frames_ vector.
friend class Stackwalker;
// Storage for pushed frames.
vector<StackFrame*> frames_;
+
+ // The TID associated with this call stack. Default to 0 if it's not
+ // available.
+ uint32_t tid_;
};
} // namespace google_breakpad
diff --git a/src/processor/call_stack.cc b/src/processor/call_stack.cc
index e3276716..925f0846 100644
--- a/src/processor/call_stack.cc
+++ b/src/processor/call_stack.cc
@@ -48,6 +48,7 @@ void CallStack::Clear() {
++iterator) {
delete *iterator;
}
+ tid_ = 0;
}
} // namespace google_breakpad
diff --git a/src/processor/minidump_processor.cc b/src/processor/minidump_processor.cc
index b7d7a0d9..448152a8 100644
--- a/src/processor/minidump_processor.cc
+++ b/src/processor/minidump_processor.cc
@@ -267,6 +267,7 @@ ProcessResult MinidumpProcessor::Process(
// one bad thread.
BPLOG(ERROR) << "No stackwalker for " << thread_string;
}
+ stack->set_tid(thread_id);
process_state->threads_.push_back(stack.release());
process_state->thread_memory_regions_.push_back(thread_memory);
}
diff --git a/src/processor/minidump_processor_unittest.cc b/src/processor/minidump_processor_unittest.cc
index 69e1f42e..609a2a68 100644
--- a/src/processor/minidump_processor_unittest.cc
+++ b/src/processor/minidump_processor_unittest.cc
@@ -414,6 +414,7 @@ TEST_F(MinidumpProcessorTest, TestBasicProcessing) {
ASSERT_EQ(state.crash_reason(), "EXCEPTION_ACCESS_VIOLATION_WRITE");
ASSERT_EQ(state.crash_address(), 0x45U);
ASSERT_EQ(state.threads()->size(), size_t(1));
+ EXPECT_EQ((*state.threads())[0]->tid(), 3060);
ASSERT_EQ(state.requesting_thread(), 0);
EXPECT_EQ(1171480435U, state.time_date_stamp());
EXPECT_EQ(1171480435U, state.process_create_time());