From: Jim Blandy <jimb@cygnus.com>
To: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Cc: gdb-patches@cygnus.com
Subject: Re: Bogus stepi/nexti test
Date: Mon, 08 Mar 1999 06:41:00 -0000 [thread overview]
Message-ID: <np3e3gvybj.fsf@zwingli.cygnus.com> (raw)
Message-ID: <19990308064100.ADuO4fKzbg33ju6bFvQqKY1DI2EXHKZMjeUYW9Aalkc@z> (raw)
In-Reply-To: <vyz90er8y09.fsf@issan.cs.uni-dortmund.de>
> The stepi/nexti tests in gdb.base/step-test.exp are completely bogus and
> must be removed.
I took a different approach. This isn't in GDB yet. Your comments
would be welcome.
1999-03-03 Jim Blandy <jimb@zwingli.cygnus.com>
* gdb.base/step-test.exp: Rewrite `stepi' and `nexti' tests to be
more portable.
Index: step-test.exp
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/testsuite/gdb.base/step-test.exp,v
retrieving revision 1.2
diff -c -c -r1.2 step-test.exp
*** step-test.exp 1999/02/05 02:56:20 1.2
--- step-test.exp 1999/03/04 04:38:50
***************
*** 67,86 ****
# Step out of call
#
gdb_test "finish" ".*30.*a.*5.*= a.*3.*" "step out"
! # Instruction stepping, into
! #
! gdb_test "stepi" ".*30.*a.*5.* = a.*3.*" "stepi 1"
! gdb_test "stepi" ".*30.*a\\\[5\\\] = a.*" "stepi 2"
! gdb_test "stepi 7" ".*6.*glob.*" "stepi into"
! gdb_test "finish" ".*34.*callee.*NEXTI.*" "stepi out"
! # Instruction stepping, over
! #
! gdb_test "nexti" ".*callee.*NEXTI.*" "nexti 1"
! gdb_test "c" ".*Program exited normally.*" "run to finish"
return 0
--- 67,138 ----
# Step out of call
#
+ # I wonder if this is really portable. Are there any caller-saves
+ # platforms, on which `finish' will return you to some kind of pop
+ # instruction, which is attributed to the line containing the function
+ # call?
gdb_test "finish" ".*30.*a.*5.*= a.*3.*" "step out"
! ### Testing nexti and stepi.
! ###
! ### test_i NAME COMMAND HERE THERE
! ###
! ### Send COMMAND to gdb over and over, while the output matches the
! ### regexp HERE, followed by the gdb prompt. Pass if the output
! ### eventually matches the regexp THERE, followed by the gdb prompt;
! ### fail if we have to iterate more than a hundred times, we time out
! ### talking to gdb, or we get output which is neither HERE nor THERE. :)
! ###
! ### Use NAME as the name of the test.
! ###
! ### The exact regexps used are "$HERE.*$gdb_prompt $"
! ### and "$THERE.*$gdb_prompt $"
! ###
! proc test_i {name command here there} {
! global gdb_prompt
!
! set i 0
! while 1 {
! send_gdb "${command}\n"
! gdb_expect {
! -re "$here.*$gdb_prompt $" {
! # Okay, we're still on the same line. Just step again.
! }
! -re "$there.*$gdb_prompt $" {
! # We've reached the next line. Rah.
! pass "$name"
! return
! }
! -re "$gdb_prompt $" {
! # We got something else. Fail.
! fail "$name"
! return
! }
! timeout {
! fail "$name (timeout)"
! return
! }
! }
! # Have we gone for too many steps without seeing any progress?
! if {[incr i] >= 100} {
! fail "$name"
! return
! }
! }
! }
! test_i "stepi to next line" "stepi" \
! ".*30.*a.*5.* = a.*3" \
! ".*31.*callee.*STEPI"
! test_i "stepi into function" "stepi" \
! ".*31.*callee.*STEPI" \
! ".*callee \\(\\) at .*step-test\\.c"
! gdb_test "finish" ".*34.*callee.*NEXTI.*" "stepi: finish call"
! test_i "nexti over function" "nexti" \
! ".*34.*callee.*NEXTI" \
! ".*36.*y = w \\+ z;"
! gdb_test "continue" ".*Program exited normally.*" "run to finish"
return 0
next prev parent reply other threads:[~1999-03-08 6:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-04-01 0:00 Andreas Schwab
1999-01-25 2:09 ` Andreas Schwab
1999-04-01 0:00 ` Jim Blandy [this message]
1999-03-08 6:41 ` Jim Blandy
1999-04-01 0:00 ` Andreas Schwab
1999-03-12 1:19 ` Andreas Schwab
1999-04-12 13:01 ` Jim Blandy
1999-04-12 12:05 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=np3e3gvybj.fsf@zwingli.cygnus.com \
--to=jimb@cygnus.com \
--cc=gdb-patches@cygnus.com \
--cc=schwab@issan.informatik.uni-dortmund.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox