From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12572 invoked by alias); 26 Aug 2002 20:28:20 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 12565 invoked from network); 26 Aug 2002 20:28:18 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (62.163.169.250) by sources.redhat.com with SMTP; 26 Aug 2002 20:28:18 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.5/8.12.5) with ESMTP id g7QKS9Uo009368; Mon, 26 Aug 2002 22:28:09 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.5/8.12.5) with ESMTP id g7QKS9q0001026; Mon, 26 Aug 2002 22:28:09 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.5/8.12.5/Submit) id g7QKS88T001023; Mon, 26 Aug 2002 22:28:08 +0200 (CEST) Date: Mon, 26 Aug 2002 13:28:00 -0000 Message-Id: <200208262028.g7QKS88T001023@elgar.kettenis.dyndns.org> From: Mark Kettenis To: drow@mvista.com CC: gdb@sources.redhat.com In-reply-to: <20020826195247.GA22760@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 26 Aug 2002 15:52:47 -0400) Subject: Re: Bizarre internal errors in regcache References: <20020826185639.GA19722@nevyn.them.org> <20020826195247.GA22760@nevyn.them.org> X-SW-Source: 2002-08/txt/msg00333.txt.bz2 Date: Mon, 26 Aug 2002 15:52:47 -0400 From: Daniel Jacobowitz On Mon, Aug 26, 2002 at 02:56:39PM -0400, Daniel Jacobowitz wrote: > I see this error on my laptop but not on my desktop; both current trees, > both rebuilt from scratch, both i386-linux. Any ideas? [ snip ] My desktop has SSE, my laptop doesn't, it seems. We can't call supply_register on an MMX register if we don't have any. dummy_sse_registers seems to be the culprit. Hmm, and my desktop sort of pretends it has the SSE registers. Anyway, I'm pretty certain that the problem is caused by the fact that the binary produced by the gdb.asm test isn't branded. Therefore GDB doesn't select the Linux OS/ABI but the generic OS/ABI which doesn't include the SSE regs. Since you're running on Linux, the native code tries to supply these registers anyway. i387_supply_fxsave() does deal with this gracefully, but dummy_sse_regs() doesn't. Can you try the attached patch? Note that I'm still open to suggestions on what registers to include in any of the i386 OS/ABI variants. Ideally we would let the user choose somehow. For now I selected something that most closely resembles what we did in previous GDB releases, although there are some differences. For example, on Linux, you'll always get the SSE registers now. Any thoughts? Mark Index: i386-linux-nat.c =================================================================== RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v retrieving revision 1.40 diff -u -p -r1.40 i386-linux-nat.c --- i386-linux-nat.c 15 Jun 2002 16:43:54 -0000 1.40 +++ i386-linux-nat.c 26 Aug 2002 20:11:48 -0000 @@ -540,15 +540,17 @@ store_fpxregs (int tid, int regno) static void dummy_sse_values (void) { + struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); /* C doesn't have a syntax for NaN's, so write it out as an array of longs. */ static long dummy[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff }; static long mxcsr = 0x1f80; int reg; - for (reg = 0; reg < 8; reg++) + for (reg = 0; reg < tdep->num_xmm_regs; reg++) supply_register (XMM0_REGNUM + reg, (char *) dummy); - supply_register (MXCSR_REGNUM, (char *) &mxcsr); + if (tdep->num_xmm_regs > 0) + supply_register (MXCSR_REGNUM, (char *) &mxcsr); } #else