From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19833 invoked by alias); 11 May 2012 19:33:50 -0000 Received: (qmail 19820 invoked by uid 22791); 11 May 2012 19:33:49 -0000 X-SWARE-Spam-Status: No, hits=-4.8 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 mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 11 May 2012 19:33:37 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 11 May 2012 12:33:36 -0700 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by fmsmga002.fm.intel.com with ESMTP; 11 May 2012 12:33:36 -0700 Received: by gnu-6.sc.intel.com (Postfix, from userid 500) id B26F6C18B6; Fri, 11 May 2012 12:33:36 -0700 (PDT) Date: Fri, 11 May 2012 19:33:00 -0000 From: "H.J. Lu" To: GDB Subject: PATCH: Check gdbarch_ptr_bit for x32 core dump Message-ID: <20120511193336.GA5134@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/msg00439.txt.bz2 Hi, This patch checks gdbarch_ptr_bit for x32 core dump. Tested on Linux/x86-64. Ok to install? Thanks. H.J. --- * amd64-linux-tdep.c (amd64_linux_core_read_description): Check gdbarch_ptr_bit for x32 core dump. diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index acc7303..601ce20 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -1273,9 +1290,15 @@ amd64_linux_core_read_description (struct gdbarch *gdbarch, switch ((xcr0 & I386_XSTATE_AVX_MASK)) { case I386_XSTATE_AVX_MASK: - return tdesc_amd64_avx_linux; + if (gdbarch_ptr_bit (gdbarch) == 32) + return tdesc_x32_avx_linux; + else + return tdesc_amd64_avx_linux; default: - return tdesc_amd64_linux; + if (gdbarch_ptr_bit (gdbarch) == 32) + return tdesc_x32_linux; + else + return tdesc_amd64_linux; } }