From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12517 invoked by alias); 19 Nov 2003 16:27:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12465 invoked from network); 19 Nov 2003 16:27:14 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 19 Nov 2003 16:27:14 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id F3B762B8F for ; Wed, 19 Nov 2003 11:27:10 -0500 (EST) Message-ID: <3FBB99DE.8010605@redhat.com> Date: Wed, 19 Nov 2003 16:27:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030820 X-Accept-Language: en-us, en MIME-Version: 1.0 To: gdb-patches@sources.redhat.com Subject: Re: [patch/rfc] Better handle "void f()" et.al. returns References: <3FB934A8.2030009@redhat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-11/txt/msg00394.txt.bz2 > 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 > > * 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". >