diff options
author | Tom de Vries <tdevries@suse.de> | 2025-08-16 20:32:37 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2025-08-16 20:32:37 +0200 |
commit | e579b537353cd91cb8fac1eaeb69901d4936766f (patch) | |
tree | f8d26e1c28741fd495f65b1431551a0f9df21a04 | |
parent | 06a53717f7c5abfd87165f3e5c7f55f9a8f512a7 (diff) | |
download | binutils-e579b537353cd91cb8fac1eaeb69901d4936766f.zip binutils-e579b537353cd91cb8fac1eaeb69901d4936766f.tar.gz binutils-e579b537353cd91cb8fac1eaeb69901d4936766f.tar.bz2 |
[gdb/testsuite] Fix TUI tests on freebsd
While re-testing the TUI tests on x86_64-freebsd, I found that commit
06a53717f7c ("[gdb/testsuite] Handle unrecognized escape sequences better in
tuiterm") broke most test-cases.
Fix this by rewriting this gdb_test_multiple clause:
...
-re "^($re_csi_prefix?)($re_csi_args*)($re_csi_cmd)" {
...
into:
...
-re "^($re_csi_cmd)" {
...
-re "^($re_csi_args*)($re_csi_cmd)" {
...
-re "^($re_csi_prefix?)($re_csi_args*)($re_csi_cmd)" {
...
Tested on x86_64-linux and x86_64-freebsd.
-rw-r--r-- | gdb/testsuite/lib/tuiterm.exp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/gdb/testsuite/lib/tuiterm.exp b/gdb/testsuite/lib/tuiterm.exp index a084b43..e1af223 100644 --- a/gdb/testsuite/lib/tuiterm.exp +++ b/gdb/testsuite/lib/tuiterm.exp @@ -1078,19 +1078,25 @@ proc Term::accept_gdb_output { {warn 1} } { set re_csi_args {[0-9;]} set re_csi_cmd {[a-zA-Z@`]} gdb_expect { + -re "^($re_csi_cmd)" { + set cmd $expect_out(1,string) + _log "wait_for: _csi_$cmd" + eval _csi_$cmd + } + -re "^($re_csi_args*)($re_csi_cmd)" { + set params [split $expect_out(1,string) ";"] + set cmd $expect_out(2,string) + _log "wait_for: _csi_$cmd <<<$params>>>" + eval _csi_$cmd $params + } -re "^($re_csi_prefix?)($re_csi_args*)($re_csi_cmd)" { set prefix $expect_out(1,string) - set cmd $expect_out(3,string) set params [split $expect_out(2,string) ";"] - if { $prefix == "" } { - _log "wait_for: _csi_$cmd <<<$expect_out(1,string)>>>" - eval _csi_$cmd $params - } else { - scan $prefix %c val - set hexval [format "%02x" $val] - _log "wait_for: _csi_0x${hexval}_$cmd <<<$expect_out(1,string)>>>" - eval _csi_0x${hexval}_$cmd $params - } + set cmd $expect_out(3,string) + scan $prefix %c val + set hexval [format "%02x" $val] + _log "wait_for: _csi_0x${hexval}_$cmd <<<$expect_out(1,string)>>>" + eval _csi_0x${hexval}_$cmd $params } timeout { |