[Lldb-commits] [lldb] [lldb] Evaluate exprloc array bounds (PR #204119)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 30 01:23:44 PDT 2026


================
@@ -21,6 +27,49 @@ using namespace lldb_private;
 using namespace lldb_private::plugin::dwarf;
 using namespace llvm::dwarf;
 
+static std::optional<uint64_t>
+EvaluateUnsignedArrayProperty(const DWARFFormValue &form_value,
+                              const DWARFDIE &parent_die,
+                              const ExecutionContext *exe_ctx) {
+  // Array properties may be encoded directly as constants.
+  if (std::optional<uint64_t> value = form_value.getAsUnsignedConstant())
+    return value;
+  if (std::optional<int64_t> value = form_value.getAsSignedConstant())
+    if (*value >= 0)
+      return *value;
----------------
Michael137 wrote:

The function name makes it sound like we can only handle `unsigned` constants

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


More information about the lldb-commits mailing list