From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24350 invoked by alias); 23 Apr 2014 19:40:17 -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 24323 invoked by uid 48); 23 Apr 2014 19:40:16 -0000 From: "simon.marchi at ericsson dot com" To: gdb-prs@sourceware.org Subject: [Bug mi/16868] New: Wrong escaping of "script" in breakpoint-created event Date: Wed, 23 Apr 2014 19:40: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-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at ericsson dot com X-Bugzilla-Status: NEW 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 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: 2014-q2/txt/msg00105.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16868 Bug ID: 16868 Summary: Wrong escaping of "script" in breakpoint-created event Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: mi Assignee: unassigned at sourceware dot org Reporter: simon.marchi at ericsson dot com When the =breakpoint-created event is emitted following the creation of a dprintf, the escaping of the script field is wrong. How to reproduce: $ gdb -i mi ~/src/a.out =thread-group-added,id="i1" =cmd-param-changed,param="debug-file-directory",value="/usr/lib/debug" =cmd-param-changed,param="auto-load safe-path",value="/" =cmd-param-changed,param="pagination",value="off" =cmd-param-changed,param="python print-stack",value="full" =cmd-param-changed,param="non-stop",value="on" =cmd-param-changed,param="target-async",value="on" ~"Reading symbols from /home/simark/src/a.out..." ~"done.\n" (gdb) dprintf main, "hello\n" &"dprintf main, \"hello\\n\"\n" ~"Dprintf 1 at 0x400a29: file test.c, line 55.\n" =breakpoint-created,bkpt={number="1",type="dprintf",disp="keep",enabled="y",addr="0x0000000000400a29",func="main",file="test.c",fullname="/home/simark/src/test.c",line="55",thread-groups=["i1"],times="0",script={"printf \\"hello\\\\n\\""},original-location="main"} ^done (gdb) The bad part is: "printf \\"hello\\\\n\\"" It seems like escaping is called twice. A parser trying to read the string will end think it ends at the " just before hello. The correct value would be: "printf \"hello\\n\"" -- You are receiving this mail because: You are on the CC list for the bug.