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

Message ID CY8PR12MB7516A1A7981A2D8165FE931AA84B2@CY8PR12MB7516.namprd12.prod.outlook.com
State New
Headers
Series [v2] 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-arm success Testing passed
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 success Testing passed

Commit Message

Yuriy Kolerov Feb. 9, 2024, 2:32 p.m. UTC
  Breaking a TCL string to several lines leads to adding of extra
symbols to the resuling expect string. In turn, this leads to
failing of all test cases in gdb.arch/arc-disassembler-options.exp
testsuite.

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

Comments

Tom Tromey Feb. 9, 2024, 4:50 p.m. UTC | #1
>>>>> "Yuriy" == Yuriy Kolerov <Yuriy.Kolerov@synopsys.com> writes:

Yuriy> Breaking a TCL string to several lines leads to adding of extra
Yuriy> symbols to the resuling expect string. In turn, this leads to
Yuriy> failing of all test cases in gdb.arch/arc-disassembler-options.exp
Yuriy> testsuite.

Thanks for the patch.

Yuriy> -    gdb_test "disassemble $func" \
Yuriy> -	"Dump of assembler code for function $func:\r\n\
Yuriy> -	\[^:\]+:\t$insn\r\nEnd of assembler dump\." \
Yuriy> -	$mesg
Yuriy> +    set prologue "Dump of assembler code for function $func:\r\n"
Yuriy> +    set content "\[^:\]+:\t$insn\r\n"
Yuriy> +    set epilogue "End of assembler dump\."
Yuriy> +    gdb_test "disassemble $func" "$prologue$content$epilogue" $mesg

I think it would be more idiomatic to wrap the arguments in a call to
[multi_line ...].

thanks,
Tom
  
Yuriy Kolerov Feb. 12, 2024, 8:19 a.m. UTC | #2
Hi Tom,

Yes, you are right. I will send another version with "multi_line".


Regards,

Yuriy Kolerov
  

Patch

diff --git a/gdb/testsuite/gdb.arch/arc-disassembler-options.exp b/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
index 655edcc774b..dda4f996a13 100644
--- a/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
+++ b/gdb/testsuite/gdb.arch/arc-disassembler-options.exp
@@ -28,10 +28,10 @@  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 prologue "Dump of assembler code for function $func:\r\n"
+    set content "\[^:\]+:\t$insn\r\n"
+    set epilogue "End of assembler dump\."
+    gdb_test "disassemble $func" "$prologue$content$epilogue" $mesg
 }
 
 # Verify defaults.