public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace
@ 2011-12-21 11:53 pluto at agmk dot net
  2011-12-21 12:21 ` [Bug libstdc++/51649] " pluto at agmk dot net
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pluto at agmk dot net @ 2011-12-21 11:53 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

             Bug #: 51649
           Summary: pretty printers don't handle std::__7:: namespace
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: pluto@agmk.net


the libstdc++ pretty printers don't work for gcc configured
with --enable-symvers=gnu-versioned-namespace.

e.g. it prints std::string as:

(gdb) p s
$1 = {
  static npos = 18446744073709551615,
  _M_dataplus = {
    <std::__7::allocator<char>> = {
      <__gnu_cxx::__7::__mt_alloc<char,
__gnu_cxx::__7::__common_pool_policy<__gnu_cxx::__7::__pool, true> >> = {
        <__gnu_cxx::__7::__mt_alloc_base<char>> = {<No data fields>}, <No data
fields>}, <No data fields>},
    members of std::__7::basic_string<char, std::__7::char_traits<char>,
std::__7::allocator<char> >::_Alloc_hider:
    _M_p = 0x4d7220 "foo bar"
  }
}


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
@ 2011-12-21 12:21 ` pluto at agmk dot net
  2011-12-21 16:21 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pluto at agmk dot net @ 2011-12-21 12:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #1 from Pawel Sikora <pluto at agmk dot net> 2011-12-21 11:53:23 UTC ---
adding '(__7::)?' to regex patterns should be ok.


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
  2011-12-21 12:21 ` [Bug libstdc++/51649] " pluto at agmk dot net
@ 2011-12-21 16:21 ` redi at gcc dot gnu.org
  2011-12-21 17:52 ` redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2011-12-21 16:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-21 16:20:15 UTC ---
It might be better to provide a separate python/libstdcxx/v7/printers.py file
and install that when configured with versioned namespaces.


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
  2011-12-21 12:21 ` [Bug libstdc++/51649] " pluto at agmk dot net
  2011-12-21 16:21 ` redi at gcc dot gnu.org
@ 2011-12-21 17:52 ` redi at gcc dot gnu.org
  2011-12-21 18:36 ` tromey at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2011-12-21 17:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu.org

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-21 17:26:36 UTC ---
Tom, I assume the plan for the libstdc++ python printers is to have a
python/libstdcxx/v7/printers.py for the libstdc++.so.7 library, right?

As we have that version today when using versioned namespaces (see PR 48698) do
you think we should have that v7 file today?  Or while the only difference
between v6 and v7 is the nested inline namespace do you think just adding
(__7::)? to the regexes for the v6 printers is better (at least for now)?


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (2 preceding siblings ...)
  2011-12-21 17:52 ` redi at gcc dot gnu.org
