aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2005-05-18 01:38:46 +0000
committerDaniel Jacobowitz <drow@false.org>2005-05-18 01:38:46 +0000
commit96b0c7acfeaf47d7c54f42be4692de01edb9ec7e (patch)
treed27dea7debddfd83929566c69e3d6385f834ab77 /gdb/testsuite
parentddc06ef3983a99f34931e3e3b984edc3f9acf2ed (diff)
downloadgdb-96b0c7acfeaf47d7c54f42be4692de01edb9ec7e.zip
gdb-96b0c7acfeaf47d7c54f42be4692de01edb9ec7e.tar.gz
gdb-96b0c7acfeaf47d7c54f42be4692de01edb9ec7e.tar.bz2
* gdb.base/shreloc.exp: Use gdb_compile_shlib. Add support for
IBM's xlc compiler. * gdb.base/shreloc1.c (fn_1): Reference variable static_var_1. * gdb.base/shreloc2.c (fn_2): Reference variable static_var_2.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/ChangeLog8
-rw-r--r--gdb/testsuite/gdb.base/shreloc.exp53
-rw-r--r--gdb/testsuite/gdb.base/shreloc1.c2
-rw-r--r--gdb/testsuite/gdb.base/shreloc2.c2
4 files changed, 44 insertions, 21 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 29c0a6f..653d157 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-17 Paul Gilliam <pgilliam@us.ibm.com>
+ Wu Zhou <woodzltc@cn.ibm.com>
+
+ * gdb.base/shreloc.exp: Use gdb_compile_shlib. Add support for
+ IBM's xlc compiler.
+ * gdb.base/shreloc1.c (fn_1): Reference variable static_var_1.
+ * gdb.base/shreloc2.c (fn_2): Reference variable static_var_2.
+
2005-05-13 Jim Blandy <jimb@redhat.com>
* gdb.base/call-ar-st.exp: Call 'untested' and return -1 instead of
diff --git a/gdb/testsuite/gdb.base/shreloc.exp b/gdb/testsuite/gdb.base/shreloc.exp
index 55ec1e7..97ba7c0 100644
--- a/gdb/testsuite/gdb.base/shreloc.exp
+++ b/gdb/testsuite/gdb.base/shreloc.exp
@@ -1,4 +1,4 @@
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,9 +15,6 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-
# Tests for shared object file relocation. If two shared objects have
# the same load address (actually, overlapping load spaces), one of
# them gets relocated at load-time. Check that gdb gets the right
@@ -40,32 +37,50 @@ set prms_id 0
set bug_id 0
set workdir ${objdir}/${subdir}
-
-foreach module [list "shreloc" "shreloc1" "shreloc2"] {
- if {[gdb_compile "${srcdir}/${subdir}/${module}.c" "${workdir}/${module}.o" object {debug}] != ""} {
- untested "Couldn't compile ${module}.c"
- return -1
- }
+set testfile "shreloc"
+set libfile1 "shreloc1"
+set libfile2 "shreloc2"
+set srcfile $srcdir/$subdir/$testfile.c
+set lib1src $srcdir/$subdir/$libfile1.c
+set lib2src $srcdir/$subdir/$libfile2.c
+set binfile $objdir/$subdir/$testfile
+set lib1_sl $objdir/$subdir/$libfile1.sl
+set lib2_sl $objdir/$subdir/$libfile2.sl
+
+if [get_compiler_info ${binfile}] {
+ return -1
}
-set additional_flags "additional_flags=-shared"
+set lib_opts "debug"
+set exec_opts [list debug shlib=$lib1_sl shlib=$lib2_sl]
if {([istarget "*pc-cygwin"] || [istarget "*pc-mingw32"]) } {
- set additional_flags "${additional_flags} -Wl,--image-base,0x04000000"
+ lappend lib_opts "additional_flags=-Wl,--image-base,0x04000000"
}
-foreach module [list "shreloc1" "shreloc2"] {
- if {[gdb_compile "${workdir}/${module}.o" "${workdir}/${module}.dll" executable [list debug $additional_flags]] != ""} {
- untested "Couldn't link ${module}.dll"
- return -1
- }
+if [test_compiler_info "xlc-*"] {
+
+ # IBM's xlc compiler does not add static variables to the ELF symbol
+ # table by default. We need this option to make the variables show
+ # up in "maint print msymbols".
+
+ lappend lib_opts "additional_flags=-qstatsym"
+
}
-if {[gdb_compile [list "${workdir}/shreloc.o" "${workdir}/shreloc1.dll" "${workdir}/shreloc2.dll"] "${workdir}/shreloc" executable debug] != ""} {
- untested "Couldn't link shreloc executable"
+if { [gdb_compile_shlib $lib1src $lib1_sl $lib_opts] != ""} {
+ untested "Could not build $lib1_sl."
+ return -1
+} elseif { [gdb_compile_shlib $lib2src $lib2_sl $lib_opts] != ""} {
+ untested "Could not build $lib1_s2."
+ return -1
+} elseif { [gdb_compile $srcfile $binfile executable $exec_opts] != ""} {
+ untested "Could not build $binfile."
return -1
}
+# Start with a fresh gdb.
+
gdb_exit
gdb_start
gdb_reinitialize_dir $srcdir/$subdir
diff --git a/gdb/testsuite/gdb.base/shreloc1.c b/gdb/testsuite/gdb.base/shreloc1.c
index b1bffde..6a228f8 100644
--- a/gdb/testsuite/gdb.base/shreloc1.c
+++ b/gdb/testsuite/gdb.base/shreloc1.c
@@ -6,5 +6,5 @@
static int static_var_1;
-ATTRIBUTES void fn_1 (int unused) { }
+ATTRIBUTES void fn_1 (int referenced) { static_var_1 = referenced; }
ATTRIBUTES int extern_var_1 = 0;
diff --git a/gdb/testsuite/gdb.base/shreloc2.c b/gdb/testsuite/gdb.base/shreloc2.c
index 1459093..1a9b48b 100644
--- a/gdb/testsuite/gdb.base/shreloc2.c
+++ b/gdb/testsuite/gdb.base/shreloc2.c
@@ -6,5 +6,5 @@
static int static_var_2;
-ATTRIBUTES void fn_2 (int unused) { }
+ATTRIBUTES void fn_2 (int referenced) { static_var_2 = referenced; }
ATTRIBUTES int extern_var_2 = 0;