From b528dae0954436ab103fb8ab6fc1ca632b4a7c51 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Mon, 29 Jul 2019 11:24:04 +0200 Subject: [PATCH] [gdb/testsuite] Fix gdb.base/define.exp with check-read1 When running gdb.base/define.exp with check-read1, we get: ... show prompt^M Gdb's prompt is "(gdb) ".^M (gdb) PASS: gdb.base/define.exp: save gdb_prompt set prompt \(blah\) ^M (blah) PASS: gdb.base/define.exp: set gdb_prompt set prompt (gdb) PASS: gdb.base/define.exp: reset gdb_prompt ^M (gdb) FAIL: gdb.base/define.exp: define do-define ... The problem is that the "$gdb_prompt $" regexp here: ... gdb_test_multiple "set prompt $prior_prompt " "reset gdb_prompt" { -re "$gdb_prompt $" { pass "reset gdb_prompt" } } ... triggers for the echoing of the command "set prompt $prior_prompt " rather than for the prompt after the command has executed. Fix this by changing the regexp to "\r\n$gdb_prompt $". Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2019-07-29 Tom de Vries * gdb.base/define.exp: Add "\r\n" to "reset gdb_prompt" regexp. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/define.exp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f79dc9f71c3..ff6159e1109 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-07-29 Tom de Vries + + * gdb.base/define.exp: Add "\r\n" to "reset gdb_prompt" regexp. + 2019-07-29 Tom de Vries PR gdb/24855 diff --git a/gdb/testsuite/gdb.base/define.exp b/gdb/testsuite/gdb.base/define.exp index e8508b8728d..d7d4fd03ba5 100644 --- a/gdb/testsuite/gdb.base/define.exp +++ b/gdb/testsuite/gdb.base/define.exp @@ -302,7 +302,7 @@ gdb_test_multiple "set prompt \\(blah\\) " "set gdb_prompt" { } gdb_test_multiple "set prompt $prior_prompt " "reset gdb_prompt" { - -re "$gdb_prompt $" { + -re "\r\n$gdb_prompt $" { pass "reset gdb_prompt" } } -- 2.30.2