================ @@ -2697,58 +2737,41 @@ void request_dataBreakpointInfo(const llvm::json::Object &request) { GetUnsigned(arguments, "variablesReference", 0); llvm::StringRef name = GetString(arguments, "name"); lldb::SBFrame frame = g_dap.GetLLDBFrame(*arguments); - bool is_duplicated_variable_name = name.contains(" @"); + lldb::SBValue variable = FindVariable(variablesReference, name); + std::string addr, size; - lldb::SBValue variable; - if (lldb::SBValueList *top_scope = GetTopLevelScope(variablesReference)) { - // variablesReference is one of our scopes, not an actual variable it is - // asking for a variable in locals or globals or registers - int64_t end_idx = top_scope->GetSize(); - // Searching backward so that we choose the variable in closest scope - // among variables of the same name. - for (int64_t i = end_idx - 1; i >= 0; --i) { - lldb::SBValue curr_variable = top_scope->GetValueAtIndex(i); - std::string variable_name = CreateUniqueVariableNameForDisplay( - curr_variable, is_duplicated_variable_name); - if (variable_name == name) { - variable = curr_variable; - break; - } - } + if (variable.IsValid()) { + addr = llvm::utohexstr(variable.GetLoadAddress()); + size = llvm::utostr(variable.GetByteSize()); ---------------- clayborg wrote:
Need to check if the byte size is not zero and return an error if it is. https://github.com/llvm/llvm-project/pull/81541 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits