With test-case gdb.mi/mi-disassemble.exp and check-read1 I run into:
...
FAIL: gdb.mi/mi-disassemble.exp: disassemble /b main
FAIL: gdb.mi/mi-disassemble.exp: get valueof "*((unsigned char *) 0x400549)"
...
The problem for both FAILs is that the output is parsed using
gdb_test_multiple, which has implicit clauses using $gdb_prompt, which can
match before the explicit clauses using $mi_gdb_prompt.
Fix this by passing -prompt "$mi_gdb_prompt$" to gdb_test_multiple.
Tested on x86-64-linux.
# then disassemble using the MI command.
set longest_insn_bytes ""
set longest_insn_addr ""
- gdb_test_multiple "disassemble /b main" "" {
+ gdb_test_multiple "disassemble /b main" "" -prompt "$::mi_gdb_prompt$" {
-re "^disassemble /b main\r\n" {
exp_continue
}
}
set val ${default}
- gdb_test_multiple "print${fmt} ${exp}" "$test" {
+ gdb_test_multiple "print${fmt} ${exp}" "$test" -prompt "$::mi_gdb_prompt$" {
-re "~\"\\$\[0-9\]* = (\[^\r\n\]*)\\\\n\"\r\n\\^done\r\n$mi_gdb_prompt$" {
set val $expect_out(1,string)
pass "$test"