From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4032 invoked by alias); 23 Aug 2004 21:55:36 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4018 invoked from network); 23 Aug 2004 21:55:35 -0000 Received: from unknown (HELO hall.mail.mindspring.net) (207.69.200.60) by sourceware.org with SMTP; 23 Aug 2004 21:55:35 -0000 Received: from user-119a90a.biz.mindspring.com ([66.149.36.10] helo=berman.michael-chastain.com) by hall.mail.mindspring.net with esmtp (Exim 3.33 #1) id 1BzMms-000818-00; Mon, 23 Aug 2004 17:55:34 -0400 Received: from mindspring.com (localhost [127.0.0.1]) by berman.michael-chastain.com (Postfix) with SMTP id B7E4E4B102; Mon, 23 Aug 2004 17:55:50 -0400 (EDT) Date: Mon, 23 Aug 2004 21:55:00 -0000 From: Michael Chastain To: pgilliam@us.ibm.com, gdb-patches@sources.redhat.com Subject: Re: Avoid timeouts in call-sc.exp Message-ID: <412A67E6.nailD782KDIOT@mindspring.com> References: <200408181426.30208.pgilliam@us.ibm.com> <4125D3DA.nailK4211PQ8Y@mindspring.com> <200408231408.53088.pgilliam@us.ibm.com> In-Reply-To: <200408231408.53088.pgilliam@us.ibm.com> User-Agent: nail 10.8 6/28/04 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00633.txt.bz2 Paul Gilliam 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.