From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 66909 invoked by alias); 13 Apr 2016 15:05:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 66887 invoked by uid 89); 13 Apr 2016 15:05:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: e06smtp09.uk.ibm.com Received: from e06smtp09.uk.ibm.com (HELO e06smtp09.uk.ibm.com) (195.75.94.105) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 13 Apr 2016 15:05:36 +0000 Received: from localhost by e06smtp09.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 13 Apr 2016 16:05:33 +0100 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp09.uk.ibm.com (192.168.101.139) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 13 Apr 2016 16:04:55 +0100 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: arnez@linux.vnet.ibm.com X-IBM-RcptTo: gdb-patches@sourceware.org Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id B1CE4219004D for ; Wed, 13 Apr 2016 16:04:33 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u3DF4sf965601626 for ; Wed, 13 Apr 2016 15:04:54 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u3DF4spU028178 for ; Wed, 13 Apr 2016 09:04:54 -0600 Received: from oc1027705133.ibm.com (dyn-9-152-212-180.boeblingen.de.ibm.com [9.152.212.180]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u3DF4rRt028151 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 13 Apr 2016 09:04:54 -0600 From: Andreas Arnez To: Yao Qi Cc: gdb-patches@sourceware.org, "Markus T. Metzger" Subject: Re: [PATCH] linux-record: Squash cases with identical handling References: <86ega9k97g.fsf@gmail.com> Date: Wed, 13 Apr 2016 15:05:00 -0000 In-Reply-To: <86ega9k97g.fsf@gmail.com> (Yao Qi's message of "Wed, 13 Apr 2016 13:02:43 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16041315-0037-0000-0000-00000AC0079E X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00285.txt.bz2 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? Or should we aim at getting GDB '-Wswitch'-clean? (Probably a good idea 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. > 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. -- Andreas