public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15008] New: Lookup of base types with virtual functions is broken
@ 2013-01-10 13:20 andre.poenitz at digia dot com
  2013-01-10 14:52 ` [Bug c++/15008] " tromey at redhat dot com
  2013-10-31 19:40 ` tromey at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: andre.poenitz at digia dot com @ 2013-01-10 13:20 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 15008
           Summary: Lookup of base types with virtual functions is broken
           Product: gdb
           Version: 7.5
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: andre.poenitz@digia.com
    Classification: Unclassified


In the following code I would expect 'ptype A' to find A, no matter whether foo
is declared virtual or not"


    struct A { };
    struct B : A { };
    struct C : B { virtual void foo() { } };

    struct D : C
    {
        void foo()
        {
            // Break here.
            // (gdb) ptype A
            // -> Type D has no component named A.
            A *b = 0;
        }

        void bar()
        {
            // Break here.
            // (gdb) ptype A
            // -> Type D has no component named A.
            A *b = 0;
        }
    };

    int main()
    {
        // Break here.
        // (gdb) ptype A
        // -> type = struct A { ... }
        D d;
        d.foo();
        d.bar();
    }


    // Note: If the 'virtual' is removed from C::foo(),
    // ptype A works in both D::foo() and D::bar()

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug c++/15008] Lookup of base types with virtual functions is broken
  2013-01-10 13:20 [Bug c++/15008] New: Lookup of base types with virtual functions is broken andre.poenitz at digia dot com
@ 2013-01-10 14:52 ` tromey at redhat dot com
  2013-10-31 19:40 ` tromey at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at redhat dot com @ 2013-01-10 14:52 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING
                 CC|                            |tromey at redhat dot com

--- Comment #1 from Tom Tromey <tromey at redhat dot com> 2013-01-10 14:52:40 UTC ---
I tried this with today's git master using the Fedora 16 gcc.
It worked fine:

Breakpoint 3, main () at pr.cc:29
29            D d;
(gdb) ptype A
type = struct A {
}
(gdb) c
Continuing.

Breakpoint 1, D::foo (this=0x7fffffffe400) at pr.cc:12
12                A *b = 0;
(gdb) ptype A
type = struct A {
}
(gdb) c
Continuing.

Breakpoint 2, D::bar (this=0x7fffffffe400) at pr.cc:20
20                A *b = 0;
(gdb) ptype A
type = struct A {
}

I also tried 7.5, and it did fail there.

Could you try a newer gdb?
I wonder if this is PR 8888.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug c++/15008] Lookup of base types with virtual functions is broken
  2013-01-10 13:20 [Bug c++/15008] New: Lookup of base types with virtual functions is broken andre.poenitz at digia dot com
  2013-01-10 14:52 ` [Bug c++/15008] " tromey at redhat dot com
@ 2013-10-31 19:40 ` tromey at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: tromey at redhat dot com @ 2013-10-31 19:40 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=15008

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |7.6

--- Comment #2 from Tom Tromey <tromey at redhat dot com> ---
I think it was fixed in 7.6.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

end of thread, other threads:[~2013-10-31 19:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-10 13:20 [Bug c++/15008] New: Lookup of base types with virtual functions is broken andre.poenitz at digia dot com
2013-01-10 14:52 ` [Bug c++/15008] " tromey at redhat dot com
2013-10-31 19:40 ` tromey 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).