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: Thu, 26 Dec 2013 14:53:56 +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 #3 from asmwarrior <asmwarrior at gmail dot com> ---
Some analysis.
We have many usage of ui_file redirect in GDB source code
For example:
ui_out_redirect (mi_uiout, mi->event_channel);
TRY_CATCH (e, RETURN_MASK_ERROR)
gdb_breakpoint_query (mi_uiout, b->number, NULL);
ui_out_redirect (mi_uiout, NULL);
gdb_flush (mi->event_channel);
The contents(buffer) has two chance of running the function: printchar(). When
printchar see a \, it will replace it with another \, so we get doubled
backslash.
Then, in gdb_flush function, we get another doubled backslash. (the printchar()
function also called in gdb_flush), my idea is that: is it possible to avoid
calling printchar() in the gdb_flush function?), it looks like the
mi_event_channel already have backslash doubled.
Another case is that if a new line character first get chance to becomes \n,
then if printchar() called again, it will becomes \\n.
--
You are receiving this mail because:
You are on the CC list for the bug.