This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [testsuite/alpha] Add test for step over fbne instruction
- From: Richard Henderson <rth at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 19 May 2005 23:18:10 -0700
- Subject: Re: [testsuite/alpha] Add test for step over fbne instruction
- References: <20050520034254.GZ1462@adacore.com>
On Fri, May 20, 2005 at 01:42:54PM +1000, Joel Brobecker wrote:
> int
> main (void)
> {
> gt ();
>
> return 0;
> }
>
> /* gt(). Obtained from the following code:
>
> void
> gt (void)
> {
> double a = 360.0;
>
> if (a > 0)
> a = 0.0;
> else
> a = -a;
> }
>
> The purpose of the test is to stop just before the check against
> zero, and do a stepi. GDB should step one instruction and stop,
> rather than letting the program continue until the it terminates. */
>
> asm(" .rdata\n"
> " .align 3\n"
.rdata is an ecoff thing; it won't work for elf systems. I suggest
that you pass in this data from main and leave the symbol work to
the compiler. That is,
extern double gt(double);
int main ()
{
gt (360.0);
gt (-360.0);
return 0;
}
/* double gt(double a)
{
if (a > 0)
a = 0;
else
a = -a;
return a;
}
*/
asm (
" .text\n"
" .ent gt\n"
"gt:\n"
" .frame $30,0,$26,0"
" .prologue 0\n"
" cpys $f31,$f31,$f0\n"
" fble $f16,$gt_1\n" /* stop at this instruction. */
" cpysn $f16,$f16,$f0\n"
"$gt_1:\n"
" ret $31,($26),1\n"
" .end gt\n");
I might also suggest that you test both branch directions.
r~