This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
gdb testsuite top level patch
- To: gdb-patches@sourceware.cygnus.com
- Subject: gdb testsuite top level patch
- From: Jimmy Guo <guo@cup.hp.com>
- Date: Thu, 22 Jul 1999 17:27:20 -0700 (PDT)
This patch is for gdb/testsuite/ configure configure.in lib/gdb.exp.
configure[.in] now has a configdir entry for gdb.fortran, for which
another patch will be submitted which includes new fortran tests from
HP.
lib/gdb.exp changes are:
- use larger timeouts in proc delete_breakpoints.
- add -notransfer expect option to gdb_expect command issused by
gdb_test, when multiple gdb commands need to be sent to gdb.
this keeps all outputs from the chain of commands in expect buffer to
be used for the subsequent pattern matching.
- add fortran support to get_compiler_info / gdb_preprocess
- Jimmy Guo, guo@cup.hp.com
Index: gdb/testsuite/configure
/opt/gnu/bin/diff -c -N -L gdb/testsuite/configure gdb/testsuite/configure@@/GDB_1999_07_19 gdb/testsuite/configure
*** gdb/testsuite/configure
--- gdb/testsuite/configure Fri Jun 25 16:47:00 1999
***************
*** 639,651 ****
# Directories to use in all configurations.
configdirs="gdb.asm \
! gdb.base \
! gdb.c++ \
! gdb.disasm \
! gdb.chill \
! gdb.threads \
! gdb.trace"
!
# Directories to use for a configuration which uses stabs.
stabsdirs="gdb.stabs"
--- 639,651 ----
# Directories to use in all configurations.
configdirs="gdb.asm \
! gdb.base \
! gdb.c++ \
! gdb.disasm \
! gdb.chill \
! gdb.fortran \
! gdb.threads \
! gdb.trace"
# Directories to use for a configuration which uses stabs.
stabsdirs="gdb.stabs"
Index: gdb/testsuite/configure.in
/opt/gnu/bin/diff -c -N -L gdb/testsuite/configure.in gdb/testsuite/configure.in@@/GDB_1999_07_19 gdb/testsuite/configure.in
*** gdb/testsuite/configure.in
--- gdb/testsuite/configure.in Fri Jun 25 16:47:02 1999
***************
*** 14,26 ****
# Directories to use in all configurations.
configdirs="gdb.asm \
! gdb.base \
! gdb.c++ \
! gdb.disasm \
! gdb.chill \
! gdb.threads \
! gdb.trace"
!
# Directories to use for a configuration which uses stabs.
stabsdirs="gdb.stabs"
--- 14,26 ----
# Directories to use in all configurations.
configdirs="gdb.asm \
! gdb.base \
! gdb.c++ \
! gdb.disasm \
! gdb.chill \
! gdb.fortran \
! gdb.threads \
! gdb.trace"
# Directories to use for a configuration which uses stabs.
stabsdirs="gdb.stabs"
Index: gdb/testsuite/lib/gdb.exp
/opt/gnu/bin/diff -c -N -L gdb/testsuite/lib/gdb.exp gdb/testsuite/lib/gdb.exp@@/GDB_1999_07_19 gdb/testsuite/lib/gdb.exp
*** gdb/testsuite/lib/gdb.exp
--- gdb/testsuite/lib/gdb.exp Thu Jul 22 17:15:32 1999
***************
*** 131,138 ****
proc delete_breakpoints {} {
global gdb_prompt
send_gdb "delete breakpoints\n"
! gdb_expect 30 {
-re "Delete all breakpoints.*y or n.*$" {
send_gdb "y\n";
exp_continue
--- 131,141 ----
proc delete_breakpoints {} {
global gdb_prompt
+ # we need a larger timeout value here or this thing just confuses
+ # itself. May need a better implementation if possible. - guo
+ #
send_gdb "delete breakpoints\n"
! gdb_expect 100 {
-re "Delete all breakpoints.*y or n.*$" {
send_gdb "y\n";
exp_continue
***************
*** 142,148 ****
timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
}
send_gdb "info breakpoints\n"
! gdb_expect 30 {
-re "No breakpoints or watchpoints..*$gdb_prompt $" {}
-re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
-re "Delete all breakpoints.*or n.*$" {
--- 145,151 ----
timeout { perror "Delete all breakpoints in delete_breakpoints (timeout)" ; return }
}
send_gdb "info breakpoints\n"
! gdb_expect 100 {
-re "No breakpoints or watchpoints..*$gdb_prompt $" {}
-re "$gdb_prompt $" { perror "breakpoints not deleted" ; return }
-re "Delete all breakpoints.*or n.*$" {
***************
*** 376,382 ****
fail "$message";
return $result;
}
! gdb_expect 2 {
-re "\[\r\n\]" { }
timeout { }
}
--- 379,390 ----
fail "$message";
return $result;
}
! # since we're checking if each line of the multi-line
! # command are 'accepted' by GDB here,
! # we need to set -notransfer expect option so that
! # command output is not lost for pattern matching
! # - guo
! gdb_expect -notransfer 2 {
-re "\[\r\n\]" { }
timeout { }
}
***************
*** 885,891 ****
return 1;
}
}
! } else {
if { [eval gdb_preprocess \
[list "${srcdir}/${subdir}/compiler.c" "${binfile}.ci"] \
$args] != "" } {
--- 893,899 ----
return 1;
}
}
! } elseif { $args != "f77" } {
if { [eval gdb_preprocess \
[list "${srcdir}/${subdir}/compiler.c" "${binfile}.ci"] \
$args] != "" } {
***************
*** 932,984 ****
return 0;
}
! proc gdb_preprocess {source dest args} {
! global CC_FOR_TARGET
! global CXX_FOR_TARGET
! if { [llength $args] == 0 } {
set which_compiler "c"
} else {
if { $args =="c++" } {
set which_compiler "c++"
} else {
perror "Unknown compiler type supplied to gdb_preprocess"
! return 1;
}
}
if [info exists CC_FOR_TARGET] {
! if { $which_compiler == "c"} {
! set compiler $CC_FOR_TARGET;
}
}
if [info exists CXX_FOR_TARGET] {
! if { $which_compiler == "c++"} {
! set compiler $CXX_FOR_TARGET;
}
}
if { ![info exists compiler] } {
if { $which_compiler == "c" } {
if {[info exists CC]} {
! set compiler $CC;
}
}
if { $which_compiler == "c++" } {
if {[info exists CXX]} {
! set compiler $CXX;
}
}
if {![info exists compiler]} {
set compiler [board_info [target_info name] compiler];
if { $compiler == "" } {
! puts "default_target_compile: No compiler to compile with";
! return "default_target_compile: No compiler to compile with";
}
}
}
set cmdline "$compiler -E $source > $dest"
verbose "Invoking $compiler -E $source > $dest"
--- 940,1009 ----
return 0;
}
! proc get_compiler {args} {
! global CC CC_FOR_TARGET CXX CXX_FOR_TARGET F77_FOR_TARGET
! if { [llength $args] == 0
! || ([llength $args] == 1 && [lindex $args 0] == "") } {
set which_compiler "c"
} else {
if { $args =="c++" } {
set which_compiler "c++"
+ } elseif { $args =="f77" } {
+ set which_compiler "f77"
} else {
perror "Unknown compiler type supplied to gdb_preprocess"
! return ""
}
}
if [info exists CC_FOR_TARGET] {
! if {$which_compiler == "c"} {
! set compiler $CC_FOR_TARGET
}
}
if [info exists CXX_FOR_TARGET] {
! if {$which_compiler == "c++"} {
! set compiler $CXX_FOR_TARGET
! }
! }
!
! if [info exists F77_FOR_TARGET] {
! if {$which_compiler == "f77"} {
! set compiler $F77_FOR_TARGET
}
}
if { ![info exists compiler] } {
if { $which_compiler == "c" } {
if {[info exists CC]} {
! set compiler $CC
}
}
if { $which_compiler == "c++" } {
if {[info exists CXX]} {
! set compiler $CXX
}
}
if {![info exists compiler]} {
set compiler [board_info [target_info name] compiler];
if { $compiler == "" } {
! perror "get_compiler: No compiler found"
! return ""
}
}
}
+ return $compiler
+ }
+
+ proc gdb_preprocess {source dest args} {
+ set compiler [get_compiler "$args"]
+ if { $compiler == "" } {
+ return 1
+ }
+
set cmdline "$compiler -E $source > $dest"
verbose "Invoking $compiler -E $source > $dest"
***************
*** 1034,1039 ****
--- 1059,1078 ----
#
proc gdb_expect { args } {
+ # allow -notransfer expect flag specification,
+ # used by gdb_test routine for multi-line commands.
+ # packed with gtimeout when fed to remote_expect routine,
+ # which is a hack but due to what looks like a res and orig
+ # parsing problem in remote_expect routine (dejagnu/lib/remote.exp):
+ # what's fed into res is not removed from orig.
+ # - guo
+ if { [lindex $args 0] == "-notransfer" } {
+ set notransfer -notransfer;
+ set args [lrange $args 1 end];
+ } else {
+ set notransfer "";
+ }
+
if { [llength $args] == 2 && [lindex $args 0] != "-re" } {
set gtimeout [lindex $args 0];
set expcode [list [lindex $args 1]];
***************
*** 1073,1079 ****
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 {
--- 1112,1119 ----
set remote_suppress_flag 1;
}
}
! set code [catch \
! {uplevel remote_expect host "$gtimeout $notransfer" $expcode} string];
if [info exists old_val] {
set remote_suppress_flag $old_val;
} else {