Re: [PATCH] Fix PR 17206

Pedro Alves
2014-07-28T14:26:57Z

On 07/28/2014 02:33 PM, Yao Qi wrote:
> On 07/28/2014 08:37 PM, Pedro Alves wrote:
>> This looks right, but, could we add a test to the test suite?
>
> Sure, how about the test below? Without the fix, I get the fail
>
> FAIL: gdb.base/until-range-step.exp: until 2 (GDB internal error)
>
> on x86-linux and arm-none-eabi. With the fix applied, the fail goes
> away. I am not sure the test case name is good or clear enough.

From a high-level perspective, the issue triggered when you did
"until" and PC pointed somewhere we had no debug info for, and there
was no breakpoint at PC that needed to be stepped over. That is
main use case and code path that we didn't have a test for.

Note that although it happened to be a range-stepping-related assertion
that triggered, the code was wrong even without range-stepping. E.g.,
if the instruction at PC is a conditional jmp to PC (like a spinlock),
even without range-stepping, "until" should continue stepping until
PC moves past the jump (that's the whole point of until), while
it was stopping after one single-step, thus still pointing at the
same PC.

So I think "until-nodebug.exp" would be a good name for this test.

> Maybe we can rename it to pr17206.exp or something else.

We avoid such numeric names that make it harder to tell what's
being exercised.

The test itself looks good. Thanks!

Pedro Alves