Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [committed][gdb/testsuite] Fix gdb.python/py-symbol.exp with -readnow
Date: Wed, 28 Oct 2020 21:08:27 +0100	[thread overview]
Message-ID: <20201028200826.GA27923@delia> (raw)

Hi,

When running test-case gdb.python/py-symbol.exp with target board readnow, we
get:
...
FAIL: gdb.python/py-symbol.exp: print line number of rr
FAIL: gdb.python/py-symbol.exp: print value of rr
...

These are FAILs due to PR25857.

Mark these FAILs as KFAILs.

Committed to trunk.

Thanks,
- Tom

[gdb/testsuite] Fix gdb.python/py-symbol.exp with -readnow

gdb/testsuite/ChangeLog:

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

	* gdb.python/py-symbol.exp: Add KFAILs for -readnow.

---
 gdb/testsuite/gdb.python/py-symbol.exp | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index caa7ddc800..152a9173d2 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -29,6 +29,8 @@ if {[prepare_for_testing "failed to prepare" $testfile \
 # Skip all tests if Python scripting is not enabled.
 if { [skip_python_tests] } { continue }
 
+set readnow_p [readnow]
+
 # Check that we find all static symbols before the inferior has
 # started, at which point some of the symtabs might not have been
 # expanded.
@@ -61,14 +63,36 @@ gdb_test "python print (gdb.lookup_global_symbol('qq').needs_frame)" \
 
 # Similarly, test looking up a static symbol before we runto_main.
 set rr_line [gdb_get_line_number "line of rr"]
+set rr_line_alt [gdb_get_line_number "line of other rr" py-symbol-2.c]
 gdb_test "python print (gdb.lookup_global_symbol ('rr') is None)" "True" \
     "lookup_global_symbol for static var"
 
-gdb_test "python print (gdb.lookup_static_symbol ('rr').line)" "$rr_line" \
-    "print line number of rr"
+set cmd "python print (gdb.lookup_static_symbol ('rr').line)"
+gdb_test_multiple $cmd "print line number of rr" {
+    -re -wrap "$rr_line" {
+	pass $gdb_test_name
+    }
+    -re -wrap "$rr_line_alt" {
+	if { $readnow_p } {
+	    setup_kfail "symtab/25857" *-*-*
+	}
+	fail $gdb_test_name
+    }
+}
 
-gdb_test "python print (gdb.lookup_static_symbol ('rr').value ())" "42" \
-    "print value of rr"
+set cmd "python print (gdb.lookup_static_symbol ('rr').value ())"
+gdb_test_multiple $cmd "print value of rr" {
+    -re -wrap "42" {
+	pass $gdb_test_name
+    }
+    -re -wrap "99" {
+	if { $readnow_p } {
+	    setup_kfail "symtab/25857" *-*-*
+	}
+	fail $gdb_test_name
+    }
+}
+    
 
 gdb_test "python print (gdb.lookup_static_symbol ('rr').needs_frame)" \
     "False" \

                 reply	other threads:[~2020-10-28 20:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201028200826.GA27923@delia \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox