From: Paul Gilliam <pgilliam@us.ibm.com>
To: gdb-patches@sources.redhat.com
Subject: Avoid timeouts in call-sc.exp
Date: Wed, 18 Aug 2004 21:28:00 -0000 [thread overview]
Message-ID: <200408181426.30208.pgilliam@us.ibm.com> (raw)
The test "call-sc.exp" will attemt to "finish" from main if the prevous
"return foo" failed. Here is what happens:
257 gdb_test_multiple "return foo" "${test}" {
If this works, then we are in "main". If it doesn't work (say, due to a gdb
bug) then we are left in the function "fun".
334 gdb_test "advance fun" \
If the "return foo" worked, then this positions us at the start of fun(). If
it didn't work, then this acts like "finish" and we return from the current
function.
356 gdb_test_multiple "finish" "${test}" {
if the "return foo" worked, then we just finish fun(). If not, then we are
attemting to "finish" from main() and the program under test is in an
infinite loop (due to the way it's coded).
This patch fixes this problem by checking to see if the "return foo" worked or
not. If it worked, fine: things are as before. But if it didn't work, the
"finish" is skipped.
-=# Paul #=-
PS: Trying this by hand, the "finish" would complain something like:
"can't 'finish' from the outer most block"
but only if I didn't follow the test case exactly.
Here is the patch:
diff new/call-sc.exp old/call-sc.exp
334,348c334,336
< set test "advance to fun for finish; ${tests}"
< set skip_finish 0
< gdb_test_multiple "advance fun" "${test}" {
< -re "fun .*\[\r\n\]+\[0-9\].*return foo.*" {
< pass "${test}"
< }
< -re "in main" {
< # This happens if the "return foo" failed to actually return:
< # this "advance fun" will not stop on fun, but just return from
< # the routine that "return foo" should have. Then the "finish"
< # below will try to finish "main", which causes an infinte loop.
< # So to avoid the timeout, skip the "finish".
< set skip_finish 1
< }
< }
---
> gdb_test "advance fun" \
> "fun .*\[\r\n\]+\[0-9\].*return foo.*" \
> "advance to fun for finish; ${tests}"
357,368c345,352
< if $skip_finish {
< fail "${test}"
< } else {
< gdb_test_multiple "finish" "${test}" {
< -re "Value returned is .*${gdb_prompt} $" {
< pass "${test}"
< }
< -re "Cannot determine contents.*${gdb_prompt} $" {
< # Expected bad value. For the moment this is ok.
< set finish_value_unknown 1
< pass "${test}"
< }
---
> gdb_test_multiple "finish" "${test}" {
> -re "Value returned is .*${gdb_prompt} $" {
> pass "${test}"
> }
> -re "Cannot determine contents.*${gdb_prompt} $" {
> # Expected bad value. For the moment this is ok.
> set finish_value_unknown 1
> pass "${test}"
next reply other threads:[~2004-08-18 21:28 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-18 21:28 Paul Gilliam [this message]
2004-08-18 21:58 ` Michael Chastain
2004-08-20 10:34 ` Michael Chastain
2004-08-20 16:17 ` Paul Gilliam
2004-08-23 21:11 ` Paul Gilliam
2004-08-23 21:55 ` Michael Chastain
2004-08-24 16:15 ` Paul Gilliam
2004-08-24 17:26 ` Michael Chastain
2004-08-24 18:50 ` Paul Gilliam
2004-08-24 18:52 ` Daniel Jacobowitz
2004-08-24 18:55 ` Michael Chastain
2004-08-24 19:14 ` Paul Gilliam
2004-08-25 17:54 ` Paul Gilliam
2004-08-25 18:11 ` Michael Chastain
2004-08-25 18:21 ` Paul Gilliam
2004-08-25 18:52 ` Michael Chastain
2004-08-25 19:08 ` Paul Gilliam
2004-08-26 14:17 ` Michael Chastain
2004-08-26 16:17 ` Paul Gilliam
2004-08-26 16:26 ` Michael Chastain
2004-08-26 16:34 ` Paul Gilliam
[not found] ` <200408261227.58890.pgilliam@us.ibm.com>
[not found] ` <412E5915.8010401@gnu.org>
2004-08-31 19:30 ` Paul Gilliam
2004-08-31 20:48 ` Paul Gilliam
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=200408181426.30208.pgilliam@us.ibm.com \
--to=pgilliam@us.ibm.com \
--cc=gdb-patches@sources.redhat.com \
/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