Make processor compatible with both old and new format INLINE/INLINE_ORIGIN

This is similar to the processor part of
https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3232838/,
but added compatibility to process both old and new format of
INLINE/INLINE_ORIGIN records in symbol file.

Old INLINE format:
INLINE <inline_nest_level> <call_site_line> <origin_id>
[<address> <size>]+
New INLINE format:
INLINE <inline_nest_level> <call_site_line> <call_site_file_id>
<origin_id> [<address> <size>]+
Old INLINE_ORIGIN format:
INLINE_ORIGIN <origin_id> <file_id> <name>
New INLINE_ORIGIN format:
INLINE_ORIGIN <origin_id> <name>

Change-Id: I555d9747bfd44a1a95113b9946dcd509b7710876
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3248433
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Zequan Wu
2021-10-29 16:20:55 -07:00
committed by Joshua Peraza
parent dfcb7b6799
commit ee2ad61263
16 changed files with 377 additions and 121 deletions

View File

@@ -138,7 +138,7 @@ 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;
std::deque<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_,
@@ -174,10 +174,11 @@ bool Stackwalker::Walk(
default:
break;
}
// Add all nested inlined frames belonging to this frame in reverse order.
// Add all nested inlined frames belonging to this frame from the innermost
// frame to the outermost frame.
while (!inlined_frames.empty()) {
stack->frames_.push_back(inlined_frames.back().release());
inlined_frames.pop_back();
stack->frames_.push_back(inlined_frames.front().release());
inlined_frames.pop_front();
}
// Add the frame to the call stack. Relinquish the ownership claim
// over the frame, because the stack now owns it.