From 5fabdcd6801a4567db9c88ceb112ca222544b13f Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Sun, 1 Sep 2019 00:21:40 +0100 Subject: [PATCH] gdb/testsuite: Make use of exec_has_index_section function Make use of exec_has_index_section library function rather than manually checking in the 'maintenance info sections' output. Should make no difference to the test results, just makes the code easier to read. gdb/testsuite/ChangeLog: * gdb.base/maint.exp: Use exec_has_index_section. --- gdb/testsuite/ChangeLog | 4 ++++ gdb/testsuite/gdb.base/maint.exp | 13 +------------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 27980548cb4..395a257102a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-09-12 Andrew Burgess + + * gdb.base/maint.exp: Use exec_has_index_section. + 2019-09-12 Andrew Burgess * gdb.base/maint.exp: Add test for 'maint info sections'. diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp index a5d5dacaba9..15988c79386 100644 --- a/gdb/testsuite/gdb.base/maint.exp +++ b/gdb/testsuite/gdb.base/maint.exp @@ -127,18 +127,7 @@ gdb_test_multiple "maint info sections" $test { } # If we're using .gdb_index or .debug_names there will be no psymtabs. -set have_gdb_index 0 -gdb_test_multiple "maint info sections .gdb_index .debug_names" "check for .gdb_index" { - -re ": \\.gdb_index .*\r\n$gdb_prompt $" { - set have_gdb_index 1 - } - -re ": \\.debug_names .*\r\n$gdb_prompt $" { - set have_gdb_index 1 - } - -re ".*$gdb_prompt $" { - ;# Nothing to do, present to avoid a FAIL. - } -} +set have_gdb_index [ exec_has_index_section ${binfile} ] # There also won't be any psymtabs if we read the index from the index cache. # We can detect this by looking if the index-cache is enabled and if the number -- 2.30.2