From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25097 invoked by alias); 13 Jul 2009 00:47:08 -0000 Received: (qmail 25088 invoked by uid 22791); 13 Jul 2009 00:47:07 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 13 Jul 2009 00:47:00 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 7DC7422002; Sun, 12 Jul 2009 17:46:58 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost4.vmware.com (Postfix) with ESMTP id 71973C9CC1; Sun, 12 Jul 2009 17:46:58 -0700 (PDT) Message-ID: <4A5A82F9.5050503@vmware.com> Date: Mon, 13 Jul 2009 02:26:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches ml Subject: Re: [RFA/RFC Prec] Add Linux AMD64 process record support second version, (64 bits system call support) 2/3 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-07/txt/msg00352.txt.bz2 Hui Zhu wrote: > The old linux-record.c just support 32 bits system call and some other > problem. This patch fix them all. > > 2009-07-07 Hui Zhu > > Add process record Linux system call 64 bits support. > > * linux-record.h (linux_record_tdep): Add size_pointer, > size_size_t, size_iovec and arg6. > * i386-linux-tdep.c (i386_linux_init_abi): Ditto. > (i386_linux_intx80_sysenter_record): Add a check for system > call number. > * linux-record.c (record_linux_system_call): Make this > function support 64 bits. Again, preliminary, mostly whitespace formatting comments. > @@ -371,8 +371,15 @@ i386_linux_intx80_sysenter_record (struc > > regcache_raw_read (regcache, I386_EAX_REGNUM, (gdb_byte *)&tmpu32); > > + if (tmpu32 > 499) > + { > + printf_unfiltered (_("Process record and replay target doesn't " > + "support syscall number %u\n"), tmpu32); > + return -1; > + } > + > ret = record_linux_system_call (tmpu32, regcache, > - &i386_linux_record_tdep); > + &i386_linux_record_tdep); This line is just a change between spaces and tabs. We like to have whitespace-only changes submitted separately. Just add -w and/or -b to your diff flags, and these will disappear. > @@ -481,6 +488,7 @@ i386_linux_init_abi (struct gdbarch_info > /* Initialize the i386_linux_record_tdep. */ > /* These values are the size of the type that will be used in a system > call. They are obtained from Linux Kernel source. */ > + i386_linux_record_tdep.size_pointer = 4; Can't you use gdbarch_ptr_bit(gdbarch) for this? Just trying to avoid duplication. > + > + a = alloca (tdep->size_int); > + > + if (record_arch_list_add_mem ((CORE_ADDR)len, tdep->size_int)) > + return -1; > + > + /* Get the addrlen. */ > + if (target_read_memory ((CORE_ADDR)len, a, tdep->size_int)) Space after cast. There are a whole lot like this in this file. > + { > + if (record_debug) > + fprintf_unfiltered (gdb_stdlog, > + "Process record: error reading " > + "memory at addr = 0x%s len = %d.\n", > + phex_nz (len, tdep->size_pointer), > + tdep->size_int); > + return -1; > + } > + addrlen = (int)extract_unsigned_integer(a, tdep->size_int, byte_order); Space after function name. And after cast. Search for "extract_unsigned_integer", there are several like this.