+2020-10-28 Tom de Vries <tdevries@suse.de>
+
+ * gdb.python/py-symbol.exp: Add KFAILs for -readnow.
+
2020-10-28 Tom de Vries <tdevries@suse.de>
* gdb.ada/exec_changed.exp: Add KFAILs for -readnow.
# 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.
# 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" \