From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17038 invoked by alias); 5 Aug 2004 20:55:21 -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 17029 invoked from network); 5 Aug 2004 20:55:21 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 5 Aug 2004 20:55:21 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i75KtFe3024462 for ; Thu, 5 Aug 2004 16:55:21 -0400 Received: from localhost.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i75Kssa25282; Thu, 5 Aug 2004 16:54:54 -0400 Received: from gnu.org (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 6DF7D2B9D; Thu, 5 Aug 2004 16:54:47 -0400 (EDT) Message-ID: <41129E97.4030207@gnu.org> Date: Thu, 05 Aug 2004 20:55:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-GB; rv:1.4.1) Gecko/20040801 MIME-Version: 1.0 To: Jason Molenda Cc: gdb-patches@sources.redhat.com, Jim Blandy , Mark Kettenis , Eli Zaretskii , Devang Patel Subject: Re: RFA/patch stabs reader: Recognize language hint in SO stab References: <4F2AF76A-E71B-11D8-B4BD-000A9569836A@apple.com> <890A6444-E71C-11D8-B4BD-000A9569836A@apple.com> In-Reply-To: <890A6444-E71C-11D8-B4BD-000A9569836A@apple.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00141.txt.bz2 > I knew I forgot something: Testing. Can this be turned into a proper testcase? gdb.stabs/ I guess? The last thing we want is to accidently break this. Andrew > I tested the patch on an x86 Linux box with gcc 3.4.0 with -gstabs+; there was no change with or without the patch. The compiler wasn't setting the desc field in the SO stabs, of course, so I made a small C++ program > > #include > > int foo (int a); > int > main() > { > int a = 10; > std::cout << "hi there" << a << std::endl; > return foo (a); > } > > int foo (int a) > { > return a + 5; > } > > > called "a.c", and modified the stabs by hand to > > .file "a.c" > .stabs "/tmp/",100,0,0,.Ltext0 > .stabs "a.c",100,0,4,.Ltext0 > > The value 4 is N_SO_CC. Without this change, this is what gdb looks like: > > (gdb) b foo > Breakpoint 1 at 0x80488ed: file a.c, line 13. > (gdb) r > Starting program: /tmp/a.out > hi there10 > > Breakpoint 1, _Z3fooi (a=10) at a.c:14 > 14 return a + 5; > (gdb) > > > With this change, we get > > (gdb) b foo > Breakpoint 1 at 0x80488ed: file a.c, line 14. > (gdb) r > Starting program: /tmp/a.out > hi there10 > > Breakpoint 1, foo (a=10) at a.c:14 > 14 return a + 5; > Current language: auto; currently c++ > (gdb) > > > Huzzah. > > (obviously this is just an example of incorrect behavior -- when you're working with real C++ code the inability to detect the fact that it's a C++ program causes all sorts of problems.) > > J