aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base
diff options
context:
space:
mode:
authorMichael Snyder <msnyder@vmware.com>2002-04-13 00:21:40 +0000
committerMichael Snyder <msnyder@vmware.com>2002-04-13 00:21:40 +0000
commitffd61a589b365836fdc910490b4cc411016b4060 (patch)
tree074f9c989bbeb5c8d48c269fa0997729c29a8047 /gdb/testsuite/gdb.base
parent694f61fb27a1c72db07c473e3876751f91dd0079 (diff)
downloadgdb-ffd61a589b365836fdc910490b4cc411016b4060.zip
gdb-ffd61a589b365836fdc910490b4cc411016b4060.tar.gz
gdb-ffd61a589b365836fdc910490b4cc411016b4060.tar.bz2
2002-04-12 Michael Snyder <msnyder@redhat.com>
From Jim Blandy <jimb@redhat.com> * gdb.base/foo.c (foox): Remove section attribute; the linker script can handle this instead. * gdb.base/bar.c (barx): Same. * gdb.base/baz.c (bazx): Same. * gdb.base/grbx.c (grbxx): Same. * gdb.base/overlays.exp: New test: check that GDB's manual overlay manager doesn't automatically unmap overlays unnecessarily.
Diffstat (limited to 'gdb/testsuite/gdb.base')
-rw-r--r--gdb/testsuite/gdb.base/bar.c2
-rw-r--r--gdb/testsuite/gdb.base/baz.c2
-rw-r--r--gdb/testsuite/gdb.base/foo.c2
-rw-r--r--gdb/testsuite/gdb.base/grbx.c2
-rw-r--r--gdb/testsuite/gdb.base/overlays.exp36
5 files changed, 40 insertions, 4 deletions
diff --git a/gdb/testsuite/gdb.base/bar.c b/gdb/testsuite/gdb.base/bar.c
index 8a4da980..dd0bf92 100644
--- a/gdb/testsuite/gdb.base/bar.c
+++ b/gdb/testsuite/gdb.base/bar.c
@@ -1,4 +1,4 @@
-static int barx __attribute__ ((section (".data01"))) = 'b' + 'a' + 'r';
+static int barx = 'b' + 'a' + 'r';
int bar (int x)
{
diff --git a/gdb/testsuite/gdb.base/baz.c b/gdb/testsuite/gdb.base/baz.c
index a13cd16..8da4ffa 100644
--- a/gdb/testsuite/gdb.base/baz.c
+++ b/gdb/testsuite/gdb.base/baz.c
@@ -1,4 +1,4 @@
-static int bazx __attribute__ ((section (".data02"))) = 'b' + 'a' + 'z';
+static int bazx = 'b' + 'a' + 'z';
int baz (int x)
{
diff --git a/gdb/testsuite/gdb.base/foo.c b/gdb/testsuite/gdb.base/foo.c
index ada9cf4..2553607 100644
--- a/gdb/testsuite/gdb.base/foo.c
+++ b/gdb/testsuite/gdb.base/foo.c
@@ -1,4 +1,4 @@
-static int foox __attribute__ ((section (".data00"))) = 'f' + 'o' + 'o';
+static int foox = 'f' + 'o' + 'o';
int foo (int x)
{
diff --git a/gdb/testsuite/gdb.base/grbx.c b/gdb/testsuite/gdb.base/grbx.c
index 92f7323..58034bb 100644
--- a/gdb/testsuite/gdb.base/grbx.c
+++ b/gdb/testsuite/gdb.base/grbx.c
@@ -1,4 +1,4 @@
-static int grbxx __attribute__ ((section (".data03"))) = 'g' + 'r' + 'b' + 'x';
+static int grbxx = 'g' + 'r' + 'b' + 'x';
int grbx (int x)
{
diff --git a/gdb/testsuite/gdb.base/overlays.exp b/gdb/testsuite/gdb.base/overlays.exp
index a65adea..9188b27 100644
--- a/gdb/testsuite/gdb.base/overlays.exp
+++ b/gdb/testsuite/gdb.base/overlays.exp
@@ -178,6 +178,42 @@ gdb_expect {
timeout { fail "(timeout) Automatic unmapping" }
}
+# Verify that both sec1 and sec2 can be loaded simultaneously.
+proc simultaneous_pair { sec1 sec2 } {
+ global gdb_prompt
+
+ set pairname "$sec1 and $sec2 mapped simultaneously"
+ gdb_test "overlay map $sec1" "" "$pairname: map $sec1"
+ gdb_test "overlay map $sec2" "" "$pairname: map $sec2"
+
+ set seen_sec1 0
+ set seen_sec2 0
+
+ send_gdb "overlay list\n"
+ gdb_expect {
+ -re ".*[string_to_regexp $sec1], " { set seen_sec1 1; exp_continue }
+ -re ".*[string_to_regexp $sec2], " { set seen_sec2 1; exp_continue }
+ -re ".*$gdb_prompt $" {
+ if {$seen_sec1 && $seen_sec2} {
+ pass "$pairname"
+ } else {
+ fail "$pairname"
+ }
+ }
+ timeout { fail "(timeout) $pairname" }
+ }
+}
+
+simultaneous_pair .ovly0 .ovly2
+simultaneous_pair .ovly0 .ovly3
+simultaneous_pair .ovly1 .ovly2
+simultaneous_pair .ovly1 .ovly3
+
+simultaneous_pair .data00 .data02
+simultaneous_pair .data00 .data03
+simultaneous_pair .data01 .data02
+simultaneous_pair .data01 .data03
+
# test automatic mode
gdb_test "overlay auto" ""