From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13355 invoked by alias); 31 Oct 2014 15:26:00 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 13324 invoked by uid 48); 31 Oct 2014 15:25:59 -0000 From: "dje at google dot com" 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: python X-Bugzilla-Version: 7.8 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dje at google dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00167.txt.bz2 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.