public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug mi/16868] New: Wrong escaping of "script" in breakpoint-created event
@ 2014-04-23 19:40 simon.marchi at ericsson dot com
  2014-04-24  3:42 ` [Bug mi/16868] " asmwarrior at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: simon.marchi at ericsson dot com @ 2014-04-23 19:40 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-04-24 15:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-23 19:40 [Bug mi/16868] New: Wrong escaping of "script" in breakpoint-created event simon.marchi at ericsson dot com
2014-04-24  3:42 ` [Bug mi/16868] " asmwarrior at gmail dot com
2014-04-24  3:44 ` asmwarrior at gmail dot com
2014-04-24 14:37 ` simon.marchi at ericsson dot com
2014-04-24 14:48 ` asmwarrior at gmail dot com
2014-04-24 15:28 ` simon.marchi at ericsson dot com

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).