OSDN Git Service

2003-04-17 Elena Zannoni <ezannoni@redhat.com>
authorElena Zannoni <ezannoni@kwikemart.cygnus.com>
Thu, 17 Apr 2003 20:31:43 +0000 (20:31 +0000)
committerElena Zannoni <ezannoni@kwikemart.cygnus.com>
Thu, 17 Apr 2003 20:31:43 +0000 (20:31 +0000)
* values.c (value_being_returned): Don't fetch the return
        value if the return type is void.

gdb/ChangeLog
gdb/values.c

index f66137b..08cbb63 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2003-04-17  Jeff Johnston  <jjohnstn@redhat.com>
 
        * thread-db.c: Reindented.
index 8b1d013..88c6a61 100644 (file)
@@ -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;
 }