gdb/testsuite: improve logging in lib/tuiterm.exp
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 21 Jan 2021 19:03:51 +0000 (14:03 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 21 Jan 2021 19:04:00 +0000 (14:04 -0500)
commit730af66356b3181784c72b3ddd5cb23dd09a2ef3
tree96cd9c22de31dfb1253f24d5cb0ec4f6583df73f
parenta72d0f3d69896b5fcdc916e0547fe774dcb58614
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
gdb/testsuite/ChangeLog
gdb/testsuite/lib/tuiterm.exp
This page took 0.024534 seconds and 4 git commands to generate.