public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/17529] New: Need to better specify contract between MI and pretty-printers
@ 2014-10-31 15:26 dje at google dot com
  2015-02-27 22:51 ` [Bug python/17529] " dje at google dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dje at google dot com @ 2014-10-31 15:26 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 17529
           Summary: Need to better specify contract between MI and
                    pretty-printers
           Product: gdb
           Version: 7.8
            Status: NEW
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

[filed under "python" and not "mi" because I think we need to begin with what
the children iterator returns]

The contract between pretty-printers and MI is underspecified, and can lead to
pretty-printers "working" fine for CLI and failing miserably for MI-based
clients, e.g. Eclipse.

ref emails:
https://sourceware.org/ml/gdb/2014-10/msg00127.html
https://sourceware.org/ml/gdb/2014-10/msg00129.html

Question: In the children iterator protocol, where the result of each iteration
is a tuple of (name, value), what is the intended usage of these values by an
MI-based frontend?

Eclipse is taking "name" and assuming it's a class member.
And it is taking "value" and assuming it is of the type of the underlying
object.

Neither of these requirements is specified anywhere.
[I could certainly have missed it of course.  Feel free to close with a
reference to the relevant section(s) of the docs.]

Or, it could be that Eclipse is making errant assumptions about what it
can/should do with (name, value), in which case the docs need to clear this up
so that we can get Eclipse fixed (and prevent other frontends from making
similar mistakes).

In the case of a nested set of complex data structures, where one would want
the pretty-printer to be used on the value returned in (name, value), returning
the gdb.Value object as "value" makes sense (though I think this could be
better explained in the manual).  However, what if one just wants to return a
string representation of the underlying value?  Eclipse is assuming that if a
string is returned then the type of the value is a char array, and shows that
as the type of the object to the user.  Not good.

This is using Eclipse 4.4, though I don't know if that's sufficient to specify
what version of its MI frontend is being used.

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


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

* [Bug python/17529] Need to better specify contract between MI and pretty-printers
  2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
@ 2015-02-27 22:51 ` dje at google dot com
  2015-02-27 22:57 ` keiths at redhat dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dje at google dot com @ 2015-02-27 22:51 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from dje at google dot com ---
Another issue:
GDB ignores the name in the (name, tuple) passed back if display_hint is
'array'.  However, Eclipse at least is using this name.

Since gdb was ignoring the name I just set name to 'ignore' in my
pretty-printer.
But then I started seeing Eclipse print 'ignore' instead of the expected '[0]'.

I'm also seeing Eclipse try to do 
-var-create - * &(((v).[0]).str)
on an stl vector of a class with member "str".
Note the additional ".".
Possibly an Eclipse bug of course.

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


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

* [Bug python/17529] Need to better specify contract between MI and pretty-printers
  2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
  2015-02-27 22:51 ` [Bug python/17529] " dje at google dot com
@ 2015-02-27 22:57 ` keiths at redhat dot com
  2015-04-20 15:38 ` xdje42 at gmail dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: keiths at redhat dot com @ 2015-02-27 22:57 UTC (permalink / raw)
  To: gdb-prs

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

Keith Seitz <keiths at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |keiths at redhat dot com

--- Comment #2 from Keith Seitz <keiths at redhat dot com> ---
What's worse is that varobj needs to know the children for any given variable,
but when the parent has a pretty-printer associated with it, it is currently
impossible for the code to compute how many children there are.

This leads to an assertion failure in varobj.c. See varobj/15166.

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


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

* [Bug python/17529] Need to better specify contract between MI and pretty-printers
  2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
  2015-02-27 22:51 ` [Bug python/17529] " dje at google dot com
  2015-02-27 22:57 ` keiths at redhat dot com
@ 2015-04-20 15:38 ` xdje42 at gmail dot com
  2015-04-20 16:00 ` david.docteur at intel dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: xdje42 at gmail dot com @ 2015-04-20 15:38 UTC (permalink / raw)
  To: gdb-prs

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

Doug Evans <xdje42 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |xdje42 at gmail dot com

--- Comment #3 from Doug Evans <xdje42 at gmail dot com> ---
See bug 18282 for printing values as strings in Eclipse.

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


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

* [Bug python/17529] Need to better specify contract between MI and pretty-printers
  2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
                   ` (2 preceding siblings ...)
  2015-04-20 15:38 ` xdje42 at gmail dot com
@ 2015-04-20 16:00 ` david.docteur at intel dot com
  2023-08-31 16:15 ` tromey at sourceware dot org
  2023-08-31 19:11 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: david.docteur at intel dot com @ 2015-04-20 16:00 UTC (permalink / raw)
  To: gdb-prs

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

David Docteur <david.docteur at intel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |david.docteur at intel dot com

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


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

* [Bug python/17529] Need to better specify contract between MI and pretty-printers
  2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
                   ` (3 preceding siblings ...)
  2015-04-20 16:00 ` david.docteur at intel dot com
@ 2023-08-31 16:15 ` tromey at sourceware dot org
  2023-08-31 19:11 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 16:15 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #5 from Tom Tromey <tromey at sourceware dot org> ---
When pretty-printing was added, we took a pretty simple
approach -- probably too simple.  Having the child names
in varobj be somewhat meaningless was one of the compromises.

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

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

* [Bug python/17529] Need to better specify contract between MI and pretty-printers
  2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
                   ` (4 preceding siblings ...)
  2023-08-31 16:15 ` tromey at sourceware dot org
@ 2023-08-31 19:11 ` tromey at sourceware dot org
  5 siblings, 0 replies; 7+ messages in thread
From: tromey at sourceware dot org @ 2023-08-31 19:11 UTC (permalink / raw)
  To: gdb-prs

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

Tom Tromey <tromey at sourceware dot org> changed:

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

--- Comment #6 from Tom Tromey <tromey at sourceware dot org> ---
I think this is essentially a dup of the var-info-path-expression bug.

*** This bug has been marked as a duplicate of bug 10252 ***

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

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

end of thread, other threads:[~2023-08-31 19:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-31 15:26 [Bug python/17529] New: Need to better specify contract between MI and pretty-printers dje at google dot com
2015-02-27 22:51 ` [Bug python/17529] " dje at google dot com
2015-02-27 22:57 ` keiths at redhat dot com
2015-04-20 15:38 ` xdje42 at gmail dot com
2015-04-20 16:00 ` david.docteur at intel dot com
2023-08-31 16:15 ` tromey at sourceware dot org
2023-08-31 19:11 ` tromey at sourceware dot org

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