aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-lang.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2022-09-16 15:53:47 +0200
committerTom de Vries <tdevries@suse.de>2022-09-16 15:53:47 +0200
commitfaf01aee1d03aef5b6f95fd0db358bf5e70578f9 (patch)
treef6015c486a536822de5eba4c43292414de60d761 /gdb/c-lang.c
parent49c3ed081fed6b8e2b48fdc48f805f11e4589514 (diff)
downloadgdb-faf01aee1d03aef5b6f95fd0db358bf5e70578f9.zip
gdb-faf01aee1d03aef5b6f95fd0db358bf5e70578f9.tar.gz
gdb-faf01aee1d03aef5b6f95fd0db358bf5e70578f9.tar.bz2
[gdb] Handle pending ^C after rl_callback_read_char
In completion tests in various test-cases, we've been running into these "clearing input line" timeouts: ... (gdb) $cmd^GPASS: gdb.gdb/unittest.exp: tab complete "$cmd" FAIL: gdb.gdb/unittest.exp: tab complete "$cmd" (clearing input line) (timeout) ... where $cmd == "maintenance selftest name_that_does_not_exist". AFAIU, the following scenario happens: - expect sends "$cmd\t" - gdb detects the stdin event, and calls rl_callback_read_char until it comes to handle \t - readline interprets the \t as completion, tries to complete, fails to do so, outputs a bell (^G) - expect sees the bell, and proceeds to send ^C - readline is still in the call to rl_callback_read_char, and stores the signal in _rl_caught_signal - readline returns from the call to rl_callback_read_char, without having handled _rl_caught_signal - gdb goes to wait for the next event - expect times out waiting for "Quit", the expected reaction for ^C Fix this by handling pending signals after each call to rl_callback_read_char. The fix is only available for readline 8.x, if --with-system-readline provides an older version, then the fix is disabled due to missing function rl_check_signals. Tested on x86_64-linux. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=27813
Diffstat (limited to 'gdb/c-lang.c')
0 files changed, 0 insertions, 0 deletions