From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11163 invoked by alias); 12 Apr 2010 09:58:30 -0000 Received: (qmail 11152 invoked by uid 22791); 12 Apr 2010 09:58:30 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Apr 2010 09:58:25 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3C9wNaM019612 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Apr 2010 05:58:23 -0400 Received: from localhost.localdomain (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3C9wMh3024465 for ; Mon, 12 Apr 2010 05:58:23 -0400 Message-ID: <4BC2EEBE.8090404@redhat.com> Date: Mon, 12 Apr 2010 09:58:00 -0000 From: Phil Muldoon User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b2pre Thunderbird/3.0.3 MIME-Version: 1.0 To: gdb-patches ml Subject: [python][obv] Make result in testsuite/gdb.python/py-breakpoints.c global Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00340.txt.bz2 Pedro Alves noticed and brought to my attention on irc that one of the Python breakpoints test fails locally for him. When I tested it locally, it worked ok for me. So we investigated. Subsequently it was found (by Pedro, (thanks!) that the test was bogus. The test was running to main and setting the watchpoint on 'result'. But 'result' was not initialized in the (main) code at this point. So if 'result' happened to 0 the test would work (as it did for me); however as the inferior is at the main () line, equally 'result' could be any uninitialized value, and the test would fail. I fixed this by making 'result' global in the testcase. This ensures that 'result' is always at the expected value '0' at main. I'm checking this in under the obvious rule. Cheers, Phil -- 2010-04-12 Phil Muldoon * gdb.python/py-breakpoint.c: Make result global. -- Index: testsuite/gdb.python/py-breakpoint.c =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.python/py-breakpoint.c,v retrieving revision 1.1 diff -r1.1 py-breakpoint.c 19a20 + int result = 0; 36d36 - int result = 0;