[Lldb-commits] [lldb] [lldb][NFC] Add a missing setter method for UnwindPlans (PR #109751)

via lldb-commits lldb-commits at lists.llvm.org
Mon Sep 23 21:30:00 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jason Molenda (jasonmolenda)

<details>
<summary>Changes</summary>

The UnwindPlan class has getter and setter methods for specifying an abstract register location, but it doesn't have a setter for a DWARF Expression register location.  This hasn't been needed for any of the UnwindPlans that we do in mainline lldb yet, but it is used in the Swift language SwiftLanguageRuntime plugin which creates UnwindPlan for async functions.  While it's currently unused on main branch, this is a straightforward setter in the same form as the others, the only caveat being that it doesn't own the dwarf expression bytes, it has a pointer to them.

---
Full diff: https://github.com/llvm/llvm-project/pull/109751.diff


1 Files Affected:

- (modified) lldb/include/lldb/Symbol/UnwindPlan.h (+7) 


``````````diff
diff --git a/lldb/include/lldb/Symbol/UnwindPlan.h b/lldb/include/lldb/Symbol/UnwindPlan.h
index a1d00f2d2c0cd1..e1567c7357d0b5 100644
--- a/lldb/include/lldb/Symbol/UnwindPlan.h
+++ b/lldb/include/lldb/Symbol/UnwindPlan.h
@@ -370,6 +370,13 @@ class UnwindPlan {
 
     bool SetRegisterLocationToSame(uint32_t reg_num, bool must_replace);
 
+    /// This method does not make a copy of the \a opcodes memory, it is
+    /// assumed to have the same lifetime as the Module this UnwindPlan will
+    /// be registered in.
+    bool SetRegisterLocationToIsDWARFExpression(uint32_t reg_num,
+                                                const uint8_t *opcodes,
+                                                uint32_t len, bool can_replace);
+
     bool SetRegisterLocationToIsConstant(uint32_t reg_num, uint64_t constant,
                                          bool can_replace);
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/109751


More information about the lldb-commits mailing list