From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2999 invoked by alias); 15 May 2012 05:20:31 -0000 Received: (qmail 2968 invoked by uid 22791); 15 May 2012 05:20:29 -0000 X-SWARE-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 May 2012 05:20:12 +0000 Received: by wgbdr1 with SMTP id dr1so4402613wgb.12 for ; Mon, 14 May 2012 22:20:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.213.219 with SMTP id a69mr7188387wep.16.1337059211068; Mon, 14 May 2012 22:20:11 -0700 (PDT) Received: by 10.180.104.201 with HTTP; Mon, 14 May 2012 22:20:11 -0700 (PDT) In-Reply-To: <20120514145650.GF10253@adacore.com> References: <87sjf9qecr.fsf@fleche.redhat.com> <87aa1gqhnq.fsf@fleche.redhat.com> <20120514145650.GF10253@adacore.com> Date: Tue, 15 May 2012 05:20:00 -0000 Message-ID: Subject: Re: [design change] record-replay linux ABI level From: oza Pawandeep To: Joel Brobecker Cc: Tom Tromey , gdb@sourceware.org, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes 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/msg00060.txt.bz2 I would have liked to think the same; but the way linux-record.h addresses all the architecture, the enum sycall, is defiend generically. what I think is define it in arch files, as syscalls are partially dependent on arch, though they follow posix standard. so each arch file would have their own map, compare to current generic map in linux-record.h Regards, Oza. On Mon, May 14, 2012 at 8:26 PM, Joel Brobecker wro= te: >> static enum gdb_syscall >> arm_canonicalize_syscall (int syscall) >> { >> =A0 enum { arm_sys_prlimit64 =3D 369 }; >> >> =A0 if (syscall <=3D arm_sys_prlimit64) >> =A0 =A0 { >> =A0 =A0 =A0 if (syscall <=3D gdb_sys_sched_getaffinity) >> =A0 =A0 =A0 =A0 return syscall; >> =A0 =A0 =A0 else if (syscall <=3D gdb_sys_fadvise64_64) >> =A0 =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 =A0 return (syscall + (unsigned int)2); >> =A0 =A0 =A0 =A0 } >> =A0 =A0 =A0 else >> =A0 =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 =A0 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. > > =A0 =A0static enum gdb_syscall arm_syscal_map[] =3D > =A0 =A0{ > =A0 =A0 =A0gdb_sys_restart_syscall, gdb_sys_exit, gdb_sys_fork, > =A0 =A0 =A0[...] > =A0 =A0 =A0gdb_sys_sched_getaffinity, gdb_sys_arm_trap16, > =A0 =A0 =A0[...] > =A0 =A0}; > > -- > Joel