public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value
@ 2012-07-20 20:38 oliver.buchtala at googlemail dot com
  2012-07-20 20:41 ` [Bug python/14380] " oliver.buchtala at googlemail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-20 20:38 UTC (permalink / raw)
  To: gdb-prs

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

             Bug #: 14380
           Summary: Pretty-Printing maps only takes values, interpreted
                    alternating as key and value
           Product: gdb
           Version: 7.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
        AssignedTo: unassigned@sourceware.org
        ReportedBy: oliver.buchtala@googlemail.com
    Classification: Unclassified


-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
@ 2012-07-20 20:41 ` oliver.buchtala at googlemail dot com
  2012-07-20 20:42 ` oliver.buchtala at googlemail dot com
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-20 20:41 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-20 20:41:01 UTC ---
My pretty printers for map types are very pretty in IDEs but not with gdb's
print. There, the tuple sequence is taken for alternating keys and values
taking the value part of each tuple.

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
  2012-07-20 20:41 ` [Bug python/14380] " oliver.buchtala at googlemail dot com
@ 2012-07-20 20:42 ` oliver.buchtala at googlemail dot com
  2012-07-20 20:43 ` oliver.buchtala at googlemail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-20 20:42 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #2 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-20 20:41:59 UTC ---
Created attachment 6538
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6538
minimalistic c++ example source

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
  2012-07-20 20:41 ` [Bug python/14380] " oliver.buchtala at googlemail dot com
  2012-07-20 20:42 ` oliver.buchtala at googlemail dot com
@ 2012-07-20 20:43 ` oliver.buchtala at googlemail dot com
  2012-07-20 21:10 ` oliver.buchtala at googlemail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-20 20:43 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #3 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-20 20:42:57 UTC ---
Created attachment 6539
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6539
pretty printer implementation

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
                   ` (2 preceding siblings ...)
  2012-07-20 20:43 ` oliver.buchtala at googlemail dot com
@ 2012-07-20 21:10 ` oliver.buchtala at googlemail dot com
  2012-07-20 21:12 ` oliver.buchtala at googlemail dot com
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-20 21:10 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #4 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-20 21:10:20 UTC ---
Output for the example is (at line 12):

break 12
run
p a
$1 = A = {[1] = 2}

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
                   ` (3 preceding siblings ...)
  2012-07-20 21:10 ` oliver.buchtala at googlemail dot com
@ 2012-07-20 21:12 ` oliver.buchtala at googlemail dot com
  2012-07-31 15:41 ` tromey at redhat dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-20 21:12 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #5 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-20 21:12:39 UTC ---
Created attachment 6540
  --> http://sourceware.org/bugzilla/attachment.cgi?id=6540
example displayed in nemiver

In contrast to the gdb print, in an IDE using MI the pretty-printers does what
it should : pretty.

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
                   ` (4 preceding siblings ...)
  2012-07-20 21:12 ` oliver.buchtala at googlemail dot com
@ 2012-07-31 15:41 ` tromey at redhat dot com
  2012-07-31 20:18 ` oliver.buchtala at googlemail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2012-07-31 15:41 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

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

--- Comment #6 from Tom Tromey <tromey at redhat dot com> 2012-07-31 15:41:09 UTC ---
I don't think there is a gdb bug here.
gdb is working as intended.

If there is a bug, I think it is in nemiver.
IMO nemiver ought to display things differently when the
'map' hint is given.

If you don't want the output gdb currently gives,
you can just remove the display_hint method.

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
                   ` (5 preceding siblings ...)
  2012-07-31 15:41 ` tromey at redhat dot com
@ 2012-07-31 20:18 ` oliver.buchtala at googlemail dot com
  2012-08-01 15:59 ` tromey at redhat dot com
  2012-08-01 16:16 ` oliver.buchtala at googlemail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-07-31 20:18 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #7 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-07-31 20:18:12 UTC ---
(In reply to comment #6)
> If there is a bug, I think it is in nemiver.

it is not only nemiver. Eclipse CDT and Kdevelop4 behave the same.
It seems that all those graphical debuggers expect gdb to provide maps
as a list (iterable) of key-value tuples. Actually, this is quite reasonable,
too.

Example [("key1", val1), ("key2", val2)]

On the other hand, gdb print on pretty printed maps expects lists (iterables)
such as:
[("", "key1"), ("", val1), ("", "key2"), ("", val2)]

which is definitive less intuitive...

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
                   ` (6 preceding siblings ...)
  2012-07-31 20:18 ` oliver.buchtala at googlemail dot com
@ 2012-08-01 15:59 ` tromey at redhat dot com
  2012-08-01 16:16 ` oliver.buchtala at googlemail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at redhat dot com @ 2012-08-01 15:59 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID

--- Comment #8 from Tom Tromey <tromey at redhat dot com> 2012-08-01 15:58:47 UTC ---
(In reply to comment #7)
> (In reply to comment #6)
> > If there is a bug, I think it is in nemiver.
> 
> it is not only nemiver. Eclipse CDT and Kdevelop4 behave the same.

Personally I think they are all buggy; but in reality the GUIs get
to choose how to display.  It is up to them.

The reason the "map" display hint works the the way it does is
because the first element in the tuples in a child list can really
only be strings -- but in a "map"-like data structure in the inferior,
the key could really be anything, including a complex data structure
that itself requires a pretty-printer.

When we looked at this, we judged that it was far simpler both internally
and for clients to apply special formatting after the fact to rather
ordinary varobjs, than it was to try to add a special way for some
varobjs to support non-trivial keys.

If you don't like how this looks in the CLI, simply do not use the "map"
display hint.  The kind of output you are asking for is the default.

-- 
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] 10+ messages in thread

* [Bug python/14380] Pretty-Printing maps only takes values, interpreted alternating as key and value
  2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
                   ` (7 preceding siblings ...)
  2012-08-01 15:59 ` tromey at redhat dot com
@ 2012-08-01 16:16 ` oliver.buchtala at googlemail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: oliver.buchtala at googlemail dot com @ 2012-08-01 16:16 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #9 from Oliver Buchtala <oliver.buchtala at googlemail dot com> 2012-08-01 16:15:39 UTC ---

> When we looked at this, we judged that it was far simpler both internally
> and for clients to apply special formatting after the fact to rather
> ordinary varobjs, than it was to try to add a special way for some
> varobjs to support non-trivial keys.
> 
> If you don't like how this looks in the CLI, simply do not use the "map"
> display hint.  The kind of output you are asking for is the default.

Ok. Then just keep it for your records that there is this discrepancy.
Maybe you could complement the documentation about that to  have it more clear.
(e.g., add a simple example).

Locally, I established two (mutual exclusive) modes to choose from.

-- 
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] 10+ messages in thread

end of thread, other threads:[~2012-08-01 16:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-20 20:38 [Bug python/14380] New: Pretty-Printing maps only takes values, interpreted alternating as key and value oliver.buchtala at googlemail dot com
2012-07-20 20:41 ` [Bug python/14380] " oliver.buchtala at googlemail dot com
2012-07-20 20:42 ` oliver.buchtala at googlemail dot com
2012-07-20 20:43 ` oliver.buchtala at googlemail dot com
2012-07-20 21:10 ` oliver.buchtala at googlemail dot com
2012-07-20 21:12 ` oliver.buchtala at googlemail dot com
2012-07-31 15:41 ` tromey at redhat dot com
2012-07-31 20:18 ` oliver.buchtala at googlemail dot com
2012-08-01 15:59 ` tromey at redhat dot com
2012-08-01 16:16 ` oliver.buchtala at googlemail 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).