From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10821 invoked by alias); 14 May 2012 14:57:14 -0000 Received: (qmail 10802 invoked by uid 22791); 14 May 2012 14:57:13 -0000 X-SWARE-Spam-Status: No, hits=-3.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_HOSTKARMA_NO,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 May 2012 14:56:58 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 12F451C6EE9; Mon, 14 May 2012 10:56:58 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id jBrA5d5xJykS; Mon, 14 May 2012 10:56:58 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CAADD1C6ED5; Mon, 14 May 2012 10:56:57 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1CCC1145616; Mon, 14 May 2012 07:56:50 -0700 (PDT) Date: Mon, 14 May 2012 14:57:00 -0000 From: Joel Brobecker To: oza Pawandeep Cc: Tom Tromey , gdb@sourceware.org, gdb-patches@sourceware.org Subject: Re: [design change] record-replay linux ABI level Message-ID: <20120514145650.GF10253@adacore.com> References: <87sjf9qecr.fsf@fleche.redhat.com> <87aa1gqhnq.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-05/txt/msg00054.txt.bz2 > static enum gdb_syscall > arm_canonicalize_syscall (int syscall) > { > enum { arm_sys_prlimit64 = 369 }; > > if (syscall <= arm_sys_prlimit64) > { > if (syscall <= gdb_sys_sched_getaffinity) > return syscall; > else if (syscall <= gdb_sys_fadvise64_64) > { > return (syscall + (unsigned int)2); > } > else > { > switch (syscall) Why not define a table that defines the mapping for every syscall? We do that for registers -vs- register names, for instance, and that works very well. static enum gdb_syscall arm_syscal_map[] = { gdb_sys_restart_syscall, gdb_sys_exit, gdb_sys_fork, [...] gdb_sys_sched_getaffinity, gdb_sys_arm_trap16, [...] }; -- Joel