================
@@ -3600,8 +3617,12 @@ void request_setVariable(const llvm::json::Object 
&request) {
       if (variable.MightHaveChildren())
         newVariablesReference = g_dap.variables.InsertExpandableVariable(
             variable, /*is_permanent=*/false);
-
       body.try_emplace("variablesReference", newVariablesReference);
+
+      if (lldb::addr_t addr = GetMemoryReference(variable);
+          addr != LLDB_INVALID_ADDRESS) {
+        body.try_emplace("memoryReference", "0x" + llvm::utohexstr(addr));
+      }
----------------
clayborg wrote:

And we can now use the std::optional to clean this up:
```
if (std::optional<addr_t> addr = GetMemoryReference(v)) 
  object.try_emplace("memoryReference", "0x" + llvm::utohexstr(*addr));
```

https://github.com/llvm/llvm-project/pull/104317
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to