Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [committed][gdb/testsuite] Fix gdb.rust/traits.exp with -readnow
@ 2020-10-28 20:07 Tom de Vries
  2020-10-30 18:18 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Tom de Vries @ 2020-10-28 20:07 UTC (permalink / raw)
  To: gdb-patches

Hi,

With test-case gdb.rust/traits.exp and target board readnow we get:
...
FAIL: gdb.rust/traits.exp: print *td
FAIL: gdb.rust/traits.exp: print *tu
...

Mark these FAILs as KFAILs.

Tested on x86_64-linux.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.rust/traits.exp with -readnow

gdb/testsuite/ChangeLog:

2020-10-28  Tom de Vries  <tdevries@suse.de>

	* lib/gdb.exp (readnow): Handle arg.
	* gdb.rust/traits.exp: Add KFAILs for -readnow.

---
 gdb/testsuite/gdb.rust/traits.exp | 8 ++++++++
 gdb/testsuite/lib/gdb.exp         | 9 +++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.rust/traits.exp b/gdb/testsuite/gdb.rust/traits.exp
index 41e58e1fef..d237b92872 100644
--- a/gdb/testsuite/gdb.rust/traits.exp
+++ b/gdb/testsuite/gdb.rust/traits.exp
@@ -43,5 +43,13 @@ if {![runto ${srcfile}:$line]} {
     return -1
 }
 
+set readnow_p [readnow $binfile]
+
+if { $readnow_p } {
+    setup_kfail "gdb/26799" *-*-*
+}
 gdb_test "print *td" " = 23.5"
+if { $readnow_p } {
+    setup_kfail "gdb/26799" *-*-*
+}
 gdb_test "print *tu" " = 23"
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index ef96209b0d..003bd3069e 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -7318,8 +7318,13 @@ gdb_caching_proc supports_fcf_protection {
 
 # Return 1 if symbols were read in using -readnow.  Otherwise, return 0.
 
-proc readnow { } {
-    set cmd "maint print objfiles"
+proc readnow { args } {
+    if { [llength $args] == 1 } {
+	set re [lindex $args 0]
+    } else {
+	set re ""
+    }
+    set cmd "maint print objfiles $re"
     gdb_test_multiple $cmd "" {
 	-re -wrap "\r\n.gdb_index: faked for \"readnow\"\r\n.*" {
 	    return 1

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

* Re: [committed][gdb/testsuite] Fix gdb.rust/traits.exp with -readnow
  2020-10-28 20:07 [committed][gdb/testsuite] Fix gdb.rust/traits.exp with -readnow Tom de Vries
@ 2020-10-30 18:18 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2020-10-30 18:18 UTC (permalink / raw)
  To: Tom de Vries; +Cc: gdb-patches

>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:

Tom> +proc readnow { args } {
Tom> +    if { [llength $args] == 1 } {
Tom> +	set re [lindex $args 0]
Tom> +    } else {
Tom> +	set re ""
Tom> +    }

It's better to use Tcl's argument-passing conventions rather than
implement it in the proc.  I know dejagnu (and thus the gdb test suite)
does this, but that's not a great example to copy.

Something like this would achieve the same effect:

proc readnow {{re ""}} {
...

Tom

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

end of thread, other threads:[~2020-10-30 18:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-28 20:07 [committed][gdb/testsuite] Fix gdb.rust/traits.exp with -readnow Tom de Vries
2020-10-30 18:18 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox