aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-06-25 15:32:49 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-06-25 15:32:49 +0000
commitaf76db58d70f013feb5e5854ea8bd23929275b7b (patch)
treedc1f334c1981cfc733858d449220fe1e67fb5fec /gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
parent1b3d1dbfad9b7e43048f995ebe1ec1908664c1d9 (diff)
downloadgdb-af76db58d70f013feb5e5854ea8bd23929275b7b.zip
gdb-af76db58d70f013feb5e5854ea8bd23929275b7b.tar.gz
gdb-af76db58d70f013feb5e5854ea8bd23929275b7b.tar.bz2
gdb/testsuite/
* gdb.dwarf2/dw2-ref-missing-frame-main.c: New. * gdb.dwarf2/dw2-ref-missing-frame.S: Replace compiler generated output by a hand made one. * gdb.dwarf2/dw2-ref-missing-frame.exp: Remove invalid comment. Remove i?86 requirement. Remove variables srcfile and binfile. New variable sources, executable_nofb and executable_fb. Call prepare_for_testing.
Diffstat (limited to 'gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp')
-rw-r--r--gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp35
1 files changed, 11 insertions, 24 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
index a0f8b65..a508bde 100644
--- a/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
+++ b/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
@@ -13,8 +13,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Minimal DWARF-2 unit test
-
# This test can only be run on targets which support DWARF-2 and use gas.
# For now pick a sampling of likely targets.
if {![istarget *-*-linux*]
@@ -26,37 +24,26 @@ if {![istarget *-*-linux*]
return 0
}
-if {![istarget "i?86-*-*"]} then {
- return 0
-}
-
set testfile "dw2-ref-missing-frame"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}
+set sources [list ${testfile}-main.c ${testfile}.S]
# First try referencing DW_AT_frame_base which is not defined.
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list {additional_flags=-DNO_FRAME_BASE}]] != "" } {
+set executable_nofb ${testfile}-nofb
+if { [prepare_for_testing ${testfile}.exp $executable_nofb $sources {nodebug additional_flags=-DNO_FRAME_BASE}] } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-runto_main
-
-gdb_test "p var" {Could not find the frame base for "main".}
+if [runto_main] {
+ gdb_test "p main_var" {Could not find the frame base for "main".}
+}
# And now try referencing DW_AT_frame_base defined using a self-reference
# (DW_OP_fbreg).
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {}] != "" } {
+set executable_fb ${testfile}-fb
+if { [prepare_for_testing ${testfile}.exp $executable_fb $sources {nodebug}] } {
return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-runto_main
-
-gdb_test "p var" "DWARF-2 expression error: Loop detected .*"
+if [runto_main] {
+ gdb_test "p main_var" "DWARF-2 expression error: Loop detected .*"
+}