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

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.

>From 5a6e6870930d0e950993faa0673aad8a47881864 Mon Sep 17 00:00:00 2001
From: Jason Molenda <jmole...@apple.com>
Date: Mon, 23 Sep 2024 21:28:12 -0700
Subject: [PATCH] [lldb][NFC] Add a missing setter method for UnwindPlans

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.
---
 lldb/include/lldb/Symbol/UnwindPlan.h | 7 +++++++
 1 file changed, 7 insertions(+)

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);
 

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to