@@ -4192,7 +4192,7 @@ void request_variables(DAP &dap, const llvm::json::Object &request) {
4192
4192
if (num_children == 0 && variablesReference == VARREF_LOCALS) {
4193
4193
// Check for an error in the SBValueList that might explain why we don't
4194
4194
// have locals. If we have an error display it as the sole value in the
4195
- // the locals.
4195
+ // locals.
4196
4196
4197
4197
// "error" owns the error string so we must keep it alive as long as we
4198
4198
// want to use the returns "const char *"
@@ -4225,21 +4225,23 @@ void request_variables(DAP &dap, const llvm::json::Object &request) {
4225
4225
variable_name_counts[GetNonNullVariableName (variable)]++;
4226
4226
}
4227
4227
4228
- // Show return value if there is any ( in the top frame )
4229
- auto process = g_dap.target .GetProcess ();
4230
- auto selected_thread = process.GetSelectedThread ();
4231
- lldb::SBValue stop_return_value = selected_thread.GetStopReturnValue ();
4232
- if (stop_return_value.IsValid () &&
4233
- (selected_thread.GetSelectedFrame ().GetFrameID () == 0 )) {
4234
- auto renamed_return_value = stop_return_value.Clone (" (Return Value)" );
4235
- int64_t return_var_ref = 0 ;
4236
- if (stop_return_value.MightHaveChildren () ||
4237
- stop_return_value.IsSynthetic ()) {
4238
- return_var_ref = g_dap.variables .InsertExpandableVariable (
4239
- stop_return_value, /* is_permanent=*/ false );
4228
+ // Show return value if there is any ( in the local top frame )
4229
+ if (variablesReference == VARREF_LOCALS) {
4230
+ auto process = g_dap.target .GetProcess ();
4231
+ auto selected_thread = process.GetSelectedThread ();
4232
+ lldb::SBValue stop_return_value = selected_thread.GetStopReturnValue ();
4233
+ if (stop_return_value.IsValid () &&
4234
+ (selected_thread.GetSelectedFrame ().GetFrameID () == 0 )) {
4235
+ auto renamed_return_value = stop_return_value.Clone (" (Return Value)" );
4236
+ int64_t return_var_ref = 0 ;
4237
+ if (stop_return_value.MightHaveChildren () ||
4238
+ stop_return_value.IsSynthetic ()) {
4239
+ return_var_ref = g_dap.variables .InsertExpandableVariable (
4240
+ stop_return_value, /* is_permanent=*/ false );
4241
+ }
4242
+ variables.emplace_back (CreateVariable (
4243
+ renamed_return_value, return_var_ref, UINT64_MAX, hex, false ));
4240
4244
}
4241
- variables.emplace_back (CreateVariable (renamed_return_value, return_var_ref,
4242
- UINT64_MAX, hex, false ));
4243
4245
}
4244
4246
4245
4247
// Now we construct the result with unique display variable names
0 commit comments