aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp
diff options
context:
space:
mode:
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 .*"
+}