public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13269] New: gdb.lookup_type of print of a type fails with anonymous namespaces
@ 2011-10-06 15:51 fawzi at gmx dot ch
  2012-11-06 16:33 ` [Bug c++/13269] " jens.elmenthaler at advantest dot com
  2012-11-07  8:16 ` jens.elmenthaler at advantest dot com
  0 siblings, 2 replies; 3+ messages in thread
From: fawzi at gmx dot ch @ 2011-10-06 15:51 UTC (permalink / raw)
  To: gdb-prs

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.


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

* [Bug c++/13269] gdb.lookup_type of print of a type fails with anonymous namespaces
  2011-10-06 15:51 [Bug c++/13269] New: gdb.lookup_type of print of a type fails with anonymous namespaces fawzi at gmx dot ch
@ 2012-11-06 16:33 ` jens.elmenthaler at advantest dot com
  2012-11-07  8:16 ` jens.elmenthaler at advantest dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jens.elmenthaler at advantest dot com @ 2012-11-06 16:33 UTC (permalink / raw)
  To: gdb-prs

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

Jens Elmenthaler <jens.elmenthaler at advantest dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jens.elmenthaler at
                   |                            |advantest dot com

-- 
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++/13269] gdb.lookup_type of print of a type fails with anonymous namespaces
  2011-10-06 15:51 [Bug c++/13269] New: gdb.lookup_type of print of a type fails with anonymous namespaces fawzi at gmx dot ch
  2012-11-06 16:33 ` [Bug c++/13269] " jens.elmenthaler at advantest dot com
@ 2012-11-07  8:16 ` jens.elmenthaler at advantest dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jens.elmenthaler at advantest dot com @ 2012-11-07  8:16 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Jens Elmenthaler <jens.elmenthaler at advantest dot com> 2012-11-07 08:16:49 UTC ---
Created attachment 6723
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6723
That fixed it for me

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

end of thread, other threads:[~2012-11-07  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-06 15:51 [Bug c++/13269] New: gdb.lookup_type of print of a type fails with anonymous namespaces fawzi at gmx dot ch
2012-11-06 16:33 ` [Bug c++/13269] " jens.elmenthaler at advantest dot com
2012-11-07  8:16 ` jens.elmenthaler at advantest 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).