From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12397 invoked by alias); 8 Dec 2013 21:59:50 -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 12372 invoked by uid 89); 8 Dec 2013 21:59:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: glazunov.sibelius.xs4all.nl Received: from Unknown (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sun, 08 Dec 2013 21:59:48 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id rB8Lxafk011120; Sun, 8 Dec 2013 22:59:36 +0100 (CET) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id rB8LxZZZ031245; Sun, 8 Dec 2013 22:59:35 +0100 (CET) Date: Sun, 08 Dec 2013 21:59:00 -0000 Message-Id: <201312082159.rB8LxZZZ031245@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: gdb-patches@sourceware.org In-reply-to: <20131208194419.GB10094@intel.com> (hongjiu.lu@intel.com) Subject: Re: [PATCH 2/3] PR gdb/16304: Add amd64_x32_linux_record_tdep and amd64_x32_sys_xxx References: <20131208194419.GB10094@intel.com> X-SW-Source: 2013-12/txt/msg00312.txt.bz2 > Date: Sun, 8 Dec 2013 11:44:19 -0800 > From: "H.J. Lu" > > Hi, > > X32 Linux system calls are diffferent from amd64 Linux system calls > in system call numbers as well as parameter types/values. We can't use > amd64_linux_record_tdep for x32. This patch adds x32 system call > numbers. It also adds linux_record_tdep_p to gdbarch_tdep so that > we can use different linux_record_tdeps for x32 and amd64. > linux_record_tdep_p will be unused for other x86 targets. Tested on > Linux/x86-64. OK to install? No. There is no reason to add this linux_record_tdep_pmember to the generic struct gdbarch_tdep. If the system calls are different, you need to add an amd64_x32_linux_syscall_record() function and make sure that gets used for x32. > 2013-12-08 H.J. Lu > > PR gdb/16304 > * amd64-linux-tdep.c (amd64_canonicalize_syscall): Handle x32 > system calls. > (amd64_x32_linux_record_tdep): New. > (amd64_linux_syscall_record): Handle amd64_x32_sys_rt_sigreturn > and amd64_x32_sys_arch_prctl. Use tdep->linux_record_tdep_p > instead of amd64_linux_record_tdep. > (amd64_linux_init_abi_common): Move amd64_linux_record_tdep > initialization to ... > (amd64_linux_init_abi): Here. Set tdep->linux_record_tdep_p > to amd64_linux_record_tdep. > (amd64_x32_linux_init_abi): Initialize > amd64_x32_linux_record_tdep. Set tdep->linux_record_tdep_p to > amd64_x32_linux_record_tdep. > * amd64-linux-tdep.h (amd64_x32_syscall): New enum. > * i386-linux-tdep.c (i386_linux_init_abi): Set > tdep->linux_record_tdep_p to 386_linux_record_tdep. > * i386-tdep.c (i386_gdbarch_init): Set tdep->linux_record_tdep_p > to NULL. > * i386-tdep.h (gdbarch_tdep): Add linux_record_tdep_p. > > --- > gdb/amd64-linux-tdep.c | 557 ++++++++++++++++++++++++++++++++++++++++++++----- > gdb/amd64-linux-tdep.h | 280 +++++++++++++++++++++++++ > gdb/i386-linux-tdep.c | 1 + > gdb/i386-tdep.c | 1 + > gdb/i386-tdep.h | 3 + > 5 files changed, 785 insertions(+), 57 deletions(-)