]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Fix dw2-zero-range.exp when an index is in use
authorTom Tromey <tom@tromey.com>
Wed, 6 Dec 2023 21:24:08 +0000 (14:24 -0700)
committerTom Tromey <tom@tromey.com>
Thu, 18 Jan 2024 15:20:17 +0000 (08:20 -0700)
dw2-zero-range.exp looks for a certain complaint, but this won't be
issued when an index is in use.  This patch changes the test to not
fail in this case.

gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp

index 811d3565dd5f46dd2516a4273da8d687b02d0ef4..79ccd620b8b7d0afbb336f871bdf9d1c14c505f3 100644 (file)
@@ -132,7 +132,10 @@ foreach_with_prefix ranges_sect {ranges rnglists} {
            }
        }
 
-       gdb_assert { $have_complaint } $test
+       # The complaint won't be seen if an index is in use.
+       if {[have_index $lib1] == ""} {
+           gdb_assert { $have_complaint } $test
+       }
     }
 
     if { ! $readnow_p } {
@@ -149,7 +152,10 @@ foreach_with_prefix ranges_sect {ranges rnglists} {
        gdb_load $lib1
        set test "Zero address complaint - unrelocated - psymtab"
        set have_complaint [regexp $re.* $gdb_file_cmd_msg]
-       gdb_assert { $have_complaint } $test
+       # The complaint won't be seen if an index is in use.
+       if {[have_index $lib1] == ""} {
+           gdb_assert { $have_complaint } $test
+       }
     }
     gdb_test_no_output "maint set dwarf synchronous off"