Index: gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp |
diff --git a/gdb/testsuite/gdb.ada/start.exp b/gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp |
similarity index 59% |
copy from gdb/testsuite/gdb.ada/start.exp |
copy to gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp |
index c36db3f02eab6ad3c33d9f733c7fda08cd8ed9f2..7f6f1d3ad95a8143f5f2cdf064f53dd97bcdf88e 100644 |
--- a/gdb/testsuite/gdb.ada/start.exp |
+++ b/gdb/testsuite/gdb.ada/set_pckd_arr_elt.exp |
@@ -1,4 +1,4 @@ |
-# Copyright 2005, 2007-2012 Free Software Foundation, Inc. |
+# Copyright 2012 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 |
@@ -13,23 +13,12 @@ |
# You should have received a copy of the GNU General Public License |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
-if $tracelevel then { |
- strace $tracelevel |
-} |
- |
load_lib "ada.exp" |
if { [skip_ada_tests] } { return -1 } |
-# This testcase verifies the behavior of the `start' command, which |
-# does not work when we use the gdb stub... |
-if [target_info exists use_gdb_stub] { |
- untested start.exp |
- return |
-} |
- |
-set testdir "start" |
-set testfile "${testdir}/dummy" |
+set testdir "set_pckd_arr_elt" |
+set testfile "${testdir}/foo" |
set srcfile ${srcdir}/${subdir}/${testfile}.adb |
set binfile ${objdir}/${subdir}/${testfile} |
@@ -40,12 +29,19 @@ if {[gdb_compile_ada "${srcfile}" "${binfile}" executable {debug}] != ""} { |
clean_restart ${testfile} |
-# Verify that "start" lands inside the right procedure. |
-if { [gdb_start_cmd] < 0 } { |
- untested start |
- return -1 |
-} |
+set bp_location [gdb_get_line_number "STOP" ${testdir}/foo.adb] |
+runto "foo.adb:$bp_location" |
+ |
+gdb_test "print sa(3) := 9" " = 9" |
+ |
+# To verify that the assignment was made correctly, we use the fact |
+# that the program passes this very same element as an argument to |
+# one of the functions. So we insert a breakpoint on that function, |
+# and verify that the argument value is correct. |
+ |
+gdb_breakpoint "update_small" |
+ |
+gdb_test "continue" \ |
+ "Breakpoint .*, pck\\.update_small \\(s=9\\) at .*pck.adb:.*" \ |
+ "continue to update_small" |
-gdb_test "" \ |
- "dummy \\(\\) at .*dummy.adb.*" \ |
- "start" |