gdb/testsuite: Make use of exec_has_index_section function
authorAndrew Burgess <andrew.burgess@embecosm.com>
Sat, 31 Aug 2019 23:21:40 +0000 (00:21 +0100)
committerAndrew Burgess <andrew.burgess@embecosm.com>
Fri, 13 Sep 2019 00:31:29 +0000 (20:31 -0400)
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
gdb/testsuite/gdb.base/maint.exp

index 27980548cb43b3147947281dd42450a81b6ac594..395a257102a86216aba5c3af01304b00fb2f1f5b 100644 (file)
@@ -1,3 +1,7 @@
+2019-09-12  Andrew Burgess  <andrew.burgess@embecosm.com>
+
+       * gdb.base/maint.exp: Use exec_has_index_section.
+
 2019-09-12  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * gdb.base/maint.exp: Add test for 'maint info sections'.
index a5d5dacaba966001f8ab35076168e446212a662c..15988c79386717b5a11623ee0b64aa21173b3040 100644 (file)
@@ -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
This page took 0.03393 seconds and 4 git commands to generate.