[v4] arc: Don't use multiline in arc-disassembler-options.exp test

Message ID 20240213064022.32961-1-kolerov93@gmail.com
State New
Headers
Series [v4] arc: Don't use multiline in arc-disassembler-options.exp test |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-arm success Testing passed

Commit Message

Yuriy Kolerov Feb. 13, 2024, 6:40 a.m. UTC
  Breaking a TCL string to several lines leads to adding of extra
symbols to the resulting expect string. In turn, this leads to
failing of all test cases in gdb.arch/arc-disassembler-options.exp
testsuite. It's necessary to use multi_line function in such
cases.

Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>
---
 gdb/testsuite/gdb.arch/arc-disassembler-options.exp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
  

Comments

Tom Tromey Feb. 13, 2024, 2:46 p.m. UTC | #1
>>>>> Yuriy Kolerov <kolerov93@gmail.com> writes:

> Breaking a TCL string to several lines leads to adding of extra
> symbols to the resulting expect string. In turn, this leads to
> failing of all test cases in gdb.arch/arc-disassembler-options.exp
> testsuite. It's necessary to use multi_line function in such
> cases.

> Signed-off-by: Yuriy Kolerov <kolerov93@gmail.com>

Thank you.  This is ok.

Approved-By: Tom Tromey <tom@tromey.com>

If you don't have write access, and you plan to write more gdb patches,
please contact me off-list.

Tom
  

Patch

diff --git a/gdb/testsuite/gdb.arch/arc-disassembler-options.exp b/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
index 655edcc774b..3d2bbe83015 100644
--- a/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
@@ -28,10 +28,11 @@  if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}" object {}] \
 clean_restart ${objfile}
 
 proc arc_disassemble_test { func insn mesg } {
-    gdb_test "disassemble $func" \
-	"Dump of assembler code for function $func:\r\n\
-	\[^:\]+:\t$insn\r\nEnd of assembler dump\." \
-	$mesg
+    set pass_re [multi_line \
+			"Dump of assembler code for function $func:" \
+			"\[^:\]+:\t$insn" \
+			"End of assembler dump\\."]
+    gdb_test "disassemble $func" $pass_re $mesg
 }
 
 # Verify defaults.