Export "finish" return value to Python

This patch changes the Python "stop" event emission code to also add
the function return value, if it is known.  This happens when the stop
comes from a "finish" command and when the value can be fetched.

The test is in the next patch.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
This commit is contained in:
Tom Tromey
2024-02-12 08:12:02 -07:00
parent 03fa0c63d3
commit 99761c5ab5
4 changed files with 47 additions and 18 deletions

View File

@@ -1484,23 +1484,6 @@ get_return_value (struct symbol *func_symbol, struct value *function)
return value;
}
/* The captured function return value/type and its position in the
value history. */
struct return_value_info
{
/* The captured return value. May be NULL if we weren't able to
retrieve it. See get_return_value. */
struct value *value;
/* The return type. In some cases, we'll not be able extract the
return value, but we always know the type. */
struct type *type;
/* If we captured a value, this is the value history index. */
int value_history_index;
};
/* Helper for print_return_value. */
static void