Change wrap buffering to use a std::string
Currently wrap buffering is implemented by allocating a string that is
the same width as the window, and then writing characters into it.
However, if gdb emits terminal escapes, then these could possibly
overflow the buffer.
To prevent this, change the wrap buffer to be a std::string and update
the various uses.
This also changes utils.c to always emit characters to the wrap
buffer. This simplifies future patches which emit terminal escape
sequences, and also makes it possible for the "echo" and "printf"
commands to be used to emit terminal escapes and have these work in
the TUI.
gdb/ChangeLog
2018-12-28 Tom Tromey <tom@tromey.com>
* utils.c (filter_initialized): New global.
(wrap_buffer): Now a std::string.
(wrap_pointer): Remove.
(flush_wrap_buffer): New function.
(filtered_printing_initialized, set_width, wrap_here)
(fputs_maybe_filtered): Update.