This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] linux-record: Squash cases with identical handling
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: gdb-patches at sourceware dot org, "Markus T. Metzger" <markus dot t dot metzger at intel dot com>
- Date: Tue, 19 Apr 2016 17:09:35 +0200
- Subject: Re: [PATCH] linux-record: Squash cases with identical handling
- Authentication-results: sourceware.org; auth=none
- References: <m3zisxdbgq dot fsf at oc1027705133 dot ibm dot com> <86ega9k97g dot fsf at gmail dot com> <m3shypczxm dot fsf at oc1027705133 dot ibm dot com> <868u0gmrf2 dot fsf at gmail dot com>
On Thu, Apr 14 2016, Yao Qi wrote:
> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
>
>> On Wed, Apr 13 2016, Yao Qi wrote:
>>
>>> I thought about squashing them too, but the reason I didn't do that is
>>> these enum gdb_syscall in the switch block are listed in the numeric
>>> order, so that it is quite easy to find whether a syscall is supported,
>>> or add a new syscall.
>>
>> Ah, interesting point. If we want to stick to this rule, maybe this
>> should be stated in a comment above the switch statement?
>>
>
> It is not my intention to stick to this rule.
>
>> Or should we aim at getting GDB '-Wswitch'-clean? (Probably a good idea
>
> -Wswitch is enabled by -Wall, so gdb is '-Wswitch'-clean already.
Well, GDB currently uses -Wno-switch. And if I build GDB without that
option, I get lots of warnings for -Wswitch.
>
>> anyhow...) Then we could replace the default label by explicit case
>> labels for all unsupported syscalls and rely on GCC to catch any further
>> missing case labels. Once that's done, the order of case labels
>> wouldn't matter, IMO.
>>
>
> That will be overkill compared with your patch, so ...
>
>>> but, I don't like the fall-through.
>>
>> Yeah, it's kind of ugly. I can certainly drop this change from the
>> patch if that helps.
>>
>
> ... your patch except the fall-through is good to me.
Thanks, pushed without that.
--
Andreas