Add support to process INLINE records in symbol files

This adds the support to process INLINE and INLINE_ORIGIN records in
symbol files and to generate inlined frames using those records if
possible.

Bug: 1190878
Change-Id: Ia0b6d56c9de37cf818d9bb6842d58c9b68f235b2
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3024690
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Zequan Wu 2021-07-22 11:13:37 -07:00 committed by Joshua Peraza
parent 32096a2dc8
commit f080350795
18 changed files with 948 additions and 363 deletions

View file

@ -138,11 +138,12 @@ bool Stackwalker::Walk(
// frame_pointer fields. The frame structure comes from either the
// context frame (above) or a caller frame (below).
vector<std::unique_ptr<StackFrame>> inlined_frames;
// Resolve the module information, if a module map was provided.
StackFrameSymbolizer::SymbolizerResult symbolizer_result =
frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_,
system_info_,
frame.get());
frame.get(), &inlined_frames);
switch (symbolizer_result) {
case StackFrameSymbolizer::kInterrupt:
BPLOG(INFO) << "Stack walk is interrupted.";
@ -173,7 +174,11 @@ bool Stackwalker::Walk(
default:
break;
}
// Add all nested inlined frames belonging to this frame in reverse order.
while (!inlined_frames.empty()) {
stack->frames_.push_back(inlined_frames.back().release());
inlined_frames.pop_back();
}
// Add the frame to the call stack. Relinquish the ownership claim
// over the frame, because the stack now owns it.
stack->frames_.push_back(frame.release());
@ -307,7 +312,7 @@ bool Stackwalker::InstructionAddressSeemsValid(uint64_t address) const {
frame.instruction = address;
StackFrameSymbolizer::SymbolizerResult symbolizer_result =
frame_symbolizer_->FillSourceLineInfo(modules_, unloaded_modules_,
system_info_, &frame);
system_info_, &frame, nullptr);
if (!frame.module) {
// not inside any loaded module