Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Elena Zannoni <ezannoni@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFA] values.c: don't fetch func void return value
Date: Wed, 16 Apr 2003 22:06:00 -0000	[thread overview]
Message-ID: <16029.54499.392215.696866@localhost.redhat.com> (raw)


While debugging the x86-64 I noticed that there were problems because
gdb was trying to extract a void return value from a function.  It
already has set up the value structure with all the correct fields, it
seems a waste to go and ask the target for a value if we know there
isn't one.

No regressions on x86.

2003-04-16  Elena Zannoni  <ezannoni@redhat.com>

	* values.c (value_being_returned): Don't fetch the return
        value if the return type is void.

Index: values.c
===================================================================
RCS file: /cvs/uberbaum/gdb/values.c,v
retrieving revision 1.47
diff -u -p -r1.47 values.c
--- values.c	20 Feb 2003 00:01:07 -0000	1.47
+++ values.c	16 Apr 2003 21:29:19 -0000
@@ -1240,7 +1240,9 @@ value_being_returned (struct type *valty
 
   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;
 }


             reply	other threads:[~2003-04-16 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-16 22:06 Elena Zannoni [this message]
2003-04-17 17:44 ` Michael Snyder
2003-04-17 20:36   ` Elena Zannoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16029.54499.392215.696866@localhost.redhat.com \
    --to=ezannoni@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox