This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug mi/15806] file path separator becomes "\\\\" instead of "\\" when GDB report breakpoint-modified in MI mode


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]