[patch/rfc] Better handle "void f()" et.al. returns

Andrew Cagney ac131313@redhat.com
Mon Nov 17 20:50:00 GMT 2003


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.

Baring comments, I'll commit this in a day or so,
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20031117/e6c6545c/attachment.ksh>


More information about the Gdb-patches mailing list