‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Tuesday, 26 November 2019 21:24, Pedro Alves wrote: > On 11/26/19 12:49 PM, Iain Buclaw wrote: > > > The significance of this is that printf_unfiltered writes messages to wrap_buffer, whereas puts_unfiltered pushes them immediately to stdout, resulting in "post-" messages being printed out of order. > > It sounds quite surprising that two _unfiltered functions could behave differently > like that. That sounds like a bug that should be fixed, instead of worked around > by having to recall to use printf vs puts. > > Thanks, > Pedro Alves I think the best way to avoid the discrepancy is to treat both fputs_filtered and fputs_unfiltered equally by forwarding both calls to fputs_maybe_filtered. To avoid recursion, flush_wrap_buffer and fputs_maybe_filtered have had calls to fputs_unfiltered replaced with stream->puts(). While attempting to grok my head around fputs_maybe_filtered, I also noticed that buffer_clearer is being removed by the compiler as dead code. -- Iain --- gdb/ChangeLog: 2019-11-26 Iain Buclaw * gdb/ui-file.c (fputs_unfiltered): Move to utils.c. * gdb/utils.c (flush_wrap_buffer): Call ui_file::puts instead of fputs_unfiltered. (fputs_maybe_filtered): Likewise. Remove unused buffer_clearer. (fputs_unfiltered): Moved from utils.c; call fputs_maybe_filtered. --- gdb/ui-file.c | 6 ------ gdb/utils.c | 22 +++++++++------------- 2 files changed, 9 insertions(+), 19 deletions(-) ---