summaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-11-19 16:27:56 +0000
committerAndrew Cagney <cagney@redhat.com>2003-11-19 16:27:56 +0000
commit2923da61c6d92ada2a09c553bc004ea0ef13e79a (patch)
tree1e4973218fdb389d02e59e55a4d6336905246ad8 /gdb/values.c
parent00fe194baccfcd63ce4b29824ed07864c8980f70 (diff)
downloadgdb-2923da61c6d92ada2a09c553bc004ea0ef13e79a.tar.gz
2003-11-19 Andrew Cagney <cagney@redhat.com>
* stack.c (return_command): Handle "void", "legacy" and "unknown location" return values separatly. * values.c (using_struct_return): Return 0 for a "void" return type. Mention "register_value_being_returned". (register_value_being_returned): Mention "using_struct_return".
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/values.c b/gdb/values.c
index a8d8480871a..386e3bfaebc 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1223,7 +1223,7 @@ register_value_being_returned (struct type *valtype, struct regcache *retbuf)
struct value *val = allocate_value (valtype);
/* If the function returns void, don't bother fetching the return
- value. */
+ value. See also "using_struct_return". */
if (TYPE_CODE (valtype) == TYPE_CODE_VOID)
return val;
@@ -1285,6 +1285,11 @@ using_struct_return (struct type *value_type, int gcc_p)
if (code == TYPE_CODE_ERROR)
error ("Function return type unknown.");
+ if (code == TYPE_CODE_VOID)
+ /* A void return value is never in memory. See also corresponding
+ code in "register_value_being_returned". */
+ return 0;
+
if (!gdbarch_return_value_p (current_gdbarch))
{
/* FIXME: cagney/2003-10-01: The below is dead. Instead an