From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2589 invoked by alias); 13 May 2012 09:47:30 -0000 Received: (qmail 2571 invoked by uid 22791); 13 May 2012 09:47:28 -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; Sun, 13 May 2012 09:47:16 +0000 Received: by wgbdr1 with SMTP id dr1so3106048wgb.12 for ; Sun, 13 May 2012 02:47:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.213.219 with SMTP id a69mr2819458wep.16.1336902434652; Sun, 13 May 2012 02:47:14 -0700 (PDT) Received: by 10.180.104.201 with HTTP; Sun, 13 May 2012 02:47:14 -0700 (PDT) In-Reply-To: References: <87sjf9qecr.fsf@fleche.redhat.com> <87aa1gqhnq.fsf@fleche.redhat.com> Date: Sun, 13 May 2012 09:47: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-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/msg00050.txt.bz2 following are the ARM syscalls. /* 270 */ CALL(sys_arm_fadvise64_64) CALL(sys_pciconfig_iobase) CALL(sys_pciconfig_read) CALL(sys_pciconfig_write) CALL(sys_mq_open) linux-record.h has a conflict at slot 271, 272 an so on.. sys_pciconfig_iobase is not defined at all. It is confusing where to define in the enum gdb_syscall table. current code looks like this... static enum gdb_syscall arm_canonicalize_syscall (int syscall) { enum { arm_sys_prlimit64 =3D 369 }; if (syscall <=3D arm_sys_prlimit64) { if (syscall <=3D gdb_sys_sched_getaffinity) return syscall; else if (syscall <=3D gdb_sys_fadvise64_64) { return (syscall + (unsigned int)2); } else { switch (syscall) { } } } else return -1; } It becomes clumsy as we start adding some more syscalls in the generic structure. (even If we are able to find slots). Regards, Oza. On Sun, May 13, 2012 at 1:03 PM, oza Pawandeep wr= ote: > 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 = wrote: >> 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 = with >>> 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