public inbox for gdb-prs@sourceware.org help / color / mirror / Atom feed
From: dodji@redhat.com To: gdb-gnats@sources.redhat.com Subject: mi/2554: -break-list can produce non MI compliant output Date: Thu, 13 Nov 2008 12:48:00 -0000 [thread overview] Message-ID: <20081113123955.29587.qmail@sourceware.org> (raw) >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:
reply other threads:[~2008-11-13 12:48 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20081113123955.29587.qmail@sourceware.org \ --to=dodji@redhat.com \ --cc=gdb-gnats@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).