From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31991 invoked by alias); 9 Apr 2010 19:15:54 -0000 Received: (qmail 31964 invoked by uid 22791); 9 Apr 2010 19:15:52 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Apr 2010 19:15:47 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3) with ESMTP id o39JFhYm014562; Fri, 9 Apr 2010 21:15:43 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.3/8.14.3/Submit) id o39JFfFN011160; Fri, 9 Apr 2010 21:15:41 +0200 (CEST) Date: Fri, 09 Apr 2010 19:15:00 -0000 Message-Id: <201004091915.o39JFfFN011160@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: hjl.tools@gmail.com CC: gdb-patches@sourceware.org In-reply-to: (hjl.tools@gmail.com) Subject: Re: PATCH: PR corefiles/11481: gcore doesn't work on i386 without SSE References: <20100409155012.GA19118@intel.com> <201004091559.o39FxnQi005865@glazunov.sibelius.xs4all.nl> 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: 2010-04/txt/msg00276.txt.bz2 > Date: Fri, 9 Apr 2010 09:01:01 -0700 > From: "H.J. Lu" > > On Fri, Apr 9, 2010 at 8:59 AM, Mark Kettenis wrote: > >> Date: Fri, 9 Apr 2010 08:50:12 -0700 > >> From: "H.J. Lu" > >> > >> Hi, > >> > >> This patch fixes gcore by not generating core regset sections which > >> aren't supported by i386 without SSE.  OK to install? > > > > Sorry, I think this is the wrong way to fix this. > > > > Any suggestions? Yup. This makes sure we always install a list of register notes that matches the target description. 2010-04-09 Mark Kettenis * i386-linux-tdep.c (i386_linux_regset_sections): Remove extended register note sections. (i386_linux_sse_regset_sections, i386_linux_avx_regset_sections): New variables. (i386_linux_init_abi): Install list of supported register note sections that matches the target description. Index: i386-linux-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-tdep.c,v retrieving revision 1.74 diff -u -p -r1.74 i386-linux-tdep.c --- i386-linux-tdep.c 8 Apr 2010 22:32:36 -0000 1.74 +++ i386-linux-tdep.c 9 Apr 2010 19:05:25 -0000 @@ -58,7 +58,19 @@ static struct core_regset_section i386_l { { ".reg", 144, "general-purpose" }, { ".reg2", 108, "floating-point" }, + { NULL, 0 } +}; + +static struct core_regset_section i386_linux_sse_regset_sections[] = +{ + { ".reg", 144, "general-purpose" }, { ".reg-xfp", 512, "extended floating-point" }, + { NULL, 0 } +}; + +static struct core_regset_section i386_linux_avx_regset_sections[] = +{ + { ".reg", 144, "general-purpose" }, { ".reg-xstate", I386_XSTATE_MAX_SIZE, "XSAVE extended state" }, { NULL, 0 } }; @@ -862,7 +874,12 @@ i386_linux_init_abi (struct gdbarch_info svr4_fetch_objfile_link_map); /* Install supported register note sections. */ - set_gdbarch_core_regset_sections (gdbarch, i386_linux_regset_sections); + if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.avx")) + set_gdbarch_core_regset_sections (gdbarch, i386_linux_avx_regset_sections); + else if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.sse")) + set_gdbarch_core_regset_sections (gdbarch, i386_linux_sse_regset_sections); + else + set_gdbarch_core_regset_sections (gdbarch, i386_linux_regset_sections); set_gdbarch_core_read_description (gdbarch, i386_linux_core_read_description);