From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67816 invoked by alias); 30 Jul 2015 14:58:36 -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 67789 invoked by uid 48); 30 Jul 2015 14:58:36 -0000 From: "marc.khouzam at ericsson dot com" To: gdb-prs@sourceware.org Subject: [Bug breakpoints/18742] New: In MI, breakpoint commands produce MI output instead of CLI Date: Thu, 30 Jul 2015 14:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: breakpoints X-Bugzilla-Version: 7.9 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marc.khouzam at ericsson dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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 target_milestone 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: 2015-q3/txt/msg00125.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=18742 Bug ID: 18742 Summary: In MI, breakpoint commands produce MI output instead of CLI Product: gdb Version: 7.9 Status: NEW Severity: normal Priority: P2 Component: breakpoints Assignee: unassigned at sourceware dot org Reporter: marc.khouzam at ericsson dot com Target Milestone: --- Understandably, breakpoint commands can only be in CLI format. This makes sense to me as bp commands are something that the user creates, and therefore are created in CLI format. One would expect those CLI bp commands to always output in CLI format, but when GDB is in MI mode, the output of bp commands is in MI format, which does not make sense to a user. I believe GDB should know it is running bp commands and therefore should force them to be run in a CLI interpreter, even when the global interpreter is MI. Below is cleaned up example of the problem: > gdb.master -i mi testing/loopfirst ~"GNU gdb (GDB) 7.10.50.20150730-cvs\n" (gdb) l &"l\n" ~"1\t#include \n" ~"2\t#include \n" ~"3\t\n" ~"4\tint j = 0;\n" ~"5\t\n" ~"6\tint main() {\n" ~"7\t int max = 900;\n" ~"8\t for (int i=0;i Notice no CLI printout for 'i b' when the bp is hit ========> I then simply press and below I get the output ========> of 'i b' but in MI format! &"\n" ^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400570",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="10",thread-groups=["i1"],times="1",script={"i b"},original-location="/home/lmckhou/testing/loopfirst.cc:10"}]} (gdb) ======> Interestingly if I force the bp command to use a CLI interpreter ======> by wrapping it in "interpreter-exec console", things work (gdb) -break-commands 1 "interpreter-exec console \"i b\"" ^done (gdb) i b &"i b\n" ~"Num Type Disp Enb Address What\n" ~"1 breakpoint keep y 0x0000000000400570 in main() at loopfirst.cc:10\n" ~" interpreter-exec console \"i b\"\n" ^done (gdb) c &"c\n" ~"Continuing.\n" ^running *running,thread-id="all" (gdb) =breakpoint-modified,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000400570",func="main()",file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="10",thread-groups=["i1"],times="2",script={"interpreter-exec console \"i b\""},original-location="/home/lmckhou/testing/loopfirst.cc:10"} ~"\nBreakpoint " ~"1, main () at loopfirst.cc:10\n" ~"10\t sleep(1);\n" *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",frame={addr="0x0000000000400570",func="main",args=[],file="loopfirst.cc",fullname="/home/lmckhou/testing/loopfirst.cc",line="10"},thread-id="1",stopped-threads="all",core="3" Num Type Disp Enb Address What 1 breakpoint keep y 0x0000000000400570 in main() at loopfirst.cc:10 breakpoint already hit 2 times interpreter-exec console "i b" ~"(gdb) " (gdb) ======> Above we can see the CLI output of 'i b' when the bp is hit. -- You are receiving this mail because: You are on the CC list for the bug.