gdb/testsuite: improve logging in lib/tuiterm.exp
Here's a bonus patch that applies on top of the other two.
While debugging TUI test cases, it's hard to know what exactly is
happening in the little mind of the terminal emulator. Add some logging
for all input processing. Right now I'm interested in seeing what
happens to the cursor position, so made it so all operations log the
"before" and "after" cursor position. It should help see if any
operation is not behaving as expected, w.r.t. the cursor position.
Here are some examples of the logging found in gdb.log with this patch
applied:
+++ Inserting string '+|'
+++ Inserted char '+', cursor: (0, 79) -> (1, 0)
+++ Inserted char '|', cursor: (1, 0) -> (1, 1)
+++ Inserted string '+|', cursor: (0, 79) -> (1, 1)
+++ Cursor Horizontal Absolute (80), cursor: (1, 1) -> (1, 79)
In the last line, note that the argument is 80 and we move to 79, that's
because the position in the argument to the control sequence is 1-based,
while our indexing is 0-based.
gdb/testsuite/ChangeLog:
* lib/tuiterm.exp (_log, _log_cur): New, use throughout.
Change-Id: Ibf570d4b2867729ce65bea8c193343a8a846170d