This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Add new overlay test from Jim Blandy
- From: Michael Snyder <msnyder at cygnus dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: jimb at redhat dot com
- Date: Fri, 12 Apr 2002 17:10:08 -0700
- Subject: [PATCH] Add new overlay test from Jim Blandy
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.
Index: overlays.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/overlays.exp,v
retrieving revision 1.12
diff -c -3 -p -r1.12 overlays.exp
*** overlays.exp 2002/02/06 17:15:23 1.12
--- overlays.exp 2002/04/13 00:15:13
*************** gdb_expect {
*** 185,190 ****
--- 191,232 ----
-re ".*$gdb_prompt $" { pass "Automatic unmapping" }
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
Index: foo.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/foo.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 foo.c
*** foo.c 1998/02/19 00:54:15 1.4
--- foo.c 2002/04/13 00:15:13
***************
*** 1,4 ****
! static int foox __attribute__ ((section (".data00"))) = 'f' + 'o' + 'o';
int foo (int x)
{
--- 1,4 ----
! static int foox = 'f' + 'o' + 'o';
int foo (int x)
{
Index: bar.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/bar.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 bar.c
*** bar.c 1998/02/19 00:54:17 1.4
--- bar.c 2002/04/13 00:15:13
***************
*** 1,4 ****
! static int barx __attribute__ ((section (".data01"))) = 'b' + 'a' + 'r';
int bar (int x)
{
--- 1,4 ----
! static int barx = 'b' + 'a' + 'r';
int bar (int x)
{
Index: baz.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/baz.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 baz.c
*** baz.c 1998/02/19 00:54:18 1.4
--- baz.c 2002/04/13 00:15:13
***************
*** 1,4 ****
! static int bazx __attribute__ ((section (".data02"))) = 'b' + 'a' + 'z';
int baz (int x)
{
--- 1,4 ----
! static int bazx = 'b' + 'a' + 'z';
int baz (int x)
{
Index: grbx.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/grbx.c,v
retrieving revision 1.4
diff -c -3 -p -r1.4 grbx.c
*** grbx.c 1998/02/19 00:54:19 1.4
--- grbx.c 2002/04/13 00:15:13
***************
*** 1,4 ****
! static int grbxx __attribute__ ((section (".data03"))) = 'g' + 'r' + 'b' + 'x';
int grbx (int x)
{
--- 1,4 ----
! static int grbxx = 'g' + 'r' + 'b' + 'x';
int grbx (int x)
{