Debugger: Correctly handle clients without supportsVariableType

Fixes: #25057
This commit is contained in:
Ben McMorran
2023-07-11 18:15:30 -07:00
committed by Brad King
parent fbe5f49d63
commit e02cf3f190
4 changed files with 58 additions and 23 deletions

View File

@@ -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() });
}
}