public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dje at google dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug python/17529] New: Need to better specify contract between MI and pretty-printers
Date: Fri, 31 Oct 2014 15:26:00 -0000	[thread overview]
Message-ID: <bug-17529-4717@http.sourceware.org/bugzilla/> (raw)

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.


             reply	other threads:[~2014-10-31 15:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 15:26 dje at google dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-17529-4717@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).