Avoid the use of gdb_start_cmd in gdb.ada/*.exp testcases.
authorJoel Brobecker <brobecker@gnat.com>
Thu, 6 Jan 2011 10:33:38 +0000 (10:33 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 6 Jan 2011 10:33:38 +0000 (10:33 +0000)
This command does not work when testing with GDBserver.  So this patch
changes the few tests that do not specifically test the `start' command,
and replace calls to gdb_start_cmd with the usual `run LOC' approach.

For the couple of testcases that do really test the `start' command,
do an early return as UNTESTED instead of running this testcase.

gdb/testsuite/ChangeLog:

Add marker to be used as anchor for inserting breakpoints.
* gdb.ada/null_record/null_record.adb: Add "-- START" comment.
* gdb.ada/start/dummy.adb, gdb.ada/uninitialized_vars/parse.adb:
Likewise.

Remove uses of gdb_start_cmd.
* gdb.ada/null_record.exp: Remove use of gdb_start_cmd.
* gdb.ada/print_pc.exp, gdb.ada/uninitialized_vars.exp: Ditto.

Do not run testcase if testing with GDBserver.
* gdb.ada/exec_changed.exp, gdb.ada/start.exp: Abort as untested
if testing with GDBserver.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.ada/exec_changed.exp
gdb/testsuite/gdb.ada/null_record.exp
gdb/testsuite/gdb.ada/null_record/null_record.adb
gdb/testsuite/gdb.ada/print_pc.exp
gdb/testsuite/gdb.ada/start.exp
gdb/testsuite/gdb.ada/start/dummy.adb
gdb/testsuite/gdb.ada/uninitialized_vars.exp
gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb

index fcb694b..7240089 100644 (file)
@@ -1,5 +1,20 @@
 2011-01-06  Joel Brobecker  <brobecker@adacore.com>
 
+       Add marker to be used as anchor for inserting breakpoints.
+       * gdb.ada/null_record/null_record.adb: Add "-- START" comment.
+       * gdb.ada/start/dummy.adb, gdb.ada/uninitialized_vars/parse.adb:
+       Likewise.
+
+       Remove uses of gdb_start_cmd.
+       * gdb.ada/null_record.exp: Remove use of gdb_start_cmd.
+       * gdb.ada/print_pc.exp, gdb.ada/uninitialized_vars.exp: Ditto.
+
+       Do not run testcase if testing with GDBserver.
+       * gdb.ada/exec_changed.exp, gdb.ada/start.exp: Abort as untested
+       if testing with GDBserver.
+
+2011-01-06  Joel Brobecker  <brobecker@adacore.com>
+
        * gdb.ada/complete/foo.adb, gdb.ada/complete/pck.adb,
        gdb.ada/complete/pck.ads, gdb.ada/print_chars/foo.adb: Add
        copyright header.
index 78fdd0d..dc08d78 100644 (file)
@@ -21,6 +21,13 @@ 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 exec_changed.exp
+    return
+}
+
 set testdir "exec_changed"
 file mkdir ${objdir}/${subdir}/${testdir}
 
index eab6f13..6ed8585 100644 (file)
@@ -36,14 +36,8 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if { [gdb_start_cmd] < 0 } {
-    untested start
-    return -1
-}
-
-gdb_test "" \
-         "null_record \\(\\) at .*null_record.adb.*" \
-         "start"
+set bp_location [gdb_get_line_number "START" ${testdir}/null_record.adb]
+runto "null_record.adb:$bp_location"
 
 gdb_test "ptype empty" \
          "type = record null; end record" \
index 133913f..4735521 100644 (file)
@@ -19,6 +19,6 @@ with Bar; use Bar;
 procedure Null_Record is
    E : Void_Star := new Empty;
 begin
-   Do_Nothing (E);
+   Do_Nothing (E);  -- START
 end Null_Record;
 
index 34f10b3..a7a098c 100644 (file)
@@ -34,14 +34,8 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-if { [gdb_start_cmd] < 0 } {
-    untested start
-    return -1
-}
-
-gdb_test "" \
-         "dummy \\(\\) at .*dummy.adb:.*" \
-         "start inferior"
+set bp_location [gdb_get_line_number "START" ${testdir}/dummy.adb]
+runto "dummy.adb:$bp_location"
 
 gdb_test "p /x \$pc" \
          "= 0x\[0-9a-zA-Z\]+" \
index 4307e42..2c000a8 100644 (file)
@@ -21,6 +21,13 @@ 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 exec_changed.exp
+    return
+}
+
 set testdir "start"
 set testfile "${testdir}/dummy"
 set srcfile ${srcdir}/${subdir}/${testfile}.adb
index cf6139d..ecde19f 100644 (file)
@@ -16,5 +16,5 @@
 
 procedure Dummy is
 begin
-   null;
+   null;  -- START
 end Dummy;
index f590579..b6ec6fa 100644 (file)
@@ -39,14 +39,8 @@ gdb_load ${binfile}
 
 # Start the program; we should land in the program main procedure, before
 # variable initialization.
-if { [gdb_start_cmd] < 0 } {
-    untested start
-    return -1
-}
-
-gdb_test "" \
-         "parse \\(\\) at .*parse.adb.*" \
-         "start"
+set bp_location [gdb_get_line_number "START" ${testdir}/parse.adb]
+runto "parse.adb:$bp_location"
 
 # Check that printing uninitialized variables does not crash the debugger.
 gdb_test "info locals" \
index 489eead..95c475c 100644 (file)
@@ -19,7 +19,7 @@
 
 with Parse_Controlled;
 
-procedure Parse is
+procedure Parse is -- START
 
    A  : aliased Integer := 1;