From 1a7f57e783c19d20bbaf4c3686dcfa8d13780da5 Mon Sep 17 00:00:00 2001 From: Stu Grossman Date: Sat, 25 Mar 1995 00:41:54 +0000 Subject: [PATCH] * configure.in: Move test for m68*-est-* before m68*-*-coff*. * findvar.c: Move default def of CANNOT_STORE_REGISTER closer to the beginning of the code. * (write_register_gen): New routine. Analogous to read_register_gen. * (write_register_bytes): Another rewrite! Make it smarter about not updating regs with the same value. * monitor.c (printf_monitor readchar): Use stderr instead of stdout to output debug info. Also cleanup readchar a little. * (expect): Make sure that excessive responses are null terminated. * (monitor_open): Check for magic number in monitor_ops struct. Allow multiple commands as init strings. Also, clear all breakpoints. * (monitor_resume monitor_wait): Send a command to dump all the regs for those targets which don't do so when waking up after a continue command. * (monitor_wait): Handle excessive response output better. * (monitor_write_memory): Use block fill, word, and long word commands (if they exist) to write memory more efficiently. * General cleanups to use flag bits instead of individual flag words in monitor_ops struct. * (monitor_command): Return output from command. * (monitor_load_srec): Allocate buffer only once. Use alloca. Wait for load response string instead of using a timeout to start sending S-records. Fix bug where value of srec_frame shrinks. If hashmark is set, print `-' for retransmissions. General cleanups. * (monitor_make_srec): Get rid of S-record default type kludge. * monitor.h: Use seperate struct for memory and register read/write commands. Memory commands can come in byte, word, long, and longlong forms. * (monitor_ops): Change lots of fields. Generalize some stuff. Put all flags into flags word. Allow init to be a list of commands. Add command for clearing all breakpoints, block fill, dumping all registers. * remote-est.c: Rewrite to use new monitor conventions. * config/m68k/est.mt (TDEPFILES): Add monitor.o. * config/m68k/tm-est.h: Set NUM_REGS to 18. * testsuite/gdb.base/break.exp: Lots of cleanups. Use gdb_test more thoroughly. --- gdb/testsuite/gdb.base/break.exp | 52 ++++++-------------------------- 1 file changed, 10 insertions(+), 42 deletions(-) diff --git a/gdb/testsuite/gdb.base/break.exp b/gdb/testsuite/gdb.base/break.exp index 1cec7dbfc80..f2f56fb87bd 100644 --- a/gdb/testsuite/gdb.base/break.exp +++ b/gdb/testsuite/gdb.base/break.exp @@ -143,6 +143,9 @@ if !$usestubs then { } } +gdb_test $cmd "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:56.*56\[\t \]+if .argc.*" \ + "run until function breakpoint" + # # run until the breakpoint at a line number # @@ -192,36 +195,15 @@ expect { # # test temporary breakpoint at function # -send "tbreak main\n" -expect { - -re "Breakpoint.*at.* file .*$srcfile, line.*$prompt $" { - pass "Temporary breakpoint function" - } - -re ".*$prompt $" { - pass "Temporary breakpoint function" - } - timeout { - fail "(timeout) breakpoint function" - } -} +gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" # # test break at function in file # -send "tbreak $srcfile:factorial\n" -expect { - -re "Breakpoint.*at.* file .*$srcfile, line.*$prompt $" { - pass "Temporary breakpoint function in file" - } - -re ".*$prompt $" { - pass "Temporary breakpoint function in file" - } - timeout { - fail "(timeout) breakpoint function in file" - } -} +gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ + "Temporary breakpoint function in file" # # test break at line number @@ -233,6 +215,7 @@ expect { timeout { fail "(timeout) breakpoint line number" } } +gdb_test "tbreak 60" "Breakpoint.*at.* file .*$srcfile, line 60.*" "Temporary breakpoint line number" # # test break at line number in file @@ -244,6 +227,7 @@ expect { timeout { fail "(timeout) breakpoint line number in file" } } +gdb_test "tbreak $srcfile:66" "Breakpoint.*at.* file .*$srcfile, line 66.*" "Temporary breakpoint line number in file" # # check to see what breakpoints are set (temporary this time) @@ -261,7 +245,6 @@ expect { timeout { fail "(timeout) Temporary breakpoint info" } } - proc test_clear_command {} { gdb_test "break main" "Breakpoint.*at.*" gdb_test "break main" "Breakpoint.*at.*" @@ -292,11 +275,7 @@ proc test_next_with_recursion {} { delete_breakpoints - send "break factorial\n" - expect { - -re "Breakpoint $decimal at .*$prompt" {} - timeout { fail "break at factorial" ; return } - } + gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial" # Run until we call factorial with 6 @@ -342,18 +321,7 @@ proc test_next_with_recursion {} { delete_breakpoints - send "next\n" - expect { - -re "return .value.;.*$prompt $" { - # Note that the correct behavior is for GDB to *not* print the - # frame. - pass "next over recursive call" - } - -re ".*$prompt $" { - fail "next over recursive call" ; return - } - timeout { fail "next over recursive call (timeout)" ; return } - } + gdb_test next "75\[\t \]+return \\(value\\);.*" "next over recursive call" # OK, we should be back in the same stack frame we started from. # Do a backtrace just to confirm. -- 2.30.2