aboutsummaryrefslogtreecommitdiff
path: root/src/processor/microdump_processor_unittest.cc
diff options
context:
space:
mode:
authorTobias Sargeant <tobiasjs@google.com>2017-10-16 10:22:57 +0100
committerTobias Sargeant <tobiasjs@chromium.org>2017-10-17 10:22:46 +0000
commit3d6076efc24ec6c74cba7729121bf45512a15ba2 (patch)
treee5d34a0da94672ed457674ab33007b75263103e6 /src/processor/microdump_processor_unittest.cc
parentConvert {mini|micro}dump_stackwalk argument parsing to getopt. (diff)
downloadbreakpad-3d6076efc24ec6c74cba7729121bf45512a15ba2.tar.xz
Add -s flag to microdump_stackwalk for dumping stack contents.
Note that the current MicrodumpProcessor::Process implementation has a bug due to the fact that it creates a local Microdump instance, and then holds onto a pointer to the object returned by microdump.GetMemory() which is destroyed when microdump goes out of scope. This CL fixes the crash by making Microdump outlive MicrodumpProcessor, which is the same pattern that Minidump/MinidumpProcessor uses. Bug: google-breakpad:748 Change-Id: I554b46d309649cf404523722bd9ee39e17a10139 Reviewed-on: https://chromium-review.googlesource.com/720809 Reviewed-by: Primiano Tucci <primiano@chromium.org> Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
Diffstat (limited to 'src/processor/microdump_processor_unittest.cc')
-rw-r--r--src/processor/microdump_processor_unittest.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/processor/microdump_processor_unittest.cc b/src/processor/microdump_processor_unittest.cc
index 029259f4..83bdef95 100644
--- a/src/processor/microdump_processor_unittest.cc
+++ b/src/processor/microdump_processor_unittest.cc
@@ -37,6 +37,7 @@
#include "breakpad_googletest_includes.h"
#include "google_breakpad/processor/basic_source_line_resolver.h"
#include "google_breakpad/processor/call_stack.h"
+#include "google_breakpad/processor/microdump.h"
#include "google_breakpad/processor/microdump_processor.h"
#include "google_breakpad/processor/process_state.h"
#include "google_breakpad/processor/stack_frame.h"
@@ -47,6 +48,7 @@
namespace {
using google_breakpad::BasicSourceLineResolver;
+using google_breakpad::Microdump;
using google_breakpad::MicrodumpProcessor;
using google_breakpad::ProcessState;
using google_breakpad::SimpleSymbolSupplier;
@@ -83,7 +85,8 @@ class MicrodumpProcessorTest : public ::testing::Test {
StackFrameSymbolizer frame_symbolizer(&supplier, &resolver);
MicrodumpProcessor processor(&frame_symbolizer);
- return processor.Process(microdump_contents, state);
+ Microdump microdump(microdump_contents);
+ return processor.Process(&microdump, state);
}
void AnalyzeDump(const string& microdump_file_name, bool omit_symbols,
@@ -109,13 +112,6 @@ class MicrodumpProcessorTest : public ::testing::Test {
string files_path_;
};
-TEST_F(MicrodumpProcessorTest, TestProcess_Empty) {
- ProcessState state;
- google_breakpad::ProcessResult result =
- ProcessMicrodump("", "", &state);
- ASSERT_EQ(google_breakpad::PROCESS_ERROR_MINIDUMP_NOT_FOUND, result);
-}
-
TEST_F(MicrodumpProcessorTest, TestProcess_Invalid) {
ProcessState state;
google_breakpad::ProcessResult result =