[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  <tdevries@suse.de>

	* gdb.base/define.exp: Add "\r\n" to "reset gdb_prompt" regexp.
This commit is contained in:
Tom de Vries
2019-07-29 11:24:04 +02:00
parent d17725d72f
commit b528dae095
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -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"
}
}