From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10623 invoked by alias); 17 Dec 2014 18:41:25 -0000 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 Received: (qmail 10610 invoked by uid 89); 17 Dec 2014 18:41:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,MSGID_FROM_MTA_HEADER,SPF_SOFTFAIL,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e36.co.us.ibm.com Received: from e36.co.us.ibm.com (HELO e36.co.us.ibm.com) (32.97.110.154) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 17 Dec 2014 18:41:23 +0000 Received: from /spool/local by e36.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 17 Dec 2014 11:41:22 -0700 Received: from d03dlp03.boulder.ibm.com (9.17.202.179) by e36.co.us.ibm.com (192.168.1.136) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 17 Dec 2014 11:41:20 -0700 Received: from b03cxnp07029.gho.boulder.ibm.com (b03cxnp07029.gho.boulder.ibm.com [9.17.130.16]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id C20AD19D803E for ; Wed, 17 Dec 2014 11:29:58 -0700 (MST) Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBHIfJja48234546 for ; Wed, 17 Dec 2014 11:41:19 -0700 Received: from d03av02.boulder.ibm.com (localhost [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBHIfIvr011193 for ; Wed, 17 Dec 2014 11:41:19 -0700 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d03av02.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id sBHIfGSA011030; Wed, 17 Dec 2014 11:41:17 -0700 Message-Id: <201412171841.sBHIfGSA011030@d03av02.boulder.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 17 Dec 2014 19:41:16 +0100 Subject: Re: [PATCH 2/3 v3] Process record support for PowerPC To: cole945@gmail.com (Wei-cheng Wang) Date: Wed, 17 Dec 2014 18:41:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <5491B840.5030603@gmail.com> from "Wei-cheng Wang" at Dec 18, 2014 01:07:12 AM MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14121718-0021-0000-0000-000007099DD0 X-SW-Source: 2014-12/txt/msg00491.txt.bz2 Wei-cheng Wang wrote: > 2014-12-06 Wei-cheng Wang > Ulrich Weigand > > * configure.tgt (powerpc*-*-linux): Add linux-record.o to > gdb_target_obs. > (ppc_linux_record_tdep, ppc64_linux_record_tdep): New for linux syscall > record. > (ppc_canonicalize_syscall, ppc_linux_syscall_record, > ppc_linux_record_signal, ppc_init_linux_record_tdep): New functions. > (ppc_linux_init_abi): Set process_record, process_record_signal. > * ppc-tdep.h (struct gdbarch_tdep): Add ppc_syscall_record and > ppc_linux_record_tdep to gdbarch_tdep. > (ppc_process_record): New declaration. > * rs6000-tdep.c (ppc_record_vsr, ppc_process_record_op4, > ppc_process_record_op19, ppc_process_record_op31, > ppc_process_record_op59, ppc_process_record_op60, > ppc_process_record_op63, ppc_process_record): New functions. > > changelog for testsuite > > 2014-12-06 Wei-cheng Wang > > * lib/gdb.exp (supports_process_record): Return true for > powerpc*-*-linux*. > (supports_reverse): Likewise. This looks all very good now, except that: > +static void > +ppc_init_linux_record_tdep (struct linux_record_tdep *record_tdep, > + int wordsize) > +{ > + /* Simply return if it had been initialized. */ > + if (record_tdep->size_pointer != 0) > + return; > + > + /* These values are the size of the type that will be used in a system > + call. They are obtained from Linux Kernel source. */ > + > + record_tdep->size_pointer = wordsize; > + record_tdep->size__old_kernel_stat = 32; > + record_tdep->size_tms = 32; > + record_tdep->size_loff_t = 8; > + record_tdep->size_flock = 32; [...] you seem to have removed all the 32-bit struct sizes here. Your last iteration had different values for many of those structs for wordsize 4 vs. wordsize 8, and I think we need to keep them. I had suggested to remove the gdbarch calls, but I was thinking instead of a structure along the lines of if (wordsize == 8) { record_tdep->size_pointer = 8; record_tdep->size__old_kernel_stat = 32; record_tdep->size_tms = 32; record_tdep->size_loff_t = 8; record_tdep->size_flock = 32; [...] } else if (wordsize == 4) { record_tdep->size_pointer = 4; record_tdep->size__old_kernel_stat = 32; record_tdep->size_tms = 16; record_tdep->size_loff_t = 8; record_tdep->size_flock = 16; [...] } else internal_error (__FILE__, __LINE_, _("unexpected wordsize")); The patch is OK with that change. Thanks again, Ulrich -- Dr. Ulrich Weigand GNU/Linux compilers and toolchain Ulrich.Weigand@de.ibm.com