Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Andrew Cagney <ac131313@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch/rfc] Better handle "void f()" et.al. returns
Date: Wed, 19 Nov 2003 16:27:00 -0000	[thread overview]
Message-ID: <3FBB99DE.8010605@redhat.com> (raw)
In-Reply-To: <3FB934A8.2030009@redhat.com>

> Hello,
> 
> It turns out that how return values for a void function was handled was largely pot-luck.  PPC, for instance, treated it as "in register" while PPC64 treated it as "in memory".  Dependant on the choice (e.g., the latter), the mysterious message:
> 
>     (gdb) print foo()
>     Attempt to dereference a generic pointer.
>     (gdb)
> 
> would appear.  This patch cleans up the "return" (and "finish") code so that it better handles the edge cases:
> 
>     - function returning void
>     - function returning struct (old gdb architecture)
>     - function using struct convention
> 
> and at the same time prints more informative messages vis:
> 
> (gdb) return foo16
> The location at which to store the function's return value is unknown.
> If you continue, the return value that you specified will be ignored.
> Make fun16 return now? (y or n)
> 
> or
> 
> (gdb) return foo16
> A structure or union return type is not supported by this architecture.
> If you continue, the return value that you specified will be ignored.

I've checked this in.

Andrew


> 2003-11-17  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".
> 



      reply	other threads:[~2003-11-19 16:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-17 20:50 Andrew Cagney
2003-11-19 16:27 ` Andrew Cagney [this message]

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=3FBB99DE.8010605@redhat.com \
    --to=ac131313@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