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 fcb694b80d7f6f8b73eb12fa7d44e622a1ca8715..724008923141a6385ae721f311e6b9a1b5c475e6 100644 (file)
@@ -1,3 +1,18 @@
+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,
index 78fdd0d20782908abe8c56c25314073bbe6c6cfc..dc08d78e7ee1687dd6ab1de574c781c2a52da90c 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 eab6f1317e45f51ca8c98e4f92f3eb1b20429edd..6ed8585cf0ae39643e9515f08fd9b52b806e78bc 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 133913fdd37bbbad9d981ce1fd4311fa01ab1f1b..4735521b5d044bbb8e7faa4ae18fc78cabce3c4b 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 34f10b3b4cfa9a9bb0b5ec5ac69b8eed7fc42c5b..a7a098c6056773c6f7542d9188128d936392df99 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 4307e42cbd5ee1b9b9ee7a8c0bb1c518d879ad3d..2c000a8fccf56a6dc172f6a5d3c17b54d0578fb9 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 cf6139d0eb5ed31634e0def5666b6f37b4d23655..ecde19f094f1bb836b82eba00e37daf6fa220479 100644 (file)
@@ -16,5 +16,5 @@
 
 procedure Dummy is
 begin
-   null;
+   null;  -- START
 end Dummy;
index f5905798dfd581084fd2d097b6f9e325c486e91d..b6ec6fa585eacfabb2ccf268c7062d4fd1805514 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 489eeada705b8f71413a510a7d6197a9d59ba3fe..95c475c3a079168a7b8b463c70d517b64d6e9b60 100644 (file)
@@ -19,7 +19,7 @@
 
 with Parse_Controlled;
 
-procedure Parse is
+procedure Parse is -- START
 
    A  : aliased Integer := 1;
 
This page took 0.043159 seconds and 4 git commands to generate.