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: Yao Qi <qiyaoltc at gmail dot com>
- To: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org, "Markus T. Metzger" <markus dot t dot metzger at intel dot com>
- Date: Thu, 14 Apr 2016 11:10:57 +0100
- 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>
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.
> 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.
--
Yao (éå)