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

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