Re: [testsuite/alpha] Add test for step over fbne instruction

Richard Henderson
2005-05-26T03:11:40Z

On Thu, May 26, 2005 at 12:35:39PM +1000, Joel Brobecker wrote:
> " cpys $f31,$f31,$f0\n"
> " fbgt $f16,$gt_1\n" /* stop at this instruction. */
> " cpysn $f16,$f16,$f0\n"
> "$gt_1:\n"
> " ret $31,($26),1\n"

Hmm, now that I think about it, one potential problem with this form
is that we're not correctly testing for branch taken. The scenerio
is that we expect taken, set the bp on the ret, the branch *isn't*
taken, but we fall through to the ret anyway.

We'd do better to write this

" fbgt $f16,$gt_1\n" /* stop at this instruction. */
" cpysn $f16,$f16,$f0\n"
" ret $31,($26),1\n"
"$gt_1:\n"
" ret $31,($26),1\n"

so that if we choose wrong, we will in fact lose control.

r~