[Lldb-commits] [PATCH] D124957: When picking a row from an UnwindPlan on a mid-stack frame, decr pc to get within bounds of the CALL instruction

Jason Molenda via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 5 14:38:19 PDT 2022


jasonmolenda added inline comments.


================
Comment at: lldb/source/Target/RegisterContextUnwind.cpp:90
   // check if m_current_pc is valid
   if (unwind_plan_sp->PlanValidAtAddress(m_current_pc)) {
     // yes - current offset can be used as is
----------------
clayborg wrote:
> Don't we want to subtract 1 here? Otherwise this function might return true incorrectly if we actually need to subtract at least 1 from the PC
honestly this method is a bit suspect, when we look at it today.  It's first "is $pc within ByteSize", then "ok is pc-1 within ByteSize", with a bonus check if somehow we have a negative offset.  Maybe it became suspect with revision over time.  I don't think it's wrong, but it's not written with much clarity and I should look into how it's changed over time to see if there was a cleaner vision of its goals originally...


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124957/new/

https://reviews.llvm.org/D124957



More information about the lldb-commits mailing list