[Lldb-commits] [lldb] [lldb-dap] Followup fixs for data breakpoints (PR #81680)

Zequan Wu via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 14 08:21:32 PST 2024


================
@@ -2757,13 +2769,18 @@ void request_dataBreakpointInfo(const llvm::json::Object &request) {
       body.try_emplace("description", error_cstr && error_cstr[0]
                                           ? std::string(error_cstr)
                                           : "evaluation failed");
-    } else
-      addr = llvm::utohexstr(value.GetValueAsUnsigned());
+    } else {
+      uint64_t value_as_unsigned = value.GetValueAsUnsigned();
+      if (value_as_unsigned == 0) {
+        body.try_emplace("dataId", nullptr);
+        body.try_emplace("description",
+                         "unable to evaluate expression to an address.");
+      }
+      addr = llvm::utohexstr(value_as_unsigned);
+    }
   } else {
-    auto state = g_dap.target.GetProcess().GetState();
     body.try_emplace("dataId", nullptr);
-    body.try_emplace("description",
-                     "variable not found: " + llvm::utostr(state));
+    body.try_emplace("description", "variable not found");
----------------
ZequanWu wrote:

Do we have a way to get the complete name? 
The `name` passed by the request is a child member name and variableReference only tells us its parent. For watching `a.b.c`, we only gets the name `c` and variableReference value for `c`'s parent which is `b`.

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


More information about the lldb-commits mailing list