From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21729 invoked by alias); 2 Sep 2011 10:10:32 -0000 Received: (qmail 21705 invoked by uid 22791); 2 Sep 2011 10:10:31 -0000 X-SWARE-Spam-Status: No, hits=-2.8 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; Fri, 02 Sep 2011 10:10:17 +0000 From: "dodji at seketeli dot org" To: gdb-prs@sourceware.org Subject: [Bug mi/13149] New: Some pretty printers don't work in MI mode Date: Fri, 02 Sep 2011 21:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: mi 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 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-q3/txt/msg00259.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=13149 Bug #: 13149 Summary: Some pretty printers don't work in MI mode Product: gdb Version: 7.3 Status: NEW Severity: normal Priority: P2 Component: mi AssignedTo: unassigned@sourceware.org ReportedBy: dodji@seketeli.org CC: pmuldoon@redhat.com Classification: Unclassified Consider this test case: $ cat -n ~/test.cc 1 #include 2 #include 3 4 int 5 main() 6 { 7 std::vector v; 8 std::string s; 9 10 s = "ein"; 11 v.push_back (s); 12 s = "zwei"; 13 v.push_back (s); 14 s = "drei"; 15 v.push_back (s); 16 } If I debug it using gdb 7.3 and the mi interpreter, I can see that the pretty printer for the 'v' variable is not "working" in MI, but is working in CLI: $ gdb --interpreter=mi2 ./test =thread-group-added,id="i1" ~"GNU gdb (GDB) Fedora (7.3-41.fc15)\n" ~"Copyright (C) 2011 Free Software Foundation, Inc.\n" ~"License GPLv3+: GNU GPL version 3 or later \nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n" ~"This GDB was configured as \"x86_64-redhat-linux-gnu\".\nFor bug reporting instructions, please see:\n" ~"...\n" ~"\nwarning: " ~"Current output protocol does not support redirection\n" ~"\nwarning: " ~"Currently logging to gdb.txt. Turn the logging off and on to make the new setting effective.\n" ~"Reading symbols from /home/dodji/test..." ~"done.\n" (gdb) -enable-pretty-printing ^done (gdb) b main ~"b main\n" ~"Breakpoint 1 at 0x4009ed: file test.cc, line 7.\n" ^done (gdb) run ~"run\n" ~"Starting program: /home/dodji/test \n" =thread-group-started,id="i1",pid="30679" =thread-created,id="1",group-id="i1" ^running *running,thread-id="all" (gdb) =library-loaded,id="/lib64/ld-linux-x86-64.so.2",target-name="/lib64/ld-linux-x86-64.so.2",host-name="/lib64/ld-linux-x86-64.so.2",symbols-loaded="0",thread-group="i1" =library-loaded,id="/usr/lib64/libstdc++.so.6",target-name="/usr/lib64/libstdc++.so.6",host-name="/usr/lib64/libstdc++.so.6",symbols-loaded="0",thread-group="i1" =library-loaded,id="/lib64/libm.so.6",target-name="/lib64/libm.so.6",host-name="/lib64/libm.so.6",symbols-loaded="0",thread-group="i1" =library-loaded,id="/lib64/libgcc_s.so.1",target-name="/lib64/libgcc_s.so.1",host-name="/lib64/libgcc_s.so.1",symbols-loaded="0",thread-group="i1" =library-loaded,id="/lib64/libc.so.6",target-name="/lib64/libc.so.6",host-name="/lib64/libc.so.6",symbols-loaded="0",thread-group="i1" ~"\nBreakpoint " ~"1, main () at test.cc:7\n" ~"7\t std::vector v;\n" *stopped,frame={addr="0x00000000004009ed",func="main",args=[],file="test.cc",fullname="/home/dodji/test.cc",line="7"},thread-id="1",stopped-threads="all",core="2" (gdb) n ~"n\n" ^running *running,thread-id="1" (gdb) ~"8\t std::string s;\n" *stopped,frame={addr="0x00000000004009f9",func="main",args=[],file="test.cc",fullname="/home/dodji/test.cc",line="8"},thread-id="1",stopped-threads="all",core="2" (gdb) n ~"n\n" ^running *running,thread-id="1" (gdb) ~"10\t s = \"ein\";\n" *stopped,frame={addr="0x0000000000400a05",func="main",args=[],file="test.cc",fullname="/home/dodji/test.cc",line="10"},thread-id="1",stopped-threads="all",core="1" (gdb) n ~"n\n" ^running *running,thread-id="1" (gdb) ~"11\t v.push_back (s);\n" *stopped,frame={addr="0x0000000000400a16",func="main",args=[],file="test.cc",fullname="/home/dodji/test.cc",line="11"},thread-id="1",stopped-threads="all",core="2" (gdb) n ~"n\n" ^running *running,thread-id="1" (gdb) ~"12\t s = \"zwei\";\n" *stopped,frame={addr="0x0000000000400a29",func="main",args=[],file="test.cc",fullname="/home/dodji/test.cc",line="12"},thread-id="1",stopped-threads="all",core="2" (gdb) -var-create - * s ^done,name="var1",numchild="0",value=" \"ein\"",type="std::string",thread-id="1",displayhint="string",dynamic="1",has_more="0" (gdb) -var-create - * v ^done,name="var2",numchild="0",value="{...}",type="std::vector, std::allocator >, std::allocator, std::allocator > > >",thread-id="1",displayhint="array",dynamic="1",has_more="1" (gdb) p v ~"p v\n" ~"$1 = std::vector of length 1, capacity 1 = {\"ein\"" ~"}\n" ^done (gdb) you Can see that the "-var-create - * v" yields a varobj which value is "{...}". If I tried to explore it I get: -var-list-children var2 ^done,numchild="1",displayhint="array",children=[child={name="var2.[0]",exp="[0]",numchild="0",type="std::basic_string, std::allocator >",thread-id="1",displayhint="string",dynamic="1"}],has_more="0" (gdb) -var-list-children var2.[0] ^done,numchild="0",displayhint="string",has_more="0" (gdb) Not particularly well pretty printed. Notice how the CLI command "p v" yields a pretty printed value, instead. Notice also how the varobj created for the string "s" yields a pretty printed value. This version of GDB is: $ gdb --version GNU gdb (GDB) Fedora (7.3-41.fc15) Copyright (C) 2011 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: . -- 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.