From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9175 invoked by alias); 12 Feb 2006 20:10:16 -0000 Received: (qmail 9166 invoked by uid 22791); 12 Feb 2006 20:10:16 -0000 X-Spam-Check-By: sourceware.org Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 12 Feb 2006 20:10:14 +0000 Received: from [::1] (duck.specifix.com [64.220.152.99]) by duck.specifix.com (Postfix) with ESMTP id 95616FC4C; Sun, 12 Feb 2006 12:10:11 -0800 (PST) From: Fred Fish Reply-To: fnf@specifix.com To: gdb-patches@sourceware.org Subject: [PATCH] Fix problem with scope.exp test, skipping past init0 call Date: Sun, 12 Feb 2006 20:10:00 -0000 User-Agent: KMail/1.9.1 Cc: fnf@specifix.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602121510.01657.fnf@specifix.com> Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00272.txt.bz2 I noticed the following failures while running the gdb testsuite and decided to investigate: Running /src/latest/trunk/src/gdb/gdb/testsuite/gdb.base/scope.exp ... FAIL: gdb.base/scope.exp: next over init0() in main FAIL: gdb.base/scope.exp: print filelocal_bss FAIL: gdb.base/scope.exp: print 'scope0.c'::filelocal_bss in test_at_main FAIL: gdb.base/scope.exp: print 'scope1.c'::filelocal_bss The problem was triggered by the fact that the breakpoint on main was being set at the opening brace and then the first next only took us to the init0 call. This might be a bug in it's own right, but scope.exp is supposed to handle this as a side effect of an attempt to skip __main: # skip past init. There may be a call to __main at the start of # main, so the first next may only get us to the init0 call. if [gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main" "$decimal.*init0 \\(\\);" "next"] { gdb_suppress_tests ; } However, it appears that you can only using the additional "QUESTION RESPONSE" args to gdb_test for true questions (that don't end in a newline) and not for the way attempted here. The following patch fixes the problem. 2006-02-12 Fred Fish * gdb.base/scope.exp (test_at_main): Use gdb_test_multiple to handle cases where it takes two "next" commands to skip past the init call. Index: scope.exp =================================================================== RCS file: /cvsroots/latest/src/gdb/gdb/testsuite/gdb.base/scope.exp,v retrieving revision 1.1.1.1 diff -c -p -r1.1.1.1 scope.exp *** scope.exp 8 Oct 2005 19:36:19 -0000 1.1.1.1 --- scope.exp 12 Feb 2006 20:04:37 -0000 *************** proc test_at_main {} { *** 63,70 **** # skip past init. There may be a call to __main at the start of # main, so the first next may only get us to the init0 call. ! if [gdb_test "next" "$decimal.*foo \\(\\);" "next over init0() in main" "$decimal.*init0 \\(\\);" "next"] { ! gdb_suppress_tests ; } --- 63,80 ---- # skip past init. There may be a call to __main at the start of # main, so the first next may only get us to the init0 call. ! gdb_test_multiple "next" "next over init0() in main" { ! -re "$decimal.*foo \\(\\).*$gdb_prompt $" { ! pass "next over init0() in main" ! } ! -re "$decimal.*init0 \\(\\).*$gdb_prompt $" { ! send_gdb "next\n" ! exp_continue ! } ! -re ".*$gdb_prompt $" { ! fail "next over init0() in main" ! gdb_suppress_tests ! } }