[Lldb-commits] [lldb] [lldb-dap] Support inspecting memory (PR #104317)

Adrian Vogelsgesang via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 16 04:55:20 PDT 2024


================
@@ -1085,6 +1085,19 @@ std::string VariableDescription::GetResult(llvm::StringRef context) {
   return description.trim().str();
 }
 
+lldb::addr_t GetMemoryReference(lldb::SBValue v) {
+  if (!v.GetType().IsPointerType() && !v.GetType().IsArrayType()) {
+    return LLDB_INVALID_ADDRESS;
+  }
+
+  lldb::SBValue deref = v.Dereference();
+  if (!deref.IsValid()) {
+    return LLDB_INVALID_ADDRESS;
+  }
+
+  return deref.GetLoadAddress();
----------------
vogelsgesang wrote:

Continued in https://github.com/llvm/llvm-project/pull/104317#discussion_r1719180273

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


More information about the lldb-commits mailing list