From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30816 invoked by alias); 24 May 2005 02:03:21 -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 30429 invoked by uid 22791); 24 May 2005 02:03:17 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 24 May 2005 02:03:17 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DaOlI-0005ML-7V; Mon, 23 May 2005 22:03:16 -0400 Date: Tue, 24 May 2005 08:29:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] gdb.server testcases (resend) Message-ID: <20050524020316.GA20554@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb-patches@sources.redhat.com References: <1116490026.428c492a8f3d8@imap.linux.ibm.com> <20050522171520.GA1223@nevyn.them.org> <20050523123820.GB23940@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00525.txt.bz2 On Tue, May 24, 2005 at 02:32:09AM -0700, Wu Zhou wrote: > > > normally factorial(6) will recursively call itself 5 times and return > > > 720. However while using 64-bit gdbserver on 64-bit binary, it doesn't > > > call factorial(5) at all, return directly 6 as the result. > > > > > > I am suspecting that "value > 1" doesn't get executed, so I change the > > > conditional statement to "if (value - 1)", it worked! So it turn out > > > that "value > 1" always return 0 in this running context. That is really > > > odd. Any clues you could thought of? Thanks in advance. > > > > Um... your compiler must be broken, then. > > Um...can't understand this. If it is like this, how to interpret the fact > that it returns 720 correctly to run gdb.base/break standalone. Anyway I > will try to find another box or another compiler to verify this. Thanks. I missed that in your message. The other alternative is that a breakpoint is somehow corrupting program state (condition codes, for instance). This could be a kernel bug or a GDB bug; it wouldn't be the first time. -- Daniel Jacobowitz CodeSourcery, LLC