From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: RFA: GCC stabs don't contain prototype info Date: Mon, 26 Nov 2001 19:47:00 -0000 Message-id: <20011126224801.A2633@nevyn.them.org> References: <20011127034423.DF2B75E9D8@zwingli.cygnus.com> X-SW-Source: 2001-11/msg00475.html On Mon, Nov 26, 2001 at 10:44:23PM -0500, Jim Blandy wrote: > > This comes as a bit of a surprise to me, but it seems that stabs > generated by GCC don't indicate whether a given function was defined > with a prototype or not. The argument types should appear after the > return types, each preceded by a semicolon, but for the following > input program: > > int foo (int a, float b) { return a + b; } > > `gcc -save-temps -O2 -g -c' generates the following relevant stabs: > > .stabs "int:t(0,1)=r(0,1);0020000000000;0017777777777;",128,0,0,0 > .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 > .stabs "foo:F(0,1)",36,0,1,foo > .stabs "a:P(0,1)",64,0,1,8 > .stabs "b:P(0,12)",64,0,1,9 > .stabs "",36,0,0,.LLscope0-foo > .stabs "",100,0,0,.Letext > > There is no no prototype info here. There's no way for GDB to know > that the function expects its second argument to be passed as a float, > not promoted to a double, as the K&R-style rules specify. Is there a standard stabs convention for this? If so, it would be a good idea to make development GCC emit it. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4221 invoked by alias); 27 Nov 2001 03:47:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 3787 invoked from network); 27 Nov 2001 03:47:44 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by hostedprojects.ges.redhat.com with SMTP; 27 Nov 2001 03:47:44 -0000 Received: from drow by nevyn.them.org with local (Exim 3.32 #1 (Debian)) id 168ZE1-0000h4-00 for ; Mon, 26 Nov 2001 22:48:01 -0500 Date: Tue, 13 Nov 2001 11:07:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: RFA: GCC stabs don't contain prototype info Message-ID: <20011126224801.A2633@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <20011127034423.DF2B75E9D8@zwingli.cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011127034423.DF2B75E9D8@zwingli.cygnus.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2001-11/txt/msg00260.txt.bz2 Message-ID: <20011113110700.ZhWnsYbVEqGaSYntQb2SCZar87GIIRoZvvlRd-BGxEE@z> On Mon, Nov 26, 2001 at 10:44:23PM -0500, Jim Blandy wrote: > > This comes as a bit of a surprise to me, but it seems that stabs > generated by GCC don't indicate whether a given function was defined > with a prototype or not. The argument types should appear after the > return types, each preceded by a semicolon, but for the following > input program: > > int foo (int a, float b) { return a + b; } > > `gcc -save-temps -O2 -g -c' generates the following relevant stabs: > > .stabs "int:t(0,1)=r(0,1);0020000000000;0017777777777;",128,0,0,0 > .stabs "float:t(0,12)=r(0,1);4;0;",128,0,0,0 > .stabs "foo:F(0,1)",36,0,1,foo > .stabs "a:P(0,1)",64,0,1,8 > .stabs "b:P(0,12)",64,0,1,9 > .stabs "",36,0,0,.LLscope0-foo > .stabs "",100,0,0,.Letext > > There is no no prototype info here. There's no way for GDB to know > that the function expects its second argument to be passed as a float, > not promoted to a double, as the K&R-style rules specify. Is there a standard stabs convention for this? If so, it would be a good idea to make development GCC emit it. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer