aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/maint.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.base/maint.exp')
-rw-r--r--gdb/testsuite/gdb.base/maint.exp26
1 files changed, 18 insertions, 8 deletions
diff --git a/gdb/testsuite/gdb.base/maint.exp b/gdb/testsuite/gdb.base/maint.exp
index 0707c88..4969c67 100644
--- a/gdb/testsuite/gdb.base/maint.exp
+++ b/gdb/testsuite/gdb.base/maint.exp
@@ -429,9 +429,19 @@ set timeout [expr $timeout + 300]
#
# And by the way: This testpoint will break for PA64, where a.out's
# are ELF files.
-#
+
+# Standard GNU names.
+set text_section ".text"
+set data_section ".data"
+
send_gdb "maint info sections\n"
gdb_expect {
+ -re "Exec file:\r\n.*break($EXEEXT)?., file type.*ER_RO.*$gdb_prompt $" {
+ # Looks like RealView which uses different section names.
+ set text_section ER_RO
+ set data_section ER_RW
+ pass "maint info sections"
+ }
-re "Exec file:\r\n.*break($EXEEXT)?., file type.*$gdb_prompt $"\
{ pass "maint info sections" }
-re ".*$gdb_prompt $" { fail "maint info sections" }
@@ -440,11 +450,11 @@ gdb_expect {
# Test for new option: maint info sections <section name>
# If you don't have a .text section, this will require tweaking.
-send_gdb "maint info sections .text\n"
+send_gdb "maint info sections $text_section\n"
gdb_expect {
-re ".* \\.bss .*$gdb_prompt $" { fail "maint info sections .text" }
- -re ".* \\.data .*$gdb_prompt $" { fail "maint info sections .text" }
- -re ".* \\.text .*$gdb_prompt $" { pass "maint info sections .text" }
+ -re ".* $data_section .*$gdb_prompt $" { fail "maint info sections .text" }
+ -re ".* $text_section .*$gdb_prompt $" { pass "maint info sections .text" }
-re ".*$gdb_prompt $" { fail "maint info sections .text" }
timeout { fail "(timeout) maint info sections .text" }
}
@@ -453,8 +463,8 @@ gdb_expect {
# If your data section is tagged CODE, xfail this test.
send_gdb "maint info sections CODE\n"
gdb_expect {
- -re ".* \\.data .*$gdb_prompt $" { fail "maint info sections CODE" }
- -re ".* \\.text .*$gdb_prompt $" { pass "maint info sections CODE" }
+ -re ".* $data_section .*$gdb_prompt $" { fail "maint info sections CODE" }
+ -re ".* $text_section .*$gdb_prompt $" { pass "maint info sections CODE" }
-re ".*$gdb_prompt $" { fail "maint info sections CODE" }
timeout { fail "(timeout) maint info sections CODE" }
}
@@ -467,8 +477,8 @@ gdb_expect {
setup_xfail "*-*-*cygwin*"
send_gdb "maint info sections DATA\n"
gdb_expect {
- -re ".* \\.text .*$gdb_prompt $" { fail "maint info sections DATA" }
- -re ".* \\.data .*$gdb_prompt $" { pass "maint info sections DATA" }
+ -re ".* $text_section .*$gdb_prompt $" { fail "maint info sections DATA" }
+ -re ".* $data_section .*$gdb_prompt $" { pass "maint info sections DATA" }
-re ".* .rodata .*$gdb_prompt $" { pass "maint info sections DATA" }
-re ".*$gdb_prompt $" { fail "maint info sections DATA" }
timeout { fail "(timeout) maint info sections DATA" }