public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] [gdb/testsuite] Fix gdb.mi/mi-disassemble.exp with check-read1
@ 2022-10-20 7:02 Tom de Vries
0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-10-20 7:02 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9c1c98cc632a7f4721e0b19edcb8f6bcd9347942
commit 9c1c98cc632a7f4721e0b19edcb8f6bcd9347942
Author: Tom de Vries <tdevries@suse.de>
Date: Thu Oct 20 09:02:18 2022 +0200
[gdb/testsuite] Fix gdb.mi/mi-disassemble.exp with check-read1
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.
Diff:
---
gdb/testsuite/gdb.mi/mi-disassemble.exp | 2 +-
gdb/testsuite/lib/mi-support.exp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/testsuite/gdb.mi/mi-disassemble.exp b/gdb/testsuite/gdb.mi/mi-disassemble.exp
index cac3689071c..d2b60f1bb22 100644
--- a/gdb/testsuite/gdb.mi/mi-disassemble.exp
+++ b/gdb/testsuite/gdb.mi/mi-disassemble.exp
@@ -269,7 +269,7 @@ proc test_disassembly_opcode_format {} {
# 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
}
diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp
index 2b534f5d871..e537d3b546b 100644
--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -2849,7 +2849,7 @@ proc mi_get_valueof { fmt exp default {test ""} } {
}
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"
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-20 7:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 7:02 [binutils-gdb] [gdb/testsuite] Fix gdb.mi/mi-disassemble.exp with check-read1 Tom de Vries
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).