[Lldb-commits] [lldb] [lldb] Treat synthetic variables as locals (PR #204431)

Aman LaChapelle via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 24 10:49:03 PDT 2026


================
@@ -322,3 +322,24 @@ ScriptedPythonInterface::ExtractValueFromPythonObject<lldb::ValueObjectListSP>(
 
   return out;
 }
+
+template <>
+std::optional<lldb::ValueType>
+ScriptedPythonInterface::ExtractValueFromPythonObject<
+    std::optional<lldb::ValueType>>(python::PythonObject &p, Status &error) {
+  if (p.IsNone())
+    return std::nullopt;
+
+  llvm::Expected<unsigned long long> val = p.AsUnsignedLongLong();
+  if (!val) {
+    error = Status::FromError(val.takeError());
+    return std::nullopt;
+  }
+  if (*val > std::numeric_limits<std::underlying_type_t<ValueType>>::max()) {
----------------
bzcheeseman wrote:

This seems wrong, I think you want to use the ValueType max not the underlying type max value.

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


More information about the lldb-commits mailing list