From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12933 invoked by alias); 22 Feb 2012 00:41:38 -0000 Received: (qmail 12921 invoked by uid 22791); 22 Feb 2012 00:41:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from shell4.bayarea.net (HELO shell4.bayarea.net) (209.128.82.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Feb 2012 00:41:24 +0000 Received: (qmail 24559 invoked from network); 21 Feb 2012 16:41:23 -0800 Received: from c-76-102-3-160.hsd1.ca.comcast.net (HELO redwood.eagercon.com) (76.102.3.160) by shell4.bayarea.net with SMTP; 21 Feb 2012 16:41:23 -0800 Message-ID: <4F4439B2.70101@eagercon.com> Date: Wed, 22 Feb 2012 00:41:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20120131 Thunderbird/10.0 MIME-Version: 1.0 To: gdb@sourceware.org CC: Jan Kratochvil Subject: Regression handling linkage vs source name Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-02/txt/msg00058.txt.bz2 There were changes to dwarf2_physname() around July 1, 2011, which cause it to return a different value. Arguably, the changes make the function work better, returning the linkage name for a symbol where it previously returned the source name. But since the source name is overwritten by the linkage name in the symbol entry, gdb's behavior is different, and, IMO, incorrect. Here is the test case: $ cat t.c extern int foo(void) asm ("xfoo"); int foo(void) {} int main (void) { foo (); } $ gdb-before a.out ... (gdb) b foo Breakpoint 1 at ... $ gdb-after a.out ... (gdb) b foo Make breakpoint pending on future shared library load? (y or [n])? n (gdb) b xfoo Breakpoint 1 at ... The symbol "foo" is no longer present in gdb symbol table so trying to use the name specified in the source fails. Before the change, breakpoint, backtrace, and other commands display the symbol name as in the source (and in the DWARF DIE). After the change, the linkage name is displayed instead of the source name. Before the change, dwarf2_physname() calls dwarf2_compute_name() which returns the symbol name if the language is not C++, Java, or Fortran, even if the DIE has a DW_AT_linkage_name attribute. After the change, dwarf2_physname() returns the DW_AT_linkage_name. Since gdb doesn't keep both the source name and the linkage name in the symbol table (a design flaw, IMO) what is the right way to get the previous behavior, where gdb recognizes the symbol names from the source file? -- Michael Eager eager@eagercon.com 1960 Park Blvd., Palo Alto, CA 94306 650-325-8077