public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "asmwarrior at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug mi/15806] file path separator becomes "\\\\" instead of "\\" when GDB report breakpoint-modified in MI mode
Date: Fri, 27 Dec 2013 02:30:00 -0000	[thread overview]
Message-ID: <bug-15806-4717-T7ATFIDnp3@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 #4 from asmwarrior <asmwarrior at gmail dot com> ---
I did some test by disable the double slash generation in the function call of
gdb_flush (mi->event_channel); Now, the output has changed from:

=breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",a
ddr="0x0040162c",func="main()",file="E:\\\\code\\\\cb\\\\test_code\\\\debug_gdb2
011-12-01\\\\main.cpp",fullname="E:\\\\code\\\\cb\\\\test_code\\\\debug_gdb2011-
12-01\\\\main.cpp",line="26",thread-groups=["i1"],times="0",original-location="m
ain()"}

to

=breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",a
ddr="0x0040162c",func="main()",file="E:\\code\\cb\\test_code\\debug_gdb2011-12-0
1\\main.cpp",fullname="E:\\code\\cb\\test_code\\debug_gdb2011-12-01\\main.cpp",l
ine="26",thread-groups=["i1"],times="0",original-location="main()"}

Looks good, but the side effect is that the other message has changed from:


=library-loaded,id="D:\\mingw-builds\\473\\mingw32\\bin\\libwinpthread-1.dll",ta
rget-name="D:\\mingw-builds\\473\\mingw32\\bin\\libwinpthread-1.dll",host-name="
D:\\mingw-builds\\473\\mingw32\\bin\\libwinpthread-1.dll",symbols-loaded="0",thr
ead-group="i1"

to

=library-loaded,id="D:\mingw-builds\473\mingw32\bin\libwinpthread-1.dll",target-
name="D:\mingw-builds\473\mingw32\bin\libwinpthread-1.dll",host-name="D:\mingw-b
uilds\473\mingw32\bin\libwinpthread-1.dll",symbols-loaded="0",thread-group="i1"

This is bad, because I think the former case in the library-loaded message is
correct.

By looking at the source code:

static void
mi_solib_loaded (struct so_list *solib)
{
  struct mi_interp *mi = top_level_interpreter_data ();

  target_terminal_ours ();
  if (gdbarch_has_global_solist (target_gdbarch ()))
    fprintf_unfiltered (mi->event_channel,
            "library-loaded,id=\"%s\",target-name=\"%s\","
            "host-name=\"%s\",symbols-loaded=\"%d\"",
            solib->so_original_name, solib->so_original_name,
            solib->so_name, solib->symbols_loaded);
  else
    fprintf_unfiltered (mi->event_channel,
            "library-loaded,id=\"%s\",target-name=\"%s\","
            "host-name=\"%s\",symbols-loaded=\"%d\","
            "thread-group=\"i%d\"",
            solib->so_original_name, solib->so_original_name,
            solib->so_name, solib->symbols_loaded,
            current_inferior ()->num);

  gdb_flush (mi->event_channel);
}

I see that fprintf_unfltered just output something like
"D:\mingw-builds\473..." string to the the mi_event_channel, so if double
backslash is disabled in gdb_flush(), we get the result containing
"D:\mingw-builds\473...".

So, I don't have an idea to fix this bug.

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


  parent reply	other threads:[~2013-12-27  2:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-30 15:42 [Bug mi/15806] New: " 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 [this message]
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
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-T7ATFIDnp3@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).