aboutsummaryrefslogtreecommitdiff
path: root/gdb/infcmd.c
diff options
context:
space:
mode:
authorLancelot SIX <lancelot.six@amd.com>2022-02-02 06:34:12 -0500
committerLancelot SIX <lancelot.six@amd.com>2022-02-15 09:52:37 +0000
commite6b3636709a19303859cb886f5212d5092837b27 (patch)
treeb6e2d274a841110224a7c0753180185f635b0419 /gdb/infcmd.c
parent3c4c0a18c8f0af039e65458da5f53811e9e43754 (diff)
downloadgdb-e6b3636709a19303859cb886f5212d5092837b27.zip
gdb-e6b3636709a19303859cb886f5212d5092837b27.tar.gz
gdb-e6b3636709a19303859cb886f5212d5092837b27.tar.bz2
gdb: add a symbol* argument to get_return_value
Add an argument to the get_return_value function to indicate the symbol of the function the debuggee is returning from. This will be used by the following patch. Since the function return type can be deduced from the symbol remove the value_type argument which becomes redundant. No user visible change after this patch. Tested on x86_64-linux. Change-Id: Idf1279f1f7199f5022738a6679e0fa63fbd22edc Co-authored-by: Simon Marchi <simon.marchi@polymtl.ca>
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r--gdb/infcmd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 0e1cfcb..1dc4e36 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -1444,18 +1444,17 @@ advance_command (const char *arg, int from_tty)
until_break_command (arg, from_tty, 1);
}
-/* Return the value of the result of a function at the end of a 'finish'
- command/BP. DTOR_DATA (if not NULL) can represent inferior registers
- right after an inferior call has finished. */
+/* See inferior.h. */
struct value *
-get_return_value (struct value *function, struct type *value_type)
+get_return_value (struct symbol *func_symbol, struct value *function)
{
regcache *stop_regs = get_current_regcache ();
struct gdbarch *gdbarch = stop_regs->arch ();
struct value *value;
- value_type = check_typedef (value_type);
+ struct type *value_type
+ = check_typedef (TYPE_TARGET_TYPE (func_symbol->type ()));
gdb_assert (value_type->code () != TYPE_CODE_VOID);
/* FIXME: 2003-09-27: When returning from a nested inferior function
@@ -1616,7 +1615,7 @@ finish_command_fsm::should_stop (struct thread_info *tp)
struct value *func;
func = read_var_value (function, NULL, get_current_frame ());
- rv->value = get_return_value (func, rv->type);
+ rv->value = get_return_value (function, func);
if (rv->value != NULL)
rv->value_history_index = record_latest_value (rv->value);
}