public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "simon.marchi at ericsson dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug mi/15806] Some fields in async MI events get escaped twice
Date: Fri, 25 Apr 2014 14:16:00 -0000	[thread overview]
Message-ID: <bug-15806-4717-JXT6dFATvf@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-15806-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=15806

--- Comment #12 from Simon Marchi <simon.marchi at ericsson dot com> ---
Oops, yeah the fix was only for breakpoint-created, sorry about that.

Your comment made me realize that if a library path contains a quote ("), the
result will be wrong. Example:

=library-loaded,id="/tmp/hello"you/libpopt.so.0",target-name="/tmp/hello"you/libpopt.so.0",host-name="/tmp/hello"you/libpopt.so.0",symbols-loaded="0",thread-group="i1"

To reproduce this, I created '/tmp/hello"you', copied some library in it and
modified LD_LIBRARY_PATH so that my test program use this library instead of
the system's version. You can see that the " between hello and you is not
escaped, but should be.

I think that no escaping can be done reliably in gdb_flush. There is no way to
differentiate a quote that should not be escaped from one that should be
escaped. Therefore, I think it should always be done at the moment where the
content is created.

Also, using fprintf_unfiltered to output this is wrong, because the fields are
never escaped. It would probably be better to use the ui_out_field_* functions
everywhere. What do you think ?

-- 
You are receiving this mail because:
You are on the CC list for the bug.


  parent reply	other threads:[~2014-04-25 14:16 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 15:42 [Bug mi/15806] New: file path separator becomes "\\\\" instead of "\\" when GDB report breakpoint-modified in MI mode asmwarrior at gmail dot com
2013-07-31  3:36 ` [Bug mi/15806] " asmwarrior at gmail dot com
2013-07-31 15:29 ` asmwarrior at gmail dot com
2013-12-26 14:54 ` asmwarrior at gmail dot com
2013-12-27  2:30 ` asmwarrior at gmail dot com
2014-04-24 15:28 ` [Bug mi/15806] Some fields in async MI events get escaped twice simon.marchi at ericsson dot com
2014-04-24 15:28 ` simon.marchi at ericsson dot com
2014-04-24 15:32 ` simon.marchi at ericsson dot com
2014-04-24 15:33 ` simon.marchi at ericsson dot com
2014-04-25  0:52 ` asmwarrior at gmail dot com
2014-04-25  2:30 ` asmwarrior at gmail dot com
2014-04-25  3:10 ` asmwarrior at gmail dot com
2014-04-25 14:16 ` simon.marchi at ericsson dot com [this message]
2014-04-25 14:56 ` asmwarrior at gmail dot com
2014-04-25 19:37 ` simon.marchi at ericsson dot com
2014-04-25 19:51 ` marc.khouzam at ericsson dot com
2014-04-26 10:03 ` asmwarrior at gmail dot com
2014-09-25 18:14 ` simon.marchi at ericsson dot com

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=bug-15806-4717-JXT6dFATvf@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /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: link
Be 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).