From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14784 invoked by alias); 4 Nov 2008 16:18:46 -0000 Received: (qmail 14731 invoked by uid 22791); 4 Nov 2008 16:18:46 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 04 Nov 2008 16:18:09 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mA4GG7iC003237; Tue, 4 Nov 2008 11:16:07 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mA4GG6a3011342; Tue, 4 Nov 2008 11:16:06 -0500 Received: from opsy.redhat.com (vpn-14-82.rdu.redhat.com [10.11.14.82]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mA4GG40Z030540; Tue, 4 Nov 2008 11:16:04 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id AFEF8508089; Tue, 4 Nov 2008 09:15:58 -0700 (MST) To: =?utf-8?Q?S=C3=A9rgio?= Durigan =?utf-8?Q?J=C3=BAnior?= Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/4] 'catch syscall' feature -- Architecture-dependent part References: <1225773084.24532.54.camel@miki> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Tue, 04 Nov 2008 16:18:00 -0000 In-Reply-To: <1225773084.24532.54.camel@miki> (=?utf-8?Q?=22S=C3=A9rgio?= Durigan =?utf-8?Q?J=C3=BAnior=22's?= message of "Tue\, 04 Nov 2008 02\:31\:24 -0200") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 2008-11/txt/msg00037.txt.bz2 >>>>> "S=C3=A9rgio" =3D=3D S=C3=A9rgio Durigan J=C3=BAnior writes: S=C3=A9rgio> * i386-linux-tdep.c: Define the syscall's XML struct to hold S=C3=A9rgio> information about syscalls. S=C3=A9rgio> (init_sysinfo): New. There is some code duplication between this and ppc-linux-tdep.c. It seems to me that much of the Linux code will be shared by all ports. So, I think the duplicated stuff should go in linux-nat.c. S=C3=A9rgio> (i386_linux_get_syscall_number): New. S=C3=A9rgio> (i386_linux_syscall_name_from_number): New. S=C3=A9rgio> (i386_linux_syscall_number_from_name): New. S=C3=A9rgio> (i386_linux_get_syscalls_names): New. In the current patch, these could all be static. Aside from i386_linux_get_syscall_number, perhaps they ought to be shared in linux-nat.c though. The same applies for the equivalent PPC functions. S=C3=A9rgio> +/* Return the current system call's number present in the S=C3=A9rgio> + r0 register. When the function fails, it returns -1. */ S=C3=A9rgio> +LONGEST S=C3=A9rgio> +ppc_linux_get_syscall_number (struct gdbarch *gdbarch, S=C3=A9rgio> + ptid_t ptid) S=C3=A9rgio> +{ [...] S=C3=A9rgio> + buf =3D (gdb_byte *) xmalloc (tdep->wordsize * sizeof (gdb_= byte)); I suspect you need a cleanup here, rather than an explicit xfree. I am not sure. If regcache_cooked_read can call error, then you need one. Tom