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.
This commit is contained in:
Andrew Burgess 2019-09-01 00:21:40 +01:00
parent aa17805fb9
commit 5fabdcd680
2 changed files with 5 additions and 12 deletions

View 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'.

View 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