aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Manson <manson@cygnus>1997-09-17 05:24:14 +0000
committerBob Manson <manson@cygnus>1997-09-17 05:24:14 +0000
commitf33e31a61a235532ba472159729f181bcf375558 (patch)
treeec61a03ee453cd3e3bc98eb153fa8ce962132257
parenta183753d9249f8156cbfbfe08b94b1525ef6b2d0 (diff)
downloadgdb-f33e31a61a235532ba472159729f181bcf375558.zip
gdb-f33e31a61a235532ba472159729f181bcf375558.tar.gz
gdb-f33e31a61a235532ba472159729f181bcf375558.tar.bz2
* gdb.base/callfuncs.exp: Fix indentation.
* lib/gdb.exp(gdb_expect): Set remote_suppress_flag if suppress_flag has been set. (gdb_step_for_stub): Check for gdb,use_breakpoint_for_stub target feature.
-rw-r--r--gdb/testsuite/ChangeLog9
-rw-r--r--gdb/testsuite/lib/gdb.exp101
2 files changed, 68 insertions, 42 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 4bee3ea..28150d7 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,12 @@
+Tue Sep 16 22:21:48 1997 Bob Manson <manson@charmed.cygnus.com>
+
+ * gdb.base/callfuncs.exp: Fix indentation.
+
+ * lib/gdb.exp(gdb_expect): Set remote_suppress_flag if
+ suppress_flag has been set.
+ (gdb_step_for_stub): Check for gdb,use_breakpoint_for_stub
+ target feature.
+
Mon Sep 15 15:43:17 1997 Bob Manson <manson@charmed.cygnus.com>
* gdb.stabs/weird.exp: Don't start gdb 'til after we've compiled
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 9a3f2c5..6710ea7 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -879,7 +879,24 @@ proc gdb_expect { args } {
}
}
}
+ global suppress_flag;
+ global remote_suppress_flag;
+ if [info exists remote_suppress_flag] {
+ set old_val $remote_suppress_flag;
+ }
+ if [info exists suppress_flag] {
+ if { $suppress_flag } {
+ set remote_suppress_flag 1;
+ }
+ }
set code [catch {uplevel remote_expect host $gtimeout $expcode} string];
+ if [info exists old_val] {
+ set remote_suppress_flag $old_val;
+ } else {
+ if [info exists remote_suppress_flag] {
+ unset remote_suppress_flag;
+ }
+ }
if {$code == 1} {
global errorInfo errorCode;
@@ -1048,58 +1065,58 @@ proc setup_xfail_format { format } {
proc gdb_step_for_stub { } {
global gdb_prompt;
- if [target_info exists gdb_stub_step_command] {
- set command [target_info gdb_stub_step_command];
- } else {
- set command "step";
- }
- send_gdb "${command}\n";
- set tries 0;
- gdb_expect 60 {
- -re "(main.* at |.*in .*start).*$gdb_prompt" {
- return;
+ if ![target_info exists gdb,use_breakpoint_for_stub] {
+ if [target_info exists gdb_stub_step_command] {
+ set command [target_info gdb_stub_step_command];
+ } else {
+ set command "step";
}
- -re "libgloss/\[a-z\]*\[0-9\]*/stub.c" {
- send_gdb "where\n";
- gdb_expect {
- -re "main\[^\r\n\]*at \(\[^:]+\):\(\[0-9\]+\)" {
- set file $expect_out(1,string);
- set linenum [expr $expect_out(2,string) + 1];
- set breakplace "${file}:${linenum}";
- }
- default {}
- }
- send_gdb "break ${breakplace}\n";
- gdb_expect 60 {
- -re "Breakpoint (\[0-9\]+) at.*$gdb_prompt" {
- set breakpoint $expect_out(1,string);
- }
- -re "Breakpoint (\[0-9\]+): file.*$gdb_prompt" {
- set breakpoint $expect_out(1,string);
- }
- default {}
+ send_gdb "${command}\n";
+ set tries 0;
+ gdb_expect 60 {
+ -re "(main.* at |.*in .*start).*$gdb_prompt" {
+ return;
}
- send_gdb "continue\n";
- gdb_expect 60 {
- -re "Breakpoint ${breakpoint},.*$gdb_prompt" {
- gdb_test "delete $breakpoint" ".*" "";
+ -re ".*$gdb_prompt" {
+ incr tries;
+ if { $tries == 5 } {
+ fail "stepping out of breakpoint function";
return;
}
- default {}
+ send_gdb "${command}\n";
+ exp_continue;
}
- }
- -re ".*$gdb_prompt" {
- incr tries;
- if { $tries == 5 } {
+ default {
fail "stepping out of breakpoint function";
return;
}
- send_gdb "${command}\n";
- exp_continue;
}
- default {
- fail "stepping out of breakpoint function";
+ }
+ send_gdb "where\n";
+ gdb_expect {
+ -re "main\[^\r\n\]*at \(\[^:]+\):\(\[0-9\]+\)" {
+ set file $expect_out(1,string);
+ set linenum [expr $expect_out(2,string) + 1];
+ set breakplace "${file}:${linenum}";
+ }
+ default {}
+ }
+ send_gdb "break ${breakplace}\n";
+ gdb_expect 60 {
+ -re "Breakpoint (\[0-9\]+) at.*$gdb_prompt" {
+ set breakpoint $expect_out(1,string);
+ }
+ -re "Breakpoint (\[0-9\]+): file.*$gdb_prompt" {
+ set breakpoint $expect_out(1,string);
+ }
+ default {}
+ }
+ send_gdb "continue\n";
+ gdb_expect 60 {
+ -re "Breakpoint ${breakpoint},.*$gdb_prompt" {
+ gdb_test "delete $breakpoint" ".*" "";
return;
}
+ default {}
}
}