From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5853 invoked by alias); 14 May 2012 18:02:01 -0000 Received: (qmail 5832 invoked by uid 22791); 14 May 2012 18:02:00 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,NO_DNS_FOR_FROM,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 May 2012 18:01:47 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 14 May 2012 11:01:46 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by azsmga001.ch.intel.com with ESMTP; 14 May 2012 11:01:46 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id 57CD7C18B5; Mon, 14 May 2012 11:01:46 -0700 (PDT) Date: Mon, 14 May 2012 18:02:00 -0000 From: "H.J. Lu" To: GDB Subject: PATCH: Set size of long/ptr as well as sp/pc for x32 Message-ID: <20120514180146.GA18462@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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: 2012-05/txt/msg00528.txt.bz2 Hi, This patch should be applied on top of http://sourceware.org/ml/gdb-patches/2012-05/msg00460.html http://sourceware.org/ml/gdb-patches/2012-05/msg00462.html It sets size of long/ptr as well as sp/pc for x32. OK to install after the above patches are approved? Thanks. H.J. --- * amd64-linux-tdep.c (amd64_ilp32_linux_init_abi): Set long and ptr to 32 bits. Set sp_regnum_from_eax to AMD64_RSP_REGNUM and pc_regnum_from_eax to AMD64_RIP_REGNUM. diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index d0c6f8f..0348cde 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1572,8 +1572,13 @@ static void amd64_ilp32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); amd64_linux_init_abi (info, gdbarch, tdesc_x32_linux, svr4_ilp32_fetch_link_map_offsets); + set_gdbarch_long_bit (gdbarch, 32); + set_gdbarch_ptr_bit (gdbarch, 32); + tdep->sp_regnum_from_eax = AMD64_RSP_REGNUM; + tdep->pc_regnum_from_eax = AMD64_RIP_REGNUM; }