When we would perform a stacktrace using the frame pointer walking, because we
did the adjustment for the return address separately, we were misaligning the
stack size and frame. Simplify the logic and correct the offset.
The recovered frame pointer provides us with the return address of the current
frame and the previous frame's frame pointer. Subsequently, we decide if we
want to record this frame or not. The value in `next_frame_pointer` already
points to the value from the previous stack frame (that is the next frame
pointer to iterate). As such, the value computed by `ComputeStackFrameSize` is
the value for the current frame. This was offset by one previously.
Take the opportunity to clean up some of the local comments, fixing typos and
splitting up the comments to reflect the lines that they are associated with.
PiperOrigin-RevId: 453744059
Change-Id: If14813e0ac36f327f4b7594472f2222d05c478aa
pull/1197/head
Saleem Abdulrasool3 years agocommitted byCopybara-Service