Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Chastain <mec.gnu@mindspring.com>
To: pgilliam@us.ibm.com, gdb-patches@sources.redhat.com
Subject: Re: Avoid timeouts in call-sc.exp
Date: Mon, 23 Aug 2004 21:55:00 -0000	[thread overview]
Message-ID: <412A67E6.nailD782KDIOT@mindspring.com> (raw)
In-Reply-To: <200408231408.53088.pgilliam@us.ibm.com>

Paul Gilliam <pgilliam@us.ibm.com> wrote:
> What is the purpose of 'try_finish'?  I don't see how the test 'if
> (try_finish == 0)' will ever fail to be true.  What am I missing?

The idea is to allow either this:

  backtrace 1
  #0 int main() ... blah
  (gdb) PASS: return foo; synchronize pc to main

Or this:

  backtrace 1
  #0 ... fun () ... blah
  #1 int main () ... blah
  (gdb) finish
  finishing ... blah
  (gdb) backtrace 1
  #0 int main () ... blah
  (gdb) PASS: return foo; synchronize pc to main

In the first case, the program counter is already back in main()
after the call to "return", and everything is cool.

In the second case, "return" spazzed out, and the program counter
is still left back inside fun().  That's the case that attracted
you to call-sc.exp.

What I tried to write was:

  int try_finish = 0;
  while (gdb is stuck in fun())
  {
    if (try_finish == 0)
    {
      try_finish++;
      tell gdb to "finish";
      continue;
    }
  }

But exp_continue does not quite work because it does not re-issue
the "backtrace 1" command.

The simple way out is not to use exp_continue:

  set test "return foo; synchronize pc to main"
  gdb_test_multiple "backtrace 1" $test {
    -re "#0.*main \\(\\).*$gdb_prompt $" {
      pass $test
    }
    -re "#0.*fun \\(\\).*$gdb_prompt $" {
      gdb_test "finish" ".*" ""
      gdb_test "backtrace 1" "#0.*main \\(\\)" $test
    }

Can you play with that?

Also I am still hoping to see the gdb.log file from your system
where call-sc.exp has this problem.


  reply	other threads:[~2004-08-23 21:55 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-18 21:28 Paul Gilliam
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 [this message]
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=412A67E6.nailD782KDIOT@mindspring.com \
    --to=mec.gnu@mindspring.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=pgilliam@us.ibm.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