This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC] gdb.server testcases (resend)
On Mon, 23 May 2005, Daniel Jacobowitz wrote:
> 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!
ok, I got it. I will read your proposal more carefully. Thanks.
> > 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.
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.
Cheers
- Wu Zhou