From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32159 invoked by alias); 13 Nov 2008 19:57:48 -0000 Received: (qmail 32139 invoked by uid 22791); 13 Nov 2008 19:57:48 -0000 X-Spam-Check-By: sourceware.org Received: from igw3.br.ibm.com (HELO igw3.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Nov 2008 19:56:54 +0000 Received: from d24relay01.br.ibm.com (unknown [9.8.31.16]) by igw3.br.ibm.com (Postfix) with ESMTP id 6077739027D for ; Thu, 13 Nov 2008 17:54:51 -0200 (BRDT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mADKuRt31945776 for ; Thu, 13 Nov 2008 17:56:27 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mADJuoEW024688 for ; Thu, 13 Nov 2008 17:56:50 -0200 Received: from [9.18.238.89] ([9.18.238.89]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mADJuoHL024682; Thu, 13 Nov 2008 17:56:50 -0200 Subject: Re: [RFA] Process record and replay, 5/10 From: Thiago Jung Bauermann To: teawater Cc: "gdb-patches@sourceware.org" In-Reply-To: References: Content-Type: text/plain; charset=utf-8 Date: Thu, 13 Nov 2008 23:00:00 -0000 Message-Id: <1226606210.4574.10.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit 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: 2008-11/txt/msg00297.txt.bz2 El jue, 06-11-2008 a las 15:48 +0800, teawater escribió: > +/* Record the values of the registers and memory that will be changed in > + current system call. > + Return -1 if something wrong. */ > + > +int > +record_linux_system_call (int num, linux_record_tdep_t * tdep) > +{ > + uint32_t tmpu32; > + > + switch (num) > + { > + /* sys_read */ > + case 3: > + { > + uint32_t addr, count; > + regcache_raw_read (record_regcache, tdep->arg2, (gdb_byte *) & addr); > + regcache_raw_read (record_regcache, tdep->arg3, (gdb_byte *) & count); > + if (record_arch_list_add_mem (addr, count)) > + { > + return (-1); > + } > + } > + break; > + case 84: > + regcache_raw_read (record_regcache, tdep->arg2, (gdb_byte *) & tmpu32); > + if (record_arch_list_add_mem (tmpu32, tdep->size__old_kernel_stat)) > + { > + return (-1); > + } > + break; Syscalls have different numbers across different architectures in Linux, so this file should be named i386-linux-record.c. Do you know if what you need to record for a syscall in one architecture is the same as what you need to record in the others? If so, it wouldn't be hard to make this file general for Linux in all architectures, and just get the syscall number mapping from the XML in the catch syscall feature (here are we talking about it again... :-) ). Otherwise, you'll have to rename the file, and also you can't directly call record_linux_system_call directly from i386-linux-tdep.c like you do now. You'd have to add a gdbarch method and reach this code through that. -- []'s Thiago Jung Bauermann IBM Linux Technology Center