@ 2011-12-21 18:36 ` tromey at gcc dot gnu.org
  2012-01-17 16:22 ` pluto at agmk dot net
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at gcc dot gnu.org @ 2011-12-21 18:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #4 from Tom Tromey <tromey at gcc dot gnu.org> 2011-12-21 18:34:47 UTC ---
(In reply to comment #3)
> Tom, I assume the plan for the libstdc++ python printers is to have a
> python/libstdcxx/v7/printers.py for the libstdc++.so.7 library, right?
> 
> As we have that version today when using versioned namespaces (see PR 48698) do
> you think we should have that v7 file today?  Or while the only difference
> between v6 and v7 is the nested inline namespace do you think just adding
> (__7::)? to the regexes for the v6 printers is better (at least for now)?

I didn't know about --enable-symvers=gnu.

The reason I put things into a v6 namespace is just to give us options
for the future.  If a v7 libstdc++ is different enough to need different
printers, this approach would let us do that -- while also letting us
have gdb sessions where different inferiors use different versions of
libstdc++.

The two sets of printers can still share code.  For example, we could move
most of the code to libstdcxx/printers.py and have the v6 and v7 variants
import that.

I am not sure what the best approach is for the current situation.
What is the purpose of --enable-symvers=gnu?  How different is the v7 library?
Are there other possible configurations (configure- or user-compile-time)
that affect printers that we haven't already accounted for?


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (3 preceding siblings ...)
  2011-12-21 18:36 ` tromey at gcc dot gnu.org
@ 2012-01-17 16:22 ` pluto at agmk dot net
  2012-01-17 18:44 ` redi at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pluto at agmk dot net @ 2012-01-17 16:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #5 from Pawel Sikora <pluto at agmk dot net> 2012-01-17 16:06:01 UTC ---
(In reply to comment #3)
> Tom, I assume the plan for the libstdc++ python printers is to have a
> python/libstdcxx/v7/printers.py for the libstdc++.so.7 library, right?
> 
> As we have that version today when using versioned namespaces (see PR 48698) do
> you think we should have that v7 file today?  Or while the only difference
> between v6 and v7 is the nested inline namespace do you think just adding
> (__7::)? to the regexes for the v6 printers is better (at least for now)?

i've another issue vith v7 and c++0x - std::list

(gdb) p l
$1 = std::__debug::list
Traceback (most recent call last):
  File "/usr/share/python2.7/site-packages/libstdcxx/v6/printers.py", line 78,
in children
RuntimeError: No type named
std::__norm::_List_node<std::__7::basic_string<char,
std::__7::char_traits<char>, std::__7::allocator<char> >>.

afaics there's __cxx1998 namespace in action not handled by pretty printers.


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (4 preceding siblings ...)
  2012-01-17 16:22 ` pluto at agmk dot net
@ 2012-01-17 18:44 ` redi at gcc dot gnu.org
  2012-01-19 22:23 ` tromey at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2012-01-17 18:44 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-01-17
     Ever Confirmed|0                           |1

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-17 17:32:04 UTC ---
(In reply to comment #4)
> I didn't know about --enable-symvers=gnu.

--enable-symvers=gnu is the default configuration (on GNU/Linux)

--enable-symvers=gnu-versioned-namespace is the alternative, which puts
std::foo in an inline namespace so it mangles as std::__7::foo but can be used
as std::foo.

> The two sets of printers can still share code.  For example, we could move
> most of the code to libstdcxx/printers.py and have the v6 and v7 variants
> import that.

OK, that sounds like the best option for now.

> I am not sure what the best approach is for the current situation.
> What is the purpose of --enable-symvers=gnu?

In a future lib version we can preserve backwards compatibility for
std::__7::foo by keeping symbol that in the .so, but add an incompatible
std::__8::foo which is the default when users say std::foo.

>  How different is the v7 library?

Currently not at all, IIRC.

> Are there other possible configurations (configure- or user-compile-time)
> that affect printers that we haven't already accounted for?

Not that I can think of.

(In reply to comment #5)
> i've another issue vith v7 and c++0x - std::list

That appears to be just v7 and -D_GLIBCXX_DEBUG, unrelated to c++0x


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (5 preceding siblings ...)
  2012-01-17 18:44 ` redi at gcc dot gnu.org
@ 2012-01-19 22:23 ` tromey at gcc dot gnu.org
  2012-01-20 19:03 ` tromey at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at gcc dot gnu.org @ 2012-01-19 22:23 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #7 from Tom Tromey <tromey at gcc dot gnu.org> 2012-01-19 21:59:07 UTC ---
Based on my first build of a --enable-symvers=gnu-versioned-namespace
compiler, I am thinking that just updating the regexps is ok.
There's no particular need to introduce the full v7 python module yet.
I'm looking at the other problems here as well.


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (6 preceding siblings ...)
  2012-01-19 22:23 ` tromey at gcc dot gnu.org
@ 2012-01-20 19:03 ` tromey at gcc dot gnu.org
  2012-01-30 17:22 ` tromey at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at gcc dot gnu.org @ 2012-01-20 19:03 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

Tom Tromey <tromey at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot       |tromey at redhat dot com
                   |gnu.org                     |

--- Comment #8 from Tom Tromey <tromey at gcc dot gnu.org> 2012-01-20 18:39:27 UTC ---
Testing a patch.


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (7 preceding siblings ...)
  2012-01-20 19:03 ` tromey at gcc dot gnu.org
@ 2012-01-30 17:22 ` tromey at gcc dot gnu.org
  2012-02-04 11:26 ` pluto at agmk dot net
  2012-03-22 22:20 ` pluto at agmk dot net
  10 siblings, 0 replies; 12+ messages in thread
From: tromey at gcc dot gnu.org @ 2012-01-30 17:22 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #9 from Tom Tromey <tromey at gcc dot gnu.org> 2012-01-30 16:25:25 UTC ---
Author: tromey
Date: Mon Jan 30 16:25:11 2012
New Revision: 183732

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183732
Log:
    PR libstdc++/51649:
    * testsuite/libstdc++-prettyprinters/debug.cc: New file.
    * testsuite/lib/gdb-test.exp (regexp-test): New proc.
    (note-test): Update.
    (gdb-test): Handle regexp tests.  Add some logging.
    * testsuite/libstdc++-prettyprinters/simple.cc: Compile with -O0.
    (placeholder, use): Remove.
    (main): Add tests for deque, list, map, and set iterators.  Add
    tests for slist and slist iterator.
    * testsuite/libstdc++-prettyprinters/48362.cc (main): Handle __7
    namespace.
    * python/libstdcxx/v6/printers.py (StdListPrinter.children): Use
    the type's _Node typedef.
    (StdListIteratorPrinter.to_string): Change how node type is
    computed.
    (StdSlistPrinter.children): Use the type's _Node typedef.
    (StdSlistIteratorPrinter.to_string): Likewise.
    (StdRbtreeIteratorPrinter.to_string): Use the type's _Link_type
    typedef.
    (StdMapPrinter.children): Change how the node's type is computed.
    (StdSetPrinter.children): Likewise.
    (StdForwardListPrinter.children): Use the type's _Node typedef.
    (Printer.add_version): New method.
    (Printer.add_container): New method.
    (build_libstdcxx_dictionary): Handle __7 and __cxx1998
    namespaces.
    (find_type): New function.

Added:
    trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/debug.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/python/libstdcxx/v6/printers.py
    trunk/libstdc++-v3/testsuite/lib/gdb-test.exp
    trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/48362.cc
    trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/simple.cc


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (8 preceding siblings ...)
  2012-01-30 17:22 ` tromey at gcc dot gnu.org
@ 2012-02-04 11:26 ` pluto at agmk dot net
  2012-03-22 22:20 ` pluto at agmk dot net
  10 siblings, 0 replies; 12+ messages in thread
From: pluto at agmk dot net @ 2012-02-04 11:26 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

--- Comment #10 from Pawel Sikora <pluto at agmk dot net> 2012-02-04 11:26:24 UTC ---
(In reply to comment #9)
> Author: tromey
> Date: Mon Jan 30 16:25:11 2012
> URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=183732

could you backport this for 4.6 ?


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

* [Bug libstdc++/51649] pretty printers don't handle std::__7:: namespace
  2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
                   ` (9 preceding siblings ...)
  2012-02-04 11:26 ` pluto at agmk dot net
@ 2012-03-22 22:20 ` pluto at agmk dot net
  10 siblings, 0 replies; 12+ messages in thread
From: pluto at agmk dot net @ 2012-03-22 22:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51649

Pawel Sikora <pluto at agmk dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #11 from Pawel Sikora <pluto at agmk dot net> 2012-03-22 22:19:08 UTC ---
ok, 4.7.0 is out. closing as fixed (not a regression).


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

end of thread, other threads:[~2012-03-22 22:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-21 11:53 [Bug libstdc++/51649] New: pretty printers don't handle std::__7:: namespace pluto at agmk dot net
2011-12-21 12:21 ` [Bug libstdc++/51649] " pluto at agmk dot net
2011-12-21 16:21 ` redi at gcc dot gnu.org
2011-12-21 17:52 ` redi at gcc dot gnu.org
2011-12-21 18:36 ` tromey at gcc dot gnu.org
2012-01-17 16:22 ` pluto at agmk dot net
2012-01-17 18:44 ` redi at gcc dot gnu.org
2012-01-19 22:23 ` tromey at gcc dot gnu.org
2012-01-20 19:03 ` tromey at gcc dot gnu.org
2012-01-30 17:22 ` tromey at gcc dot gnu.org
2012-02-04 11:26 ` pluto at agmk dot net
2012-03-22 22:20 ` pluto at agmk dot net

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