Avoid the use of gdb_start_cmd in gdb.ada/*.exp testcases.

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.
This commit is contained in:
Joel Brobecker 2011-01-06 10:33:38 +00:00
parent 8f7e195f62
commit 8ed5dd9e5e
9 changed files with 38 additions and 27 deletions

View 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,

View 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}

View 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" \

View 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;

View 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\]+" \

View 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

View File

@ -16,5 +16,5 @@
procedure Dummy is
begin
null;
null; -- START
end Dummy;

View 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" \

View File

@ -19,7 +19,7 @@
with Parse_Controlled;
procedure Parse is
procedure Parse is -- START
A : aliased Integer := 1;