From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29412 invoked by alias); 11 Mar 2009 16:30:40 -0000 Received: (qmail 29400 invoked by uid 22791); 11 Mar 2009 16:30:36 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 11 Mar 2009 16:30:30 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 0C3FB2C0B61; Wed, 11 Mar 2009 12:30:28 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id yqv0PnvIXMLa; Wed, 11 Mar 2009 12:30:27 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id A13322C0B5C; Wed, 11 Mar 2009 12:30:27 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 52246F5C8D; Wed, 11 Mar 2009 09:30:24 -0700 (PDT) Date: Wed, 11 Mar 2009 16:49:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: jan.kratochvil@redhat.com, tromey@redhat.com, drow@false.org, gdb-patches@sourceware.org Subject: Re: [patch] Fix `return' of long/long-long results with no debuginfo Message-ID: <20090311163024.GA25708@adacore.com> References: <20090211214646.GA22247@host0.dyn.jankratochvil.net> <200902112157.n1BLvplk011339@brahms.sibelius.xs4all.nl> <20090211220824.GA26040@host0.dyn.jankratochvil.net> <200902112237.n1BMbbOb006035@brahms.sibelius.xs4all.nl> <20090211225012.GA28683@host0.dyn.jankratochvil.net> <200903042129.n24LTUKa000770@brahms.sibelius.xs4all.nl> <20090309015510.GA28986@host0.dyn.jankratochvil.net> <200903092233.n29MXEfG019900@brahms.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200903092233.n29MXEfG019900@brahms.sibelius.xs4all.nl> User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-03/txt/msg00154.txt.bz2 > 2009-03-09 Jan Kratochvil > > * stack.c (return_command ): New variables retval_expr > and old_chain. Inline parse_and_eval to initialize retval_expr. Check > RETVAL_EXPR for UNOP_CAST and set RETURN_TYPE to the RETURN_VALUE type > if RETURN_TYPE is NULL. This looks good to me, but I don't understand the error message when the user forgot to cast the result. I wonder if we shouldn't just preserve the old behavior which is to implicitly cast to "int"? > > if (return_type == NULL) > > - return_type = builtin_type (get_frame_arch (thisframe))->builtin_int; > > + { > > + if (retval_expr->elts[0].opcode != UNOP_CAST) > > + error (_("Selected stack frame (with no associated function) " > > + "requires an explicit cast of the value to return")); > > + return_type = value_type (return_value); > > + } -- Joel