From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1977 invoked by alias); 2 Mar 2011 08:17:26 -0000 Received: (qmail 1951 invoked by uid 22791); 2 Mar 2011 08:17:26 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 02 Mar 2011 08:17:21 +0000 From: "dodji at seketeli dot org" To: gdb-prs@sourceware.org Subject: [Bug ada/12530] New: pretty-printing can't be easily toggled X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dodji at seketeli dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Wed, 02 Mar 2011 08:17: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 X-SW-Source: 2011-q1/txt/msg00164.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=12530 Summary: pretty-printing can't be easily toggled Product: gdb Version: archer Status: NEW Severity: normal Priority: P2 Component: ada AssignedTo: unassigned@sourceware.org ReportedBy: dodji@seketeli.org Background ========== In a graphical debugger, suppose the user is looking at the local variables of the current frame. If the user enables pretty printing, those variables have to dynamically be re-rendered using the pretty printers. Likewise, whenever the user disables pretty printing, those variable have to dynamically be re-rendered without the pretty printing visualizers. It should not be required to re-start the graphical debugger just to toggle pretty printing. There are several things that make it hard for front-ends using the GDB MI API to achieve this goal. Issue description ================= The current MI API doesn't allow clients to globally disable pretty printing. Rather, every single variable object needs to see its visualizer set to 'None', using -var-set-visualizer. >>From the point of view of the client, this is suboptimal. There could be an MI command that would cause all current variable objects to be re-rendered. Clients would then be notified and would update their side of the graphical representation of the re-rendered variables. In case doing this would be too hard, the current scheme could be kept. But then there are other point that would need to be addressed. Currently, whenever a variable object (named var1) has been created and rendered using pretty printers, it's quite hard to make its sub-objects be recursively be re-rendered using the "None" pretty printer, at least. That is, -var-set-visualizer None var, followed by -var-list-children --all-values yields sub-objects rendered with the *previous* pretty printing visualizer. In other words, sub-objects currently don't inherit the pretty printing visualizer of their parent object. Possible solution ================= I am proposing to maybe have a -var-list-children --with-visualizer , and similarly a -var-create --with-visualizer to disable/enable pretty printing per variable object, including their sub objects. Below is a small gdb session that should hopefully illustrate my point. [dodji@adjoa test]$ cat test.cc #include using std::string; class person { string m_name; public: person (const string& name = ""): m_name (name) { } }; int main() { person p ("Toto"); return 0; } [dodji@adjoa test]$ gdb --interpreter=mi2 ./test (gdb) b main ~"b main\n" ~"Breakpoint 1 at 0x4007af: file test.cc, line 19.\n" ^done (gdb) run ~"Breakpoint 1, main () at test.cc:19\n" ~"19\t person p (\"Toto\");\n" *stopped,frame={addr="0x00000000004007af",func="main",args=[],file="test.cc",fullname="/home/dodji/test/test.cc",line="19"},thread-id="1",stopped-threads="all",core="1" (gdb) next ~"n\n" ^running *running,thread-id="1" (gdb) ~"20\t return 0;\n" *stopped,frame={addr="0x0000000000400850",func="main",args=[],file="test.cc",fullname="/home/dodji/test/test.cc",line="20"},thread-id="1",stopped-threads="all",core="1" (gdb) -enable-pretty-printing ^done (gdb) -var-create - * p ^done,name="var1",numchild="1",value="{...}",type="person",thread-id="1",has_more="0" (gdb) -var-list-children --all-values var1 ^done,numchild="1",children=[child={name="var1.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0" (gdb) -var-list-children --all-values var1.private ^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0" (gdb) -var-set-visualizer var1 None ^done (gdb) -var-list-children --all-values var1 ^done,numchild="1",children=[child={name="var1.private",exp="private",numchild="1",value="",thread-id="1"}],has_more="0" (gdb) -var-list-children --all-values var1.private ^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0" (gdb) -var-set-visualizer var1.private None ^done (gdb) -var-list-children --all-values var1.private ^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="0",value="\"Toto\"",type="std::string",thread-id="1",displayhint="string",dynamic="1"}],has_more="0" (gdb) -var-set-visualizer var1.private.m_name None ^done (gdb) -var-list-children --all-values var1.private ^done,numchild="1",children=[child={name="var1.private.m_name",exp="m_name",numchild="2",value="{...}",type="std::string",thread-id="1"}],has_more="0" The exact GDB version I am using is: GNU gdb (GDB) Fedora (7.1-34.fc13) -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.