Re: [PATCH 2/4] Error on bad count number

Pedro Alves
2014-03-05T15:59:00Z

On 03/05/2014 02:29 PM, Joel Brobecker wrote:
>> GDB is quiet for these invalid input like this
>>
>> (gdb) enable count 1.1 1
>> (gdb)
>>
>> This patch is to check the input number is valid, and emit error if
>> input number isn't valid. With this patch, it becomes:
>>
>> (gdb) enable count 1.1 1
>> Bad count number '1.1 1'
>>
>> gdb:
>>
>> 2014-03-05 Yao Qi <yao@codesourcery.com>
>>
>> * breakpoint.c (enable_count_command): Emit error if 'count'
>> is zero.
>>
>> gdb/testsuite:
>>
>> 2014-03-05 Yao Qi <yao@codesourcery.com>
>>
>> * gdb.base/ena-dis-br.exp: Test bad count number.
>
> I had a slight hesitation here, as we are now going to actively
> reject "enable count 0 1" where it used to be accepted. But since
> it makes little sense, and does not work, I think that's OK.
> Example of it not working:

I had the same thought. I wondered whether 0 was meant to
remove the enable count, but the docs don't say anything
about it. Is there another way to disable the count, and
bring back the disposition to enabled? If not, I wonder
whether using 0 for that would be a good idea?

--
Pedro Alves