diff options
author | Joshua Peraza <jperaza@chromium.org> | 2017-01-19 11:18:41 -0800 |
---|---|---|
committer | Joshua Peraza <jperaza@chromium.org> | 2017-01-19 19:33:56 +0000 |
commit | 0924d424e444d57dd95c647652a11f2d655c11a0 (patch) | |
tree | 03023e635cd25fbaf8b532c3151f6b397bcd12b4 /src/processor/stackwalker.cc | |
parent | Add API to skip dump if crashing thread doesn't reference a given module (2) (diff) | |
download | breakpad-0924d424e444d57dd95c647652a11f2d655c11a0.tar.xz |
Populate stack frames with unloaded module info.
This CL hits lots of source files because:
1. An update to the CodeModule virtual class. I added an is_loaded
method to specify whether the module is loaded. There were several
mocks/test classes that needed to be updated with an implementation.
An alternative to this route would be to modify
MinidumpUnloadedModule::code_file to prepend "Unloaded_" to the
module name.
2. Added an unloaded_modules parameter to
StackFrameSymbolizer::FillSourceLineInfo.
BUG=
Change-Id: Ic9c7f7c7b7e932a154a5d4ccf292c1527d8da09f
Reviewed-on: https://chromium-review.googlesource.com/430241
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
Diffstat (limited to 'src/processor/stackwalker.cc')
-rw-r--r-- | src/processor/stackwalker.cc | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/processor/stackwalker.cc b/src/processor/stackwalker.cc index 98cb0b5b..c85ce5e8 100644 --- a/src/processor/stackwalker.cc +++ b/src/processor/stackwalker.cc @@ -72,6 +72,7 @@ Stackwalker::Stackwalker(const SystemInfo* system_info, : system_info_(system_info), memory_(memory), modules_(modules), + unloaded_modules_(NULL), frame_symbolizer_(frame_symbolizer) { assert(frame_symbolizer_); } @@ -134,8 +135,9 @@ bool Stackwalker::Walk( // Resolve the module information, if a module map was provided. StackFrameSymbolizer::SymbolizerResult symbolizer_result = - frame_symbolizer_->FillSourceLineInfo(modules_, system_info_, - frame.get()); + frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_, + system_info_, + frame.get()); switch (symbolizer_result) { case StackFrameSymbolizer::kInterrupt: BPLOG(INFO) << "Stack walk is interrupted."; @@ -186,13 +188,13 @@ bool Stackwalker::Walk( return true; } - // static Stackwalker* Stackwalker::StackwalkerForCPU( const SystemInfo* system_info, DumpContext* context, MemoryRegion* memory, const CodeModules* modules, + const CodeModules* unloaded_modules, StackFrameSymbolizer* frame_symbolizer) { if (!context) { BPLOG(ERROR) << "Can't choose a stackwalker implementation without context"; @@ -263,6 +265,9 @@ Stackwalker* Stackwalker::StackwalkerForCPU( BPLOG_IF(ERROR, !cpu_stackwalker) << "Unknown CPU type " << HexString(cpu) << ", can't choose a stackwalker " "implementation"; + if (cpu_stackwalker) { + cpu_stackwalker->unloaded_modules_ = unloaded_modules; + } return cpu_stackwalker; } @@ -270,7 +275,8 @@ bool Stackwalker::InstructionAddressSeemsValid(uint64_t address) { StackFrame frame; frame.instruction = address; StackFrameSymbolizer::SymbolizerResult symbolizer_result = - frame_symbolizer_->FillSourceLineInfo(modules_, system_info_, &frame); + frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_, + system_info_, &frame); if (!frame.module) { // not inside any loaded module |