This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug mi/15806] file path separator becomes "\\\\" instead of "\\" when GDB report breakpoint-modified in MI mode
- From: "asmwarrior at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Fri, 27 Dec 2013 02:30:13 +0000
- Subject: [Bug mi/15806] file path separator becomes "\\\\" instead of "\\" when GDB report breakpoint-modified in MI mode
- Auto-submitted: auto-generated
- References: <bug-15806-4717 at http dot sourceware dot 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.