From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20535 invoked by alias); 13 Nov 2008 12:48:03 -0000 Received: (qmail 20508 invoked by uid 71); 13 Nov 2008 12:48:02 -0000 Resent-Date: 13 Nov 2008 12:48:02 -0000 Resent-Message-ID: <20081113124802.20505.qmail@sourceware.org> Resent-From: gdb-gnats@sources.redhat.com (GNATS Filer) Resent-To: nobody@sources.redhat.com Resent-Cc: gdb-prs@sources.redhat.com Resent-Reply-To: gdb-gnats@sources.redhat.com, dodji@redhat.com Received: (qmail 29588 invoked by uid 48); 13 Nov 2008 12:39:55 -0000 Message-Id: <20081113123955.29587.qmail@sourceware.org> Date: Thu, 13 Nov 2008 12:48:00 -0000 From: dodji@redhat.com Reply-To: dodji@redhat.com To: gdb-gnats@sources.redhat.com X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: mi/2554: -break-list can produce non MI compliant output 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: 2008-q4/txt/msg00046.txt.bz2 >Number: 2554 >Category: mi >Synopsis: -break-list can produce non MI compliant output >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu Nov 13 12:48:02 UTC 2008 >Closed-Date: >Last-Modified: >Originator: dodji@redhat.com >Release: 6.8 >Organization: >Environment: GNU/Linux >Description: Suppose I am using gdb --interpreter=mi2 to debug a program with a .gdbinit that contains: b info_command commands silent return end Then I set a breakpoint in main, doing "-break-insert main". When I do "-break-list", I get an MI output record that I believe is not MI compliant: ~=~ ^done,BreakpointTable={nr_rows="3",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="0x000000000044f7d0",func="internal_error",file="utils.c",fullname="/home/dodji/devel/git/archer.git/gdb/utils.c",line="964",times="0"},bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x000000000048ec10",func="info_command",file=".././gdb/cli/cli-cmds.c",fullname="/home/dodji/devel/git/archer.git/gdb/cli/cli-cmds.c",line="198",times="0",script={"silent","return"}},bkpt={number="3",type="breakpoint",disp="keep",enabled="y",addr="0x0000000000446ec0",func="main",file="gdb.c",fullname="/home/dodji/devel/git/archer.git/gdb/gdb.c",line="26",times="1"}]} (gdb) ~=~ The part that is not MI compliant here is the result: script={"silent", "return"} I believe that is not a valid MI RESULT production, as defined by the grammar at http://sourceware.org/gdb/current/onlinedocs/gdb_26.html#SEC264. A RESULT has the form: VARIABLE "=" VALUE where VALUE is either a CONST, a LIST, or a TUPLE. In our case, the VALUE is {"silent", "return"}. This looks like a TUPLE because it starts with a '{', but alas it's not a TUPLE because a TUPLE should have the form: "{}" | "{" RESULT ( "," RESULT )* "}" where, again, RESULT has the form: VARIABLE "=" VALUE. So, I think we should have script = ["silent", "return"] instead, where ["silent", "return"] is a LIST, not a TUPLE. That would be at least compliant with the MI grammar, and save clients from twistint their MI parsers to make those understand non MI compliant constructs. >>From a quick first glance, it seems to appear that the function print_one_breakpoint_location() reads at some point: script_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "script"); That could suggests the deliberate generation of a tuple here, where I believe it should be a LIST generation instead. Maybe that could be a starting point of investigation. >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: