diff options
author | Fred Fish <fnf@specifix.com> | 1996-08-12 22:38:30 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1996-08-12 22:38:30 +0000 |
commit | d9538961ccee460bce76d0e940a305c15eb171bf (patch) | |
tree | 5ffee54c19cdae0d9f8de39c4594cd9f8cfbfb85 /gdb/testsuite | |
parent | ed36b6cd33d1ca80753808fdb9a93e5af3cb9a25 (diff) | |
download | gdb-d9538961ccee460bce76d0e940a305c15eb171bf.zip gdb-d9538961ccee460bce76d0e940a305c15eb171bf.tar.gz gdb-d9538961ccee460bce76d0e940a305c15eb171bf.tar.bz2 |
* gdb.base/a1-selftest.exp (do_steps_and_nexts): New routine to
encapsulate all the steps/nexts done during self test, starting
at main, and makes them less sensitive to optimization issues.
Add "hppa*-*-hpux*" to setup_xfail for "backtrace through
signal handler" test.
* gdb.threads/pthreads.exp: Only run this for native configs.
* gdb.base/signals.exp (test_handle_all_print): Remove code that
increased timeouts, it now makes no difference.
* gdb.base/structs.exp (do_function_calls): Add hppa*-*-hpux9*"
setup_xfails for "p fun5()", "p fun6()", "p fun7()", and "p fun8"
tests.
gdb.c++/virtfunc.exp (do_tests): Add "mips-*-irix5*" setup_xfail
for "runto test_calls(void)" test.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/ChangeLog | 16 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/a1-selftest.exp | 366 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/signals.exp | 9 | ||||
-rw-r--r-- | gdb/testsuite/gdb.base/structs.exp | 4 |
4 files changed, 142 insertions, 253 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 146d404..9de57b9 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,19 @@ +Mon Aug 12 15:29:08 1996 Fred Fish <fnf@cygnus.com> + + * gdb.base/a1-selftest.exp (do_steps_and_nexts): New routine to + encapsulate all the steps/nexts done during self test, starting + at main, and makes them less sensitive to optimization issues. + Add "hppa*-*-hpux*" to setup_xfail for "backtrace through + signal handler" test. + * gdb.threads/pthreads.exp: Only run this for native configs. + * gdb.base/signals.exp (test_handle_all_print): Remove code that + increased timeouts, it now makes no difference. + * gdb.base/structs.exp (do_function_calls): Add hppa*-*-hpux9*" + setup_xfails for "p fun5()", "p fun6()", "p fun7()", and "p fun8" + tests. + gdb.c++/virtfunc.exp (do_tests): Add "mips-*-irix5*" setup_xfail + for "runto test_calls(void)" test. + Sun Aug 11 13:11:24 1996 Fred Fish <fnf@cygnus.com> * gdb.base/term.exp: Set 7-bit strings, address off, width to 0, diff --git a/gdb/testsuite/gdb.base/a1-selftest.exp b/gdb/testsuite/gdb.base/a1-selftest.exp index c7c25fb..5699ad8 100644 --- a/gdb/testsuite/gdb.base/a1-selftest.exp +++ b/gdb/testsuite/gdb.base/a1-selftest.exp @@ -39,6 +39,108 @@ if [istarget "m68k*-*-hpux*"] then { return -1 } +# Not all of the lines of code near the start of main are executed for +# every machine. Also, optimization may reorder some of the lines. +# So all we do is try to step or next over everything until we get +# to a line that we know is always executed. + +proc do_steps_and_nexts {} { + global prompt + + for {set count 0} {$count < 20} {incr count} { + send "list\n" + expect { + -re ".*symarg = NULL.*$prompt $" { + set description "step over symarg initialization" + set command "step" + } + -re ".*execarg = NULL.*$prompt $" { + set description "step over execarg initialization" + set command "step" + } + -re ".*corearg = NULL.*$prompt $" { + set description "step over corearg initialization" + set command "step" + } + -re ".*cdarg = NULL.*$prompt $" { + set description "step over cdarg initialization" + set command "step" + } + -re ".*ttyarg = NULL.*$prompt $" { + set description "step over ttyarg initialization" + set command "step" + } + -re ".*time_at_startup = get_run_time.*$prompt $" { + set description "next over get_run_time and everything it calls" + set command "next" + } + -re ".*START_PROGRESS.*$prompt $" { + set description "next over START_PROGRESS and everything it calls" + set command "next" + } + -re ".*mac_init.*$prompt $" { + set description "next over mac_init and everything it calls" + set command "next" + } + -re ".*init_malloc.*$prompt $" { + set description "next over init_malloc and everything it calls" + set command "next" + } + -re ".*SET_TOP_LEVEL.*$prompt $" { + set description "next over SET_TOP_LEVEL call" + set command "next" + } + -re ".*cmdsize = 1.*$prompt $" { + set description "step over cmdsize initialization" + set command "next" + } + -re ".*cmdarg = .* xmalloc.*$prompt $" { + set description "next over cmdarg initialization via xmalloc" + set command "next" + } + -re ".*ncmd = 0.*$prompt $" { + set description "next over ncmd initialization" + set command "next" + } + -re ".*dirsize = 1.*$prompt $" { + set description "next over dirsize initialization" + set command "next" + } + -re ".*dirarg = .* xmalloc.*$prompt $" { + return + } + -re "\[ \t\]+\{\r\n$prompt $" { + setup_xfail "mips-*-irix5*" + fail "$description ended up at odd location" + } + -re ".*main.c.*No such file or directory" { + setup_xfail "rs6000-*-aix3*" + fail "must be able to list source lines" + return + } + default { + fail "unknown source line near main" + return + } + } + send "$command\n" + expect { + -re ".*No such file or directory.\r\n$prompt $" { + fail "$description (no source available)" + } + -re ".*A file or directory .* does not exist..\r\n$prompt $" { + fail "$description (no source available)" + } + -re ".*$prompt $" { + pass "$description" + } + timeout { + fail "$description (timeout)" + } + } + } +} + proc test_with_self {} { global prompt global tool @@ -99,6 +201,11 @@ proc test_with_self {} { "set interrupt character in test_with_self" } + # FIXME: If we put this after the run to main, the first list + # command doesn't print the same line as the current line where + # gdb is stopped. + send "set listsize 1\n" ; expect -re "$prompt $" + # run yourself # It may take a very long time for the inferior gdb to start (lynx), # so we bump it back up for the duration of this command. @@ -146,40 +253,14 @@ proc test_with_self {} { timeout { fail "(timeout) printed version" } } - # lets do a few single steps - - set description "step over symarg initialization" - send "step\n" - expect { - -re "char \[*\]+execarg = NULL;.*$prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } + do_steps_and_nexts - set description "step over execarg initialization" - send "step\n" + set description "print a string" + send "print \"foo\"\n" expect { - -re "char \[*\]corearg = NULL;.*$prompt $" { + -re ".\[0-9\]+ = \"foo\".*$prompt $" { pass "$description" } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } -re ".*$prompt $" { fail "$description" } @@ -188,41 +269,22 @@ proc test_with_self {} { } } - set description "step over corearg initialization" - send "step\n" - expect { - -re "char \[*\]cdarg = NULL;.*$prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - - set ttyarg_in_delay_slot 0 - set description "step over cdarg initialization" + # do_steps_and_nexts left us ready to execute an xmalloc call, + # so give that a try. + # If we don't actually enter the xmalloc call when we give a + # step command that seems like a genuine bug. It seems to happen + # on most RISC processors. + setup_xfail "alpha-*-*" "hppa*-*-*" "mips-*-*" + set description "step into xmalloc call" send "step\n" expect { - -re "char \[*\]ttyarg = NULL;.*$prompt $" { - pass "$description" - } - -re ".*time_at_startup = get_run_time .*$prompt $" { + -re "xmalloc.*size=.*at.*utils.c.*$prompt $" { pass "$description" - set ttyarg_in_delay_slot 1 } -re ".*No such file or directory.\r\n$prompt $" { pass "$description (no source available)" } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { + -re "A file or directory .* does not exist..\r\n$prompt $" { pass "$description (no source available)" } -re ".*$prompt $" { @@ -232,192 +294,6 @@ proc test_with_self {} { fail "$description (timeout)" } } - - set description "step over ttyarg initialization" - if $ttyarg_in_delay_slot==1 then { - pass "$description (in delay slot)" - } else { - send "step\n" - expect { - -re ".*time_at_startup = get_run_time .*$prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - } - - # now jump over a few functions - - set description "next over get_run_time and everything it calls" - set got_over_get_run_time 0 - send "next\n" - expect { - -re ".*init_malloc.*$prompt $" { - pass "$description" - set got_over_get_run_time 1 - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - set got_over_get_run_time 1 - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - set got_over_get_run_time 1 - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - # -re "if \(setmp \(to_top_level\)\).*$prompt $" { pass "first next" } - - if $got_over_get_run_time then { - set description "next over init_malloc and everything it calls" - send "next\n" - expect { - -re "if.*SET_TOP_LEVEL.*$prompt $" { - pass "$description" - } - -re "i = .*count.*$prompt $" { - pass "$description" - set description "next over ALIGN_STACK_ON_STARTUP code" - send "next\n" - expect { - -re "if.*i != 0.*$prompt $" { - pass "$description" - send "next\n" - expect { - -re "if.*SET_TOP_LEVEL.*$prompt $" { - pass "$description" - } - -re "alloca.*$prompt $" { - send "next\n" - expect { - -re "if.*level.*$prompt $" { - pass "$description" - } - } - } - } - } - } - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - } - default { - fail "$description (timeout or eof)" - } - } - } - - set next_ok 1 - set need_to_step_over_cmdsize 1 - set description "next over SET_TOP_LEVEL call" - send "next\n" - expect { - -re "cmdsize = 1;.*$prompt $" { - pass "$description" - } - -re "cmdarg = .*xmalloc.*$prompt $" { - # This can happen in optimized code where the "cmdsize = 1" line - # is basically removed. - pass "$description" - set need_to_step_over_cmdsize 0 - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - set next_ok 0 - } - timeout { - fail "$description (timeout)" - set next_ok 0 - } - } - - set description "print a string" - send "print \"foo\"\n" - expect { - -re ".\[0-9\]+ = \"foo\".*$prompt $" { - pass "$description" - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - - if $need_to_step_over_cmdsize { - set description "step over cmdsize initialization" - send "step\n" - expect { - -re "cmdarg = .*xmalloc.*$prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - } - - # and another step for good luck - if $next_ok { - set description "step into xmalloc call" - send "step\n" - expect { - -re "xmalloc.*size=.*at.*utils.c.*$prompt $" { - pass "$description" - } - -re ".*No such file or directory.\r\n$prompt $" { - pass "$description (no source available)" - } - -re "A file or directory .* does not exist..\r\n$prompt $" { - pass "$description (no source available)" - } - -re ".*$prompt $" { - fail "$description" - } - timeout { - fail "$description (timeout)" - } - } - } # start the "xgdb" process send "continue\n" @@ -473,7 +349,7 @@ GDB.*Copyright \[0-9\]+ Free Software Foundation, Inc..*$prompt $"\ # This fails on some linux systems for unknown reasons. On the # systems where it fails, sometimes it works fine when run manually. # The testsuite failures may not be limited to just aout systems. - setup_xfail "i*86-*-linuxaout" + setup_xfail "i*86-*-linuxaout" "hppa*-*-hpux*" set description "backtrace through signal handler" send "backtrace\n" expect { diff --git a/gdb/testsuite/gdb.base/signals.exp b/gdb/testsuite/gdb.base/signals.exp index 0df1478..48ee6ed 100644 --- a/gdb/testsuite/gdb.base/signals.exp +++ b/gdb/testsuite/gdb.base/signals.exp @@ -300,16 +300,11 @@ gdb_start # This will need to be updated as the exact list of signals changes, # but I want to test that TARGET_SIGNAL_0, TARGET_SIGNAL_DEFAULT, and # TARGET_SIGNAL_UNKNOWN are skipped. -# Increase timeout and expect input buffer for large output from gdb. +# Increase expect input buffer for large output from gdb. # Allow blank or TAB as whitespace characters and test individually for # each specific signal. proc test_handle_all_print {} { - global timeout - - set oldtimeout $timeout - set timeout [expr "$timeout + 15"] - verbose "Timeout is now $timeout seconds" 2 match_max 10000 gdb_test "handle all print" \ "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\n.*" \ @@ -551,8 +546,6 @@ proc test_handle_all_print {} { gdb_test "handle all print" \ ".*EXC_BREAKPOINT\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Breakpoint.*" \ "handle all print - Breakpoint" - set timeout $oldtimeout - verbose "Timeout restored to $timeout seconds" 2 } test_handle_all_print diff --git a/gdb/testsuite/gdb.base/structs.exp b/gdb/testsuite/gdb.base/structs.exp index a3397fb..327ce3a 100644 --- a/gdb/testsuite/gdb.base/structs.exp +++ b/gdb/testsuite/gdb.base/structs.exp @@ -84,9 +84,13 @@ proc do_function_calls {} { gdb_test "p fun2()" " = {a = 97 'a', b = 98 'b'}" gdb_test "p fun3()" " = {a = 65 'A', b = 66 'B', c = 67 'C'}" gdb_test "p fun4()" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4'}" + setup_xfail "hppa*-*-hpux9*" gdb_test "p fun5()" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e'}" + setup_xfail "hppa*-*-hpux9*" gdb_test "p fun6()" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F'}" + setup_xfail "hppa*-*-hpux9*" gdb_test "p fun7()" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7'}" + setup_xfail "hppa*-*-hpux9*" gdb_test "p fun8()" " = {a = 49 '1', b = 50 '2', c = 51 '3', d = 52 '4', e = 53 '5', f = 54 '6', g = 55 '7', h = 56 '8'}" gdb_test "p fun9()" " = {a = 97 'a', b = 98 'b', c = 99 'c', d = 100 'd', e = 101 'e', f = 102 'f', g = 103 'g', h = 104 'h', i = 105 'i'}" gdb_test "p fun10()" " = {a = 65 'A', b = 66 'B', c = 67 'C', d = 68 'D', e = 69 'E', f = 70 'F', g = 71 'G', h = 72 'H', i = 73 'I', j = 74 'J'}" |