This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit/testsuite/Ada] Avoid the use of gdb_start_cmd


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.

Tested on x86_64-linux.  Checked in.

---
 gdb/testsuite/ChangeLog                            |   15 +++++++++++++++
 gdb/testsuite/gdb.ada/exec_changed.exp             |    7 +++++++
 gdb/testsuite/gdb.ada/null_record.exp              |   10 ++--------
 gdb/testsuite/gdb.ada/null_record/null_record.adb  |    2 +-
 gdb/testsuite/gdb.ada/print_pc.exp                 |   10 ++--------
 gdb/testsuite/gdb.ada/start.exp                    |    7 +++++++
 gdb/testsuite/gdb.ada/start/dummy.adb              |    2 +-
 gdb/testsuite/gdb.ada/uninitialized_vars.exp       |   10 ++--------
 gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb |    2 +-
 9 files changed, 38 insertions(+), 27 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index fcb694b..7240089 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -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.
diff --git a/gdb/testsuite/gdb.ada/exec_changed.exp b/gdb/testsuite/gdb.ada/exec_changed.exp
index 78fdd0d..dc08d78 100644
--- a/gdb/testsuite/gdb.ada/exec_changed.exp
+++ b/gdb/testsuite/gdb.ada/exec_changed.exp
@@ -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}
 
diff --git a/gdb/testsuite/gdb.ada/null_record.exp b/gdb/testsuite/gdb.ada/null_record.exp
index eab6f13..6ed8585 100644
--- a/gdb/testsuite/gdb.ada/null_record.exp
+++ b/gdb/testsuite/gdb.ada/null_record.exp
@@ -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" \
diff --git a/gdb/testsuite/gdb.ada/null_record/null_record.adb b/gdb/testsuite/gdb.ada/null_record/null_record.adb
index 133913f..4735521 100644
--- a/gdb/testsuite/gdb.ada/null_record/null_record.adb
+++ b/gdb/testsuite/gdb.ada/null_record/null_record.adb
@@ -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;
 
diff --git a/gdb/testsuite/gdb.ada/print_pc.exp b/gdb/testsuite/gdb.ada/print_pc.exp
index 34f10b3..a7a098c 100644
--- a/gdb/testsuite/gdb.ada/print_pc.exp
+++ b/gdb/testsuite/gdb.ada/print_pc.exp
@@ -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\]+" \
diff --git a/gdb/testsuite/gdb.ada/start.exp b/gdb/testsuite/gdb.ada/start.exp
index 4307e42..2c000a8 100644
--- a/gdb/testsuite/gdb.ada/start.exp
+++ b/gdb/testsuite/gdb.ada/start.exp
@@ -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
diff --git a/gdb/testsuite/gdb.ada/start/dummy.adb b/gdb/testsuite/gdb.ada/start/dummy.adb
index cf6139d..ecde19f 100644
--- a/gdb/testsuite/gdb.ada/start/dummy.adb
+++ b/gdb/testsuite/gdb.ada/start/dummy.adb
@@ -16,5 +16,5 @@
 
 procedure Dummy is
 begin
-   null;
+   null;  -- START
 end Dummy;
diff --git a/gdb/testsuite/gdb.ada/uninitialized_vars.exp b/gdb/testsuite/gdb.ada/uninitialized_vars.exp
index f590579..b6ec6fa 100644
--- a/gdb/testsuite/gdb.ada/uninitialized_vars.exp
+++ b/gdb/testsuite/gdb.ada/uninitialized_vars.exp
@@ -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" \
diff --git a/gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb b/gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb
index 489eead..95c475c 100644
--- a/gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb
+++ b/gdb/testsuite/gdb.ada/uninitialized_vars/parse.adb
@@ -19,7 +19,7 @@
 
 with Parse_Controlled;
 
-procedure Parse is
+procedure Parse is -- START
 
    A  : aliased Integer := 1;
 
-- 
1.7.1


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]