From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32740 invoked by alias); 13 May 2012 07:33:36 -0000 Received: (qmail 32721 invoked by uid 22791); 13 May 2012 07:33:33 -0000 X-SWARE-Spam-Status: No, hits=-4.6 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-wi0-f177.google.com (HELO mail-wi0-f177.google.com) (209.85.212.177) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 13 May 2012 07:33:20 +0000 Received: by wibhm14 with SMTP id hm14so2022930wib.12 for ; Sun, 13 May 2012 00:33:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.109.229 with SMTP id hv5mr11164275wib.0.1336894399225; Sun, 13 May 2012 00:33:19 -0700 (PDT) Received: by 10.180.104.201 with HTTP; Sun, 13 May 2012 00:33:19 -0700 (PDT) In-Reply-To: References: <87sjf9qecr.fsf@fleche.redhat.com> <87aa1gqhnq.fsf@fleche.redhat.com> Date: Sun, 13 May 2012 07:33:00 -0000 Message-ID: Subject: Re: [design change] record-replay linux ABI level From: oza Pawandeep To: Tom Tromey Cc: 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-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 X-SW-Source: 2012-05/txt/msg00491.txt.bz2 what I would do is, I will go ahead with curernt defination of enum. and try to provide mapping. if there are practical conflicts then I would seek for alternatives. Regards, Oza. On Sun, May 13, 2012 at 12:49 PM, oza Pawandeep w= rote: > currently on i386 following is the function: > > static enum gdb_syscall > i386_canonicalize_syscall (int syscall) > { > =A0enum { i386_syscall_max =3D 499 }; > > =A0if (syscall <=3D i386_syscall_max) > =A0 =A0return syscall; > =A0else > =A0 =A0return -1; > } > > which is just straight mapping. > > If we use generic enum defination, we will end up adding some > additional syscalls for ARM and > > arm_canonicalize_syscall(int syscall) > end up having switch {case} and having one-to one mapping for some > syscalls and rest syscalls would be shift by 'n' position. > which looks clumsy to me. > > > I am trying to see if there is more generic way which would take care > of all archor move the defination to arch files. > will try to see what best could be done. > > Regards, > Oza. > > > > On Thu, May 10, 2012 at 7:09 PM, Tom Tromey wrote: >> Oza> The definition of system call record maps fine to x86. =A0but arm >> Oza> syscall numbers are different. [partially] for e.g. on x86 sycall >> Oza> number for sys_epoll_create =3D 254 while on ARM it is 250. =A0the = more >> Oza> we go down on defined system calls the more the numbers are >> Oza> differing on ARM and we loose one to one trivial mapping. >> >> My understanding of the current design is that the ARM code would see >> the syscall 250, and have a mapping to turn that into >> gdb_sys_epoll_create (=3D=3D 254). =A0This can be done bidirectionally w= ith >> two lookup tables. >> >> I suppose this could still not work in some scenarios. =A0One question is >> whether these occur in practice or are merely theoretical. >> >> I don't really care about this API either way. >> With a solid justification it is fine to change it. >> >> Tom