From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3485 invoked by alias); 23 May 2005 12:38:39 -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 3417 invoked by uid 22791); 23 May 2005 12:38:26 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 23 May 2005 12:38:26 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DaCCK-0006Fu-Pg; Mon, 23 May 2005 08:38:20 -0400 Date: Mon, 23 May 2005 18:26:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: Manoj Iyer , gdb-patches@sources.redhat.com Subject: Re: [RFC] gdb.server testcases (resend) Message-ID: <20050523123820.GB23940@nevyn.them.org> Mail-Followup-To: Wu Zhou , Manoj Iyer , gdb-patches@sources.redhat.com References: <1116490026.428c492a8f3d8@imap.linux.ibm.com> <20050522171520.GA1223@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/msg00517.txt.bz2 On Mon, May 23, 2005 at 06:57:48AM -0700, Wu Zhou wrote: > > > Yes, this will not work. The correct way to handle this is to wait > > until I have implemented the available target features proposal I've > > posted on gdb@, and then I can make gdbserver inform GDB that 64-bit > > registers are available so that it will expect them. > > So you are going to add a command for gdbserver to notify remote gdb > the availability of 64-bit registers? That is good. But I am also > thinking of other ways. The first solution I thought of is to let > gdbserver choose which set of registers to use according to the > arch (32-bit or 64-bit) of the debuggee. The other solution I could > thought of is to let host-side gdb accept 64-bit register as well. > I even tried some coding with the second method. It seems that it > worked sorta, at least I can set breakpoint, continue the process > and so on. But I did met problems with "next" and "step" commands, > which didn't go on with executing the process at all. > > Because I am not that familar with the code of gdb/gdbserver, so I > am not very sure where to find the root cause of these problems. I > am also not sure whether these two methods are workable? Would you > please help evaluate this? If it is really workable, what is the > pros and cons of these methods compared to your proposal? Thanks > a lot! Don't do that. Please go read my proposal on gdb@, paying particular attention to the description of the MIPS execution environment. The reason to always provide 64-bit registers if they are available is that they are physically present; the upper 32 bits can affect the behavior of the program in some cases. So not displaying them can be very bad! > That SIGFPE error disappeared after applying your patch to latest > GDB cvs tree. But I met with another strange problem when debugging > gdb.base/break, which defines the following function: > > int factorial (value) > int value; > #endif > { > if (value > 1) { /* set breakpoint 7 here */ > value *= factorial (value - 1); > } > return (value); /* set breakpoint 19 here */ > } > > 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. -- Daniel Jacobowitz CodeSourcery, LLC