[Lldb-commits] [lldb] [lldb-dap] Implement value locations for function pointers (PR #104589)

Walter Erquinigo via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 17 08:49:57 PDT 2024


================
@@ -1390,7 +1414,10 @@ llvm::json::Value CreateVariable(lldb::SBValue v, int64_t var_ref,
     object.try_emplace("variablesReference", 0);
 
   if (v.GetDeclaration().IsValid())
-    object.try_emplace("declarationLocationReference", var_ref);
+    object.try_emplace("declarationLocationReference", var_ref << 1);
+
+  if (HasValueLocation(v))
+    object.try_emplace("valueLocationReference", (var_ref << 1) | 1);
----------------
walter-erquinigo wrote:

Please create helper functions that do these bitwise manipulations. That would make it more obvious what's going on. E.g. varRefToDeclLocationRef and varRefToValueLocationRef

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


More information about the lldb-commits mailing list