This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
RFA: test suite fixes: gdb.base/maint.exp
- To: Stan Shebs <shebs@cygnus.com>
- Subject: RFA: test suite fixes: gdb.base/maint.exp
- From: Jim Blandy <jimb@cygnus.com>
- Date: Thu, 24 Jun 1999 17:31:57 -0500 (EST)
- CC: gdb-patches@sourceware.cygnus.com
1999-06-24 Jim Blandy <jimb@zwingli.cygnus.com>
* gdb.base/maint.exp: Don't report passes more than once.
* gdb.base/maint.exp (maint info breakpoints: shlib events): This
works on Linux and Solaris now.
* gdb.base/maint.exp (maint print objfiles): Correctly and
efficiently recognize voluminous amounts of output.
* gdb.base/maint.exp (maint print symbols): This can legitimately
take a long time; use a broader timeout.
Index: maint.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/maint.exp,v
retrieving revision 1.3
diff -c -r1.3 maint.exp
*** maint.exp 1999/01/30 19:28:52 1.3
--- maint.exp 1999/06/24 22:26:09
***************
*** 176,204 ****
}
send_gdb "maint print objfiles\n"
# To avoid timeouts, we avoid expects with many .* patterns that match
! # many lines.
! gdb_expect {
! -re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n"
! { pass "maint print objfiles: header" }
! -re ".*$gdb_prompt $" { fail "maint print objfiles: header" }
! timeout { fail "(timeout) maint print objfiles: header" }
! }
! gdb_expect {
! -re ".*Psymtabs:\[\r\t \]+\n" { pass "maint print objfiles: psymtabs" }
! -re ".*$gdb_prompt $" { fail "maint print objfiles: psymtabs" }
! timeout { fail "(timeout) maint print objfiles: psymtabs" }
! }
! gdb_expect {
! -re ".*Symtabs:\[\r\t \]+\n" { pass "maint print objfiles: symtabs" }
! -re ".*$gdb_prompt $" { fail "maint print objfiles: symtabs" }
! timeout { fail "(timeout) maint print objfiles: symtabs" }
}
! gdb_expect {
! -re ".*$gdb_prompt $" { pass "maint print objfiles: prompt" }
! timeout { fail "(timeout) maint print objfiles: prompt" }
}
send_gdb "maint print psymbols\n"
gdb_expect {
-re "print-psymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
--- 176,216 ----
}
send_gdb "maint print objfiles\n"
+
# To avoid timeouts, we avoid expects with many .* patterns that match
! # many lines. Instead, we keep track of which milestones we've seen
! # in the output, and stop when we've seen all of them.
!
! set header 0
! set psymtabs 0
! set symtabs 0
! set keep_looking 1
!
! while {$keep_looking} {
! gdb_expect {
!
! -re ".*Object file.*break: Objfile at $hex, bfd at $hex, \[0-9\]* minsyms\[\r\t \]+\n" { set header 1 }
! -re ".*Psymtabs:\[\r\t \]+\n" { set psymtabs 1 }
! -re ".*Symtabs:\[\r\t \]+\n" { set symtabs 1 }
!
! -re ".*$gdb_prompt $" {
! set keep_looking 0
! }
! timeout {
! fail "(timeout) maint print objfiles"
! set keep_looking 0
! }
! }
}
!
! proc maint_pass_if {val name} {
! if $val { pass $name } else { fail $name }
}
+ maint_pass_if $header "maint print objfiles: header"
+ maint_pass_if $psymtabs "maint print objfiles: psymtabs"
+ maint_pass_if $symtabs "maint print objfiles: symtabs"
+
send_gdb "maint print psymbols\n"
gdb_expect {
-re "print-psymbols takes an output file name and optional symbol file name.*$gdb_prompt $"\
***************
*** 282,287 ****
--- 294,306 ----
timeout { fail "(timeout) maint print symbols w/o args" }
}
+ # This command can legitimately take many minutes to execute. If the
+ # executable is dynamically linked, then you get all the debugging
+ # info for the entire library --- 89Mb on my system. -jimb
+
+ set old_timeout $timeout
+ set timeout 600
+
send_gdb "maint print symbols symbols_output\n"
gdb_expect {
-re "^maint print symbols symbols_output\r\n$gdb_prompt $"\
***************
*** 291,297 ****
-re "symbols_output\r\n$gdb_prompt $"\
{
# See comments for `maint print psymbols'.
! send_gdb "shell grep 'main.*block' symbols_output\n"
gdb_expect {
-re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $"\
{ pass "maint print symbols" }
--- 310,316 ----
-re "symbols_output\r\n$gdb_prompt $"\
{
# See comments for `maint print psymbols'.
! send_gdb "shell grep 'main(.*block' symbols_output\n"
gdb_expect {
-re "int main\\(int, char \\*\\*, char \\*\\*\\); block.*$gdb_prompt $"\
{ pass "maint print symbols" }
***************
*** 309,314 ****
--- 328,334 ----
timeout { fail "(timeout) maint print symbols" }
}
+ set timeout $old_timeout
send_gdb "maint print type argc\n"
gdb_expect {
***************
*** 356,362 ****
}
# Try it again, and check for shlib event info. Not supported everywhere.
! if {! [istarget "hppa*-*-hpux*"]} then {
setup_xfail "*-*-*"
}
send_gdb "maint info breakpoints\n"
--- 376,384 ----
}
# Try it again, and check for shlib event info. Not supported everywhere.
! if {! ([istarget "hppa*-*-hpux*"]
! || [istarget "*-*-linux*"]
! || [istarget "*-*-solaris*"])} then {
setup_xfail "*-*-*"
}
send_gdb "maint info breakpoints\n"