aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/miscexprs.exp
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-10-31 20:59:22 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-10-31 20:59:22 +0000
commitaaa68313b8a2c635670eb03130a4d06f195c93c5 (patch)
treede551a4e45ed596c745a0877cde3b92ee0112712 /gdb/testsuite/gdb.base/miscexprs.exp
parentb433d00bbcd022648dc2dc07f12a4adad7940fce (diff)
downloadgdb-aaa68313b8a2c635670eb03130a4d06f195c93c5.zip
gdb-aaa68313b8a2c635670eb03130a4d06f195c93c5.tar.gz
gdb-aaa68313b8a2c635670eb03130a4d06f195c93c5.tar.bz2
* gdb.base/miscexprs.c (main): Add usage of preprocessor
symbol `STORAGE' to allow to choose the storage class of the local datastructures. * gdb.base/miscexprs.exp: Handle setting a `-DSTORAGE=...' compiler directive.
Diffstat (limited to 'gdb/testsuite/gdb.base/miscexprs.exp')
-rw-r--r--gdb/testsuite/gdb.base/miscexprs.exp13
1 files changed, 12 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/miscexprs.exp b/gdb/testsuite/gdb.base/miscexprs.exp
index 795fc3e..ad8e11d 100644
--- a/gdb/testsuite/gdb.base/miscexprs.exp
+++ b/gdb/testsuite/gdb.base/miscexprs.exp
@@ -30,6 +30,17 @@ if $tracelevel then {
strace $tracelevel
}
+# By default, the datastructures are allocated on the stack. For targets
+# with very small stack, that will not work. In that case, just set
+# storage to `-DSTORAGE=static' which changes the datastructures to be
+# allocated in data segment.
+set storage "-DSTORAGE="
+if [target_info exists gdb,small_stack_section] {
+ set storage "-DSTORAGE=static"
+}
+
+set additional_flags "additional_flags=-w ${storage}"
+
#
# test running programs
#
@@ -40,7 +51,7 @@ set testfile "miscexprs"
set srcfile ${testfile}.c
set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-w}] != "" } {
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ${additional_flags}]] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}