diff options
author | Tom de Vries <tdevries@suse.de> | 2025-07-22 22:26:05 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-07-22 22:26:05 +0200 |
commit | cf5a7801bd6994587b802ee6e0ee5a3a95c40bfd (patch) | |
tree | 19d1bddb8f882f518a21135577145f16dc6dc1ee /libctf/ctf-serialize.c | |
parent | 5b763a470886fb9f24b8a75f38e6b252a2c127a7 (diff) | |
download | binutils-cf5a7801bd6994587b802ee6e0ee5a3a95c40bfd.zip binutils-cf5a7801bd6994587b802ee6e0ee5a3a95c40bfd.tar.gz binutils-cf5a7801bd6994587b802ee6e0ee5a3a95c40bfd.tar.bz2 |
[gdb/cli] Clear line buffer on ^C
Gdb has the ability to gather input over several lines [1], for instance this:
...
(gdb) print 1
$1 = 1
(gdb)
...
can also be typed as:
...
(gdb) print\
1
$2 = 1
(gdb)
...
Furthermore, if we type a command but change our mind, we can abort using ^C
and start over using a fresh gdb prompt [2]:
...
(gdb) print 1❌️ Quit
(gdb) echo 1\n
1
(gdb)
...
Now say we type a multi-line command but abort it, we get:
...
(gdb) print\
1❌️ Quit
(gdb) echo 1\n
❌️ Undefined command: "printecho". Try "help".
(gdb)
...
Using "set trace-commands on", we can see what happened:
...
+printecho 1\n
..
Gdb has prepended the first line of the cancelled multi-line command to the
following command.
Fix this by clearing current_ui->line_buffer on catching a gdb_exception in
start_event_loop.
Tested on x86_64-linux.
Approved-By: Andrew Burgess <aburgess@redhat.com>
PR cli/33063
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33063
[1] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Output.html
[2] https://sourceware.org/gdb/current/onlinedocs/gdb.html/Quitting-GDB.html
Diffstat (limited to 'libctf/ctf-serialize.c')
0 files changed, 0 insertions, 0 deletions