This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/22968] New: ptype does not find inner C++ class type without -readnow


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

            Bug ID: 22968
           Summary: ptype does not find inner C++ class type without
                    -readnow
           Product: gdb
           Version: 8.0.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
          Assignee: unassigned at sourceware dot org
          Reporter: sbergman at redhat dot com
  Target Milestone: ---

At least with "GNU gdb (GDB) Fedora 8.0.1-36.fc27", when some inner C++ class
type Outer::Inner is sufficiently "hidden", ptype doesn't find it unless gdb is
invoked with -readnow:

> $ cat main.cc
> struct Outer { struct Inner; Inner * p; Outer(); };
> int main() {
>     Outer v;
> }
> 
> $ cat other.cc
> struct Outer { struct Inner; Inner * p; Outer(); };
> struct Outer::Inner {};
> Outer::Outer(): p(new Inner) {}
> 
> $ g++ -g main.cc other.cc
> $ gdb a.out
> GNU gdb (GDB) Fedora 8.0.1-36.fc27
[...]
> Reading symbols from a.out...done.
> (gdb) b main.cc:4
> Breakpoint 1 at 0x40054b: file /home/sbergman/TEST/main.cc, line 4.
> (gdb) r
> Starting program: /home/sbergman/TEST/a.out 
> 
> Breakpoint 1, main () at /home/sbergman/TEST/main.cc:4
> 4	}
> (gdb) ptype Outer::Inner
> There is no field named Inner
> (gdb) q
[...]
> $ gdb -readnow a.out
> GNU gdb (GDB) Fedora 8.0.1-36.fc27
[...]
> Reading symbols from a.out...expanding to full symbols...done.
> (gdb) b main.cc:4
> Breakpoint 1 at 0x40054b: file /home/sbergman/TEST/main.cc, line 4.
> (gdb) r
> Starting program: /home/sbergman/TEST/a.out 
> 
> Breakpoint 1, main () at /home/sbergman/TEST/main.cc:4
> 4	}
> (gdb) ptype Outer::Inner
> type = struct Outer::Inner {
>     <no data fields>
> }
> (gdb) 

Not sure whether this is the same issue as described in bug 19274.

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]