public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] arc: Don't use multiline in arc-disassembler-options.exp test
@ 2024-02-09 14:32 Yuriy Kolerov
  2024-02-09 16:50 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Yuriy Kolerov @ 2024-02-09 14:32 UTC (permalink / raw)
  To: gdb-patches, Shahab Vahedi

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(-)

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.
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] arc: Don't use multiline in arc-disassembler-options.exp test
  2024-02-09 14:32 [PATCH v2] arc: Don't use multiline in arc-disassembler-options.exp test Yuriy Kolerov
@ 2024-02-09 16:50 ` Tom Tromey
  2024-02-12  8:19   ` Yuriy Kolerov
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2024-02-09 16:50 UTC (permalink / raw)
  To: Yuriy Kolerov; +Cc: gdb-patches, Shahab Vahedi

>>>>> "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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] arc: Don't use multiline in arc-disassembler-options.exp test
  2024-02-09 16:50 ` Tom Tromey
@ 2024-02-12  8:19   ` Yuriy Kolerov
  0 siblings, 0 replies; 3+ messages in thread
From: Yuriy Kolerov @ 2024-02-12  8:19 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches, Shahab Vahedi

[-- Attachment #1: Type: text/plain, Size: 1342 bytes --]

Hi Tom,

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


Regards,

Yuriy Kolerov



________________________________
From: Tom Tromey <tom@tromey.com>
Sent: Friday, February 9, 2024 20:50
To: Yuriy Kolerov <ykolerov@synopsys.com>
Cc: gdb-patches@sourceware.org <gdb-patches@sourceware.org>; Shahab Vahedi <shahab@synopsys.com>
Subject: Re: [PATCH v2] arc: Don't use multiline in arc-disassembler-options.exp test

>>>>> "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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-12  8:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-09 14:32 [PATCH v2] arc: Don't use multiline in arc-disassembler-options.exp test Yuriy Kolerov
2024-02-09 16:50 ` Tom Tromey
2024-02-12  8:19   ` Yuriy Kolerov

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).