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++/13269] New: gdb.lookup_type of print of a type fails withanonymous namespaces


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

             Bug #: 13269
           Summary: gdb.lookup_type of print of a type fails with
                    anonymous namespaces
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned@sourceware.org
        ReportedBy: fawzi@gmx.ch
    Classification: Unclassified


print of a types describes anonymous namespaces with <unnamed> whereas
lookup.type needs (anonymous namespace).

This is related with the fix done in 7933 .

example:
-------------------
#include <map>

namespace { struct S { int a; S(): a(42) {} }; }

int main()
{
  std::map<int, S> h;
  S s;
  h[1] = s;
  return s.a;
}
----------------------
python print gdb.parse_and_eval("h").type reports

std::map<int, <unnamed>::S, std::less<int>, std::allocator<std::pair<const int,
<unnamed>::S> > >

The '<unnamed>::S' cannot fed into  gdb.lookup_type, whereas 
gdb.lookup_type('(anonymous namespace)::S') works.

gcc 4.4.5, gdb 7.2 and current git 

incidentally, python print gdb.parse_and_eval("h").type.template_argument(0)
seems to break with   RuntimeError: syntax error, near `<unnamed>::S,
std::less<int>, std::al' it is really cut off at std::al (but that might be
simply because it just prints x char of context, if that is the case a colon
would make it clearer).

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


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