From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13723 invoked by alias); 25 Mar 2011 17:12:58 -0000 Received: (qmail 13712 invoked by uid 22791); 25 Mar 2011 17:12:57 -0000 X-SWARE-Spam-Status: No, hits=-6.1 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Mar 2011 17:12:53 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2PHCpkr032276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 25 Mar 2011 13:12:51 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p2PHCoif019083; Fri, 25 Mar 2011 13:12:50 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p2PHCnC6008770; Fri, 25 Mar 2011 13:12:50 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 304CC378D0A; Fri, 25 Mar 2011 11:12:48 -0600 (MDT) From: Tom Tromey To: Jan Kratochvil Cc: Eli Zaretskii , gdb-patches@sourceware.org Subject: Re: Regression: Re: [3/3] RFC: `function:label' linespecs References: <8362rgrzwn.fsf@gnu.org> <20110325094920.GA9101@host1.jankratochvil.net> Date: Fri, 25 Mar 2011 19:29:00 -0000 In-Reply-To: (Tom Tromey's message of "Fri, 25 Mar 2011 10:19:28 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: 2011-03/txt/msg01103.txt.bz2 Tom> Sorry about that. I am working on a fix. Here is what I am checking in. This restores some old code that was exercised by this particular test case. Built and regtested on x86-64 (compile farm). I also ran the failing case locally by hand. Tom 2011-03-25 Tom Tromey * linespec.c (symbol_found): Restore line-based result for non-LOC_LABEL symbols. Index: linespec.c =================================================================== RCS file: /cvs/src/src/gdb/linespec.c,v retrieving revision 1.116 diff -u -r1.116 linespec.c --- linespec.c 24 Mar 2011 20:25:14 -0000 1.116 +++ linespec.c 25 Mar 2011 17:11:20 -0000 @@ -2174,9 +2174,7 @@ } else { - if (funfirstline && SYMBOL_CLASS (sym) != LOC_LABEL) - error (_("\"%s\" is not a function"), copy); - else if (SYMBOL_VALUE_ADDRESS (sym) != 0) + if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0) { /* We know its line number. */ values.sals = (struct symtab_and_line *) @@ -2201,6 +2199,20 @@ return values; } + else if (funfirstline) + error (_("\"%s\" is not a function"), copy); + else if (SYMBOL_LINE (sym) != 0) + { + /* We know its line number. */ + values.sals = (struct symtab_and_line *) + xmalloc (sizeof (struct symtab_and_line)); + values.nelts = 1; + memset (&values.sals[0], 0, sizeof (values.sals[0])); + values.sals[0].symtab = SYMBOL_SYMTAB (sym); + values.sals[0].line = SYMBOL_LINE (sym); + values.sals[0].pspace = SYMTAB_PSPACE (SYMBOL_SYMTAB (sym)); + return values; + } else /* This can happen if it is compiled with a compiler which doesn't put out line numbers for variables. */