aboutsummaryrefslogtreecommitdiff
path: root/gdb/values.c
diff options
context:
space:
mode:
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-04-17 20:31:43 +0000
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>2003-04-17 20:31:43 +0000
commit514621a98101ad54ce242201b5aa450b6182b4bb (patch)
treefd2ad7e305ed76a791a998a18e7d547b8197327b /gdb/values.c
parentb4acd5590bed95e13a4b6b722208dca062fce37f (diff)
downloadbinutils-514621a98101ad54ce242201b5aa450b6182b4bb.zip
binutils-514621a98101ad54ce242201b5aa450b6182b4bb.tar.gz
binutils-514621a98101ad54ce242201b5aa450b6182b4bb.tar.bz2
2003-04-17 Elena Zannoni <ezannoni@redhat.com>
* values.c (value_being_returned): Don't fetch the return value if the return type is void.
Diffstat (limited to 'gdb/values.c')
-rw-r--r--gdb/values.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/values.c b/gdb/values.c
index 8b1d013..88c6a61 100644
--- a/gdb/values.c
+++ b/gdb/values.c
@@ -1240,7 +1240,9 @@ value_being_returned (struct type *valtype, struct regcache *retbuf,
val = allocate_value (valtype);
CHECK_TYPEDEF (valtype);
- EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
+ /* If the function returns void, don't bother fetching the return value. */
+ if (TYPE_CODE (valtype) != TYPE_CODE_VOID)
+ EXTRACT_RETURN_VALUE (valtype, retbuf, VALUE_CONTENTS_RAW (val));
return val;
}