public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Regression handling linkage vs source name
@ 2012-02-22  0:41 Michael Eager
  2012-02-22 16:40 ` Doug Evans
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Eager @ 2012-02-22  0:41 UTC (permalink / raw)
  To: gdb; +Cc: Jan Kratochvil

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-23  3:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-22  0:41 Regression handling linkage vs source name Michael Eager
2012-02-22 16:40 ` Doug Evans
2012-02-22 19:27   ` Michael Eager
2012-02-23  3:08     ` Doug Evans

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).