aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-09-01 00:21:40 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-09-12 20:31:29 -0400
commit5fabdcd6801a4567db9c88ceb112ca222544b13f (patch)
treee23ae2e7f4e30fb96881c70a40ce94968a18fed6
parentaa17805fb9a3a1983a510ba425b682fba03410c2 (diff)
downloadgdb-5fabdcd6801a4567db9c88ceb112ca222544b13f.zip
gdb-5fabdcd6801a4567db9c88ceb112ca222544b13f.tar.gz
gdb-5fabdcd6801a4567db9c88ceb112ca222544b13f.tar.bz2
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.
-rw-r--r--gdb/testsuite/ChangeLog4
-rw-r--r--gdb/testsuite/gdb.base/maint.exp13
2 files changed, 5 insertions, 12 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 2798054..395a257 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,9 @@
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'.
2019-09-12 Tom de Vries <tdevries@suse.de>
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index a5d5dac..15988c7 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