summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen McMorran <bemcmorr@microsoft.com>2023-07-12 01:15:30 (GMT)
committerBrad King <brad.king@kitware.com>2023-07-12 14:09:21 (GMT)
commite02cf3f1906dda51e5cdf8ae38b3eb46176a90f1 (patch)
treef17303df7a1c527db2f2ee3b6eb5627c7ad667ce /Source
parentfbe5f49d63fe058277b41991cb025631093b25a2 (diff)
downloadCMake-e02cf3f1906dda51e5cdf8ae38b3eb46176a90f1.zip
CMake-e02cf3f1906dda51e5cdf8ae38b3eb46176a90f1.tar.gz
CMake-e02cf3f1906dda51e5cdf8ae38b3eb46176a90f1.tar.bz2
Debugger: Correctly handle clients without supportsVariableType
Fixes: #25057
Diffstat (limited to 'Source')
-rw-r--r--Source/cmDebuggerVariables.cxx39
1 files changed, 20 insertions, 19 deletions
diff --git a/Source/cmDebuggerVariables.cxx b/Source/cmDebuggerVariables.cxx
index 40fe41f..8acce34 100644
--- a/Source/cmDebuggerVariables.cxx
+++ b/Source/cmDebuggerVariables.cxx
@@ -78,15 +78,16 @@ dap::array<dap::Variable> cmDebuggerVariables::HandleVariablesRequest()
entry.Value.empty()) {
continue;
}
- variables.push_back(dap::Variable{ {},
- {},
- {},
- entry.Name,
- {},
- PrivateDataHint,
- entry.Type,
- entry.Value,
- 0 });
+ variables.push_back(dap::Variable{
+ {},
+ {},
+ {},
+ entry.Name,
+ {},
+ PrivateDataHint,
+ SupportsVariableType ? entry.Type : dap::optional<dap::string>(),
+ entry.Value,
+ 0 });
}
}
@@ -106,16 +107,16 @@ void cmDebuggerVariables::EnumerateSubVariablesIfAny(
{
dap::array<dap::Variable> ret;
for (auto const& variables : SubVariables) {
- toBeReturned.emplace_back(
- dap::Variable{ {},
- {},
- {},
- variables->GetName(),
- {},
- PrivatePropertyHint,
- SupportsVariableType ? "collection" : nullptr,
- variables->GetValue(),
- variables->GetId() });
+ toBeReturned.emplace_back(dap::Variable{
+ {},
+ {},
+ {},
+ variables->GetName(),
+ {},
+ PrivatePropertyHint,
+ SupportsVariableType ? "collection" : dap::optional<dap::string>(),
+ variables->GetValue(),
+ variables->GetId() });
}
}