[v2,11/17] Fix dw2-zero-range.exp when an index is in use

Message ID 20240117-debug-names-fix-v2-11-dbd5971a9c31@tromey.com
State New
Headers
Series Rewrite .debug_names reader and writer |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Tom Tromey Jan. 17, 2024, 4:39 p.m. UTC
  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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
  

Patch

diff --git a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
index 811d3565dd5..79ccd620b8b 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-zero-range.exp
@@ -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"