This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/17529] New: Need to better specify contract between MI and pretty-printers


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]