diff options
author | Tom de Vries <tdevries@suse.de> | 2024-01-14 10:21:46 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2024-01-14 10:21:46 +0100 |
commit | c171609cc698a153176305ff53127d99db1f6971 (patch) | |
tree | 0ca1732c7f344f371d56682bcc6a707e45353d51 /bfd | |
parent | ef3a9d685e677e18c36a30c3d3bd7a4206b30003 (diff) | |
download | gdb-c171609cc698a153176305ff53127d99db1f6971.zip gdb-c171609cc698a153176305ff53127d99db1f6971.tar.gz gdb-c171609cc698a153176305ff53127d99db1f6971.tar.bz2 |
[gdb/testsuite] Fix gdb.mi/mi-dprintf.exp with read1
When running test-case gdb.mi/mi-dprintf.exp with check-read1, I run into:
...
(gdb) ^M
PASS: gdb.mi/mi-dprintf.exp: gdb: mi 2nd dprintf stop
-data-evaluate-expression stderr^M
^done,value="0x7ffff7e4a420 <_IO_2_1_stderr_>"^M
(gdb) FAIL: gdb.mi/mi-dprintf.exp: stderr symbol check
...
The problem is in proc mi_gdb_is_stderr_available:
...
proc mi_gdb_is_stderr_available {} {
set has_stderr_symbol false
gdb_test_multiple "-data-evaluate-expression stderr" "stderr symbol check" {
-re "\\^error,msg=\"'stderr' has unknown type; cast it to its declared type\"\r\n$::mi_gdb_prompt$" {
}
-re "$::mi_gdb_prompt$" {
set has_stderr_symbol true
}
}
...
which uses a gdb_test_multiple that is supposed to use the mi prompt, but
doesn't use -prompt to indicate this. Consequently, the default patterns use
the regular gdb prompt, which trigger earlier than the two custom patterns
which use "$::mi_gdb_prompt$".
Fix this by adding the missing -prompt "$::mi_gdb_prompt$" arguments.
While we're at it, make the gdb_test_multiple call a bit more readable by
using variables, and by using -wrap.
Tested on x86_64-linux, with:
- gcc and clang (to trigger both the has_stderr_symbol true and false cases)
- make check and make check-read1.
Diffstat (limited to 'bfd')
0 files changed, 0 insertions, 0 deletions