[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

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu May 5 11:44:30 PDT 2022


clayborg requested changes to this revision.
clayborg added a comment.
This revision now requires changes to proceed.

Inline comments point out where can can get rid of the second parameter to IsUnwindPlanValidForCurrentPC() as no one uses it anymore.



================
Comment at: lldb/source/Target/RegisterContextUnwind.cpp:519-522
+    if (m_behaves_like_zeroth_frame)
+      decr_pc_and_recompute_addr_range = false;
+    else
+      decr_pc_and_recompute_addr_range = true;
----------------
This can easily just be:
```
m_behaves_like_zeroth_frame = !decr_pc_and_recompute_addr_range;
```


================
Comment at: lldb/source/Target/RegisterContextUnwind.cpp:642-643
     m_full_unwind_plan_sp = GetFullUnwindPlanForFrame();
     int valid_offset = -1;
     if (IsUnwindPlanValidForCurrentPC(m_full_unwind_plan_sp, valid_offset)) {
+      active_row = m_full_unwind_plan_sp->GetRowForFunctionOffset(
----------------
remove "valid_offset" variable and also remove it from the second argument to IsUnwindPlanValidForCurrentPC as it isn't used anywhere now and is just dead code.


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