+2020-03-30 Tom de Vries <tdevries@suse.de>
+
+ * gdb.base/c-linkage-name.exp: Use readnow call to mark a test
+ unsupported.
+ (verify_psymtab_expanded): Move ...
+ * lib/gdb.exp (verify_psymtab_expanded): ... here. Add unsupported
+ test.
+ (readnow): New proc.
+
2020-03-23 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.fortran/mixed-lang-stack.exp: Replace two hard coded address
}
clean_restart ${binfile}
-
-# Verify that partial symtab expansion for $filename has state $readin
-
-proc verify_psymtab_expanded { filename readin } {
- set cmd "maint info psymtab"
- set test "$cmd: $filename: $readin"
- set re [multi_line \
- " \{ psymtab \[^\r\n\]*$filename\[^\r\n\]*" \
- " readin $readin" \
- ".*"]
-
- gdb_test $cmd $re $test
-}
+set readnow [readnow]
# Verify that partial symtab expansion has not taken place for
# c-linkage-name-2.c.
verify_psymtab_expanded c-linkage-name-2.c no
-# Try to print MUNDANE, but using its linkage name.
+set test "print symada__cS before partial symtab expansion"
+if { $readnow } {
+ unsupported $test
+} else {
+ # Try to print MUNDANE, but using its linkage name.
-gdb_test "print symada__cS" \
- "'symada__cS' has unknown type; cast it to its declared type" \
- "print symada__cS before partial symtab expansion"
+ gdb_test "print symada__cS" \
+ "'symada__cS' has unknown type; cast it to its declared type" \
+ $test
+}
# Force the symbols to be expanded for the unit that contains
# our symada__cS symbol by, e.g. inserting a breakpoint on one
} executable "additional_flags=-gstatement-frontiers"]
}
+# Return 1 if symbols were read in using -readnow. Otherwise, return 0.
+
+proc readnow { } {
+ set cmd "maint print objfiles"
+ gdb_test_multiple $cmd "" {
+ -re -wrap "\r\n.gdb_index: faked for \"readnow\"\r\n.*" {
+ return 1
+ }
+ -re -wrap "" {
+ return 0
+ }
+ }
+
+ return 0
+}
+
+# Verify that partial symtab expansion for $filename has state $readin.
+
+proc verify_psymtab_expanded { filename readin } {
+ global gdb_prompt
+
+ set cmd "maint info psymtab"
+ set test "$cmd: $filename: $readin"
+ set re [multi_line \
+ " \{ psymtab \[^\r\n\]*$filename\[^\r\n\]*" \
+ " readin $readin" \
+ ".*"]
+
+ gdb_test_multiple $cmd $test {
+ -re "$cmd\r\n$gdb_prompt $" {
+ unsupported $gdb_test_name
+ }
+ -re -wrap $re {
+ pass $gdb_test_name
+ }
+ }
+}
+
# Always load compatibility stuff.
load_lib future.exp