From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17775 invoked by alias); 7 Feb 2002 19:01:48 -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 17664 invoked from network); 7 Feb 2002 19:01:46 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 7 Feb 2002 19:01:46 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 74A7E5E9DE; Thu, 7 Feb 2002 14:03:21 -0500 (EST) To: Andrew Cagney Cc: Daniel Jacobowitz , gdb-patches@sources.redhat.com, Jason Merrill Subject: Re: RFA: MI tests: tolerate prototypes References: <20020203210609.E5E035E9DE@zwingli.cygnus.com> <20020203180133.C26302@nevyn.them.org> <20020205202132.A17384@nevyn.them.org> <20020206004829.A1357@nevyn.them.org> <3C61C6EB.5060908@cygnus.com> From: Jim Blandy Date: Thu, 07 Feb 2002 11:01:00 -0000 In-Reply-To: <3C61C6EB.5060908@cygnus.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00193.txt.bz2 > Jim, my preference here is more along your proposal - have an explicit > ``prototype-unknown'' state. > > From memory the last time this came up I also suggested here that > changing the default behavour across GDB is probably a good thing. I > don't think this is something that individual targets should be > deciding. Instead GDB should exibit consistent behavour across > host/target combinations, the decision being made on the basis of the > debug info. Well, I wouldn't call it target-specific. The compromise we're making is more like this: GCC's STABS describe prototyped function types as if they were non-prototyped function types. However, it does provide accurate pass-as types for function definitions. This means that GDB can correctly call functions under STABS if it reads function definition types *as if* they were prototyped, using the pass-as types as the argument types. The downsides of this proposal: - GDB will print function argument types incorrectly. For example, suppose we have the following function definition: int f (short s, float f) { return s + f; } Since the arguments' pass-as types for `s' and `f' are `int' and `double', GDB will print f's type as `int f(int, double)'. This is weird, but it's a direct consequence of lying about the type. - Since GCC still doesn't really emit function types accurately, we won't always be able to correctly call pointed-to functions. But this is true now, and the `maybe-prototyped' change wouldn't fix this either.