From: Mark Kettenis <kettenis@chello.nl>
To: gdb-patches@sources.redhat.com
Subject: [PATCH] Provide dummy SSE registers in i387_supply_fsave
Date: Thu, 05 Aug 2004 02:02:00 -0000 [thread overview]
Message-ID: <200408042102.i74L2Mhw016597@copland.kettenis.dyndns.org> (raw)
Jim's patch to assert that target_fetch_registers did its job broke
OpenBSD/i386 and probably most other i386 native debuggers. The
attached patch fixes this.
I am wondering however.how this affects other platforms and remote
targets.
Committed,
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* i387-tdep.c (i387_supply_fsave): Provide summy values for the
SSE registers.
Index: i387-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/i387-tdep.c,v
retrieving revision 1.41
diff -u -p -r1.41 i387-tdep.c
--- i387-tdep.c 26 Jun 2004 23:20:30 -0000 1.41
+++ i387-tdep.c 4 Aug 2004 20:48:12 -0000
@@ -390,9 +390,11 @@ i387_supply_fsave (struct regcache *regc
gdb_assert (tdep->st0_regnum >= I386_ST0_REGNUM);
- /* Define I387_ST0_REGNUM such that we use the proper definitions
- for REGCACHE's architecture. */
+ /* Define I387_ST0_REGNUM and I387_NUM_XMM_REGS such that we use the
+ proper definitions for REGCACHE's architecture. */
+
#define I387_ST0_REGNUM tdep->st0_regnum
+#define I387_NUM_XMM_REGS tdep->num_xmm_regs
for (i = I387_ST0_REGNUM; i < I387_XMM0_REGNUM; i++)
if (regnum == -1 || regnum == i)
@@ -419,7 +421,21 @@ i387_supply_fsave (struct regcache *regc
else
regcache_raw_supply (regcache, i, FSAVE_ADDR (regs, i));
}
+
+ /* Provide dummy values for the SSE registers. */
+ for (i = I387_XMM0_REGNUM; i < I387_MXCSR_REGNUM; i++)
+ if (regnum == -1 || regnum == i)
+ regcache_raw_supply (regcache, i, NULL);
+ if (regnum == -1 || regnum == I387_MXCSR_REGNUM)
+ {
+ char buf[4];
+
+ store_unsigned_integer (buf, 4, 0x1f80);
+ regcache_raw_supply (regcache, I387_MXCSR_REGNUM, buf);
+ }
+
#undef I387_ST0_REGNUM
+#undef I387_NUM_XMM_REGS
}
/* Fill register REGNUM (if it is a floating-point register) in *FSAVE
next reply other threads:[~2004-08-05 2:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-05 2:02 Mark Kettenis [this message]
2004-08-05 13:57 ` Andrew Cagney
2004-08-05 15:43 ` Jim Blandy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200408042102.i74L2Mhw016597@copland.kettenis.dyndns.org \
--to=kettenis@chello.nl \
--cc=gdb-patches@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox