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

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Wed Sep 18 10:40:24 PDT 2024


================
@@ -1198,6 +1198,26 @@ std::string VariableDescription::GetResult(llvm::StringRef context) {
   return description.trim().str();
 }
 
+bool HasValueLocation(lldb::SBValue v) {
+  if (!v.GetType().IsPointerType() && !v.GetType().IsReferenceType()) {
+    return false;
+  }
----------------
clayborg wrote:

no parens for single line if statements per llvm coding guidelines. The name isn't quite clear for what this is doing. Maybe `ValuePointsToCode` would be better? This is also adding some extra work for every variable that is a pointer or reference. Is there no way to limit this to function pointers only? It would be great to skip the resolving of the load address if we can help it, right now it will do an address resolving on every pointer and reference.

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


More information about the lldb-commits mailing list