Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lldb/test/API/tools/lldb-dap/variables/TestDAP_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,20 @@ def do_test_scopes_variables_setVariable_evaluate(

# Set a variable value whose name is synthetic, like a variable index
# and verify the value by reading it
self.dap_server.request_setVariable(varRef, "[0]", 100)
variable_value = 100
response = self.dap_server.request_setVariable(varRef, "[0]", variable_value)
# Verify dap sent the correct response
verify_response = {
"type": "int",
"value": str(variable_value),
"variablesReference": 0,
}
for key, value in verify_response.items():
self.assertEqual(value, response["body"][key])

response = self.dap_server.request_variables(varRef, start=0, count=1)
self.verify_variables(
make_buffer_verify_dict(0, 1, 100), response["body"]["variables"]
make_buffer_verify_dict(0, 1, variable_value), response["body"]["variables"]
)

# Set a variable value whose name is a real child value, like "pt.x"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void SetVariableRequestHandler::operator()(
bool success = variable.SetValueFromCString(value.data(), error);
if (success) {
VariableDescription desc(variable, dap.enable_auto_variable_summaries);
EmplaceSafeString(body, "result", desc.display_value);
EmplaceSafeString(body, "value", desc.display_value);
EmplaceSafeString(body, "type", desc.display_type_name);

// We don't know the index of the variable in our dap.variables
Expand Down
Loading