public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11734] New: break c::bar() broken, can't find bar
@ 2010-06-21  6:59 dje at google dot com
  2010-06-21 20:38 ` [Bug c++/11734] " keiths at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dje at google dot com @ 2010-06-21  6:59 UTC (permalink / raw)
  To: gdb-prs

With the appended testcase, I get the following:

$ g++ --version
g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4)
[...]
$ g++ -g foo.cc foo2.cc
$ ./gdb -nx ./a.out
GNU gdb (GDB) 7.1.50.20100619-cvs
[...]
(gdb) start
[...]
(gdb) b 'c::foo()'
the class c does not have any method named foo()
Hint: try 'c::foo()<TAB> or 'c::foo()<ESC-?>
(Note leading single quote.)
Make breakpoint pending on future shared library load? (y or [n])

This is a regression from 7.1.

fyi, the following does work:

(gdb) b c::foo     # Do this first ...
(gdb) b c::foo()   # ... and then this works.

---
foo.h:

class c
{
 public:
  void foo ();
};
---
foo.cc:

#include "foo.h"

int
main ()
{
  c* p = new c;
  p->foo ();
  return 0;
}
---
foo2.cc:

#include "foo.h"

void
c::foo ()
{
}

-- 
           Summary: break c::bar() broken, can't find bar
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: dje at google dot com
                CC: gdb-prs at sourceware dot org
 GCC build triplet: amd64-linux
  GCC host triplet: amd64-linux
GCC target triplet: amd64-linux


http://sourceware.org/bugzilla/show_bug.cgi?id=11734

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/11734] break c::bar() broken, can't find bar
  2010-06-21  6:59 [Bug c++/11734] New: break c::bar() broken, can't find bar dje at google dot com
@ 2010-06-21 20:38 ` keiths at redhat dot com
  2010-06-21 21:01 ` keiths at redhat dot com
  2010-06-22  1:23 ` keiths at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: keiths at redhat dot com @ 2010-06-21 20:38 UTC (permalink / raw)
  To: gdb-prs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at sourceware dot|keiths at redhat dot com
                   |org                         |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1


http://sourceware.org/bugzilla/show_bug.cgi?id=11734

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/11734] break c::bar() broken, can't find bar
  2010-06-21  6:59 [Bug c++/11734] New: break c::bar() broken, can't find bar dje at google dot com
  2010-06-21 20:38 ` [Bug c++/11734] " keiths at redhat dot com
@ 2010-06-21 21:01 ` keiths at redhat dot com
  2010-06-22  1:23 ` keiths at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: keiths at redhat dot com @ 2010-06-21 21:01 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From keiths at redhat dot com  2010-06-21 21:00 -------
I've looked at this a bit, and here is what I've discovered.

This bug occurs as a result of the dwarf2_physname patch committed (by me)
several months ago. The problem is not really that dwarf2_physname is being
used, however. The problem is that this never really worked to begin with; it
just appeared to!

For the method "void c::foo()", partial_die_full_name will store the name
"c::foo" into the partial symbol. When the dwarf information for class "c" is
expanded (since gdb will first look for the symtab for "c" so that it can search
for the method "foo()"), it calls dwarf2_physname to build the physname of the
method. This is "c::foo()" (=TYPE_FN_FIELD_PHYSNAME).

Now we look for "c::foo()". gdb searches through the list of partial symbols.
But since partial_die_full_name has stored "c::foo", the psymtab search fails.
[This behavior is in all versions of gdb.]

gdb tries to fallback to comparing the linkage name (after demangling it), and
since gdb 7.1, we no longer store/use linkage names (from
DW_AT_MIPS_linkage_name) for C++/Java, this fallback search also fails, and the
symbol is now no longer found.

If you manage to expand the psymtab before searching, then the search of the
symtabs will successfully find "c::foo()", since that is exactly the name that
is stored in the full symbol (from dwarf2_physname).

I am investigating solutions now. I hope to have a patch for this shortly.

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11734

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

* [Bug c++/11734] break c::bar() broken, can't find bar
  2010-06-21  6:59 [Bug c++/11734] New: break c::bar() broken, can't find bar dje at google dot com
  2010-06-21 20:38 ` [Bug c++/11734] " keiths at redhat dot com
  2010-06-21 21:01 ` keiths at redhat dot com
@ 2010-06-22  1:23 ` keiths at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: keiths at redhat dot com @ 2010-06-22  1:23 UTC (permalink / raw)
  To: gdb-prs


------- Additional Comments From keiths at redhat dot com  2010-06-22 01:23 -------
Patch submitted (http://sourceware.org/ml/gdb-patches/2010-06/msg00467.html)

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=11734

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-06-22  1:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-21  6:59 [Bug c++/11734] New: break c::bar() broken, can't find bar dje at google dot com
2010-06-21 20:38 ` [Bug c++/11734] " keiths at redhat dot com
2010-06-21 21:01 ` keiths at redhat dot com
2010-06-22  1:23 ` keiths at redhat dot com

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).