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 <tdevries@suse.de>
* gdb.base/define.exp: Add "\r\n" to "reset gdb_prompt" regexp.
+2019-07-29 Tom de Vries <tdevries@suse.de>
+
+ * gdb.base/define.exp: Add "\r\n" to "reset gdb_prompt" regexp.
+
2019-07-29 Tom de Vries <tdevries@suse.de>
PR gdb/24855
}
gdb_test_multiple "set prompt $prior_prompt " "reset gdb_prompt" {
- -re "$gdb_prompt $" {
+ -re "\r\n$gdb_prompt $" {
pass "reset gdb_prompt"
}
}