diff options
author | Tom de Vries <tdevries@suse.de> | 2025-07-24 09:18:57 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-07-24 09:18:57 +0200 |
commit | db47da255d841a0881b8e33c6630df0279149c12 (patch) | |
tree | 243f8faf535b165fb6684c9a0f00db1adfbd7fde /gdb/testsuite/gdb.base/list-nodebug-2.c | |
parent | 673c91580993bc285d75aca2340ae172c7030953 (diff) | |
download | fsf-binutils-gdb-master.zip fsf-binutils-gdb-master.tar.gz fsf-binutils-gdb-master.tar.bz2 |
Proc Term::_log_cur logs the cursor update of code in its body argument:
...
proc _ctl_0x08 {} {
_log_cur "Backspace" {
variable _cur_col
if {$_cur_col > 0} {
incr _cur_col -1
}
}
}
...
giving us for instance:
...
+++ Backspace, cursor: (2, 0) -> (2, 0)
...
But if we rewrite the code to use a return:
...
if { $_cur_col == 0 } {
return
}
incr _cur_col -1
...
and the return is triggered, the log message disappears.
Fix this by wrapping the "uplevel $body" in a catch:
...
- uplevel $body
+ set code [catch {uplevel $body} result]
...
Tested on aarch64-linux.
Diffstat (limited to 'gdb/testsuite/gdb.base/list-nodebug-2.c')
0 files changed, 0 insertions, 0 deletions