* [PATCH] Provide dummy SSE registers in i387_supply_fsave
@ 2004-08-05 2:02 Mark Kettenis
2004-08-05 13:57 ` Andrew Cagney
0 siblings, 1 reply; 3+ messages in thread
From: Mark Kettenis @ 2004-08-05 2:02 UTC (permalink / raw)
To: gdb-patches
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] Provide dummy SSE registers in i387_supply_fsave
2004-08-05 2:02 [PATCH] Provide dummy SSE registers in i387_supply_fsave Mark Kettenis
@ 2004-08-05 13:57 ` Andrew Cagney
2004-08-05 15:43 ` Jim Blandy
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Cagney @ 2004-08-05 13:57 UTC (permalink / raw)
To: Mark Kettenis, Jim Blandy; +Cc: gdb-patches
> 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.
Hmm,
Jim, which systems did the assert patch get tested on?
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Provide dummy SSE registers in i387_supply_fsave
2004-08-05 13:57 ` Andrew Cagney
@ 2004-08-05 15:43 ` Jim Blandy
0 siblings, 0 replies; 3+ messages in thread
From: Jim Blandy @ 2004-08-05 15:43 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Mark Kettenis, gdb-patches
Andrew Cagney <cagney@gnu.org> writes:
> > 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.
>
> Hmm,
>
> Jim, which systems did the assert patch get tested on?
IA-32 and PowerPC Linux. i386-linux-nat.c:supply_fpregset calls
dummy_sse_values, which provides the contents of the %xmm registers,
which is what Mark ran into.
This is the concern I was getting at in the first paragraph of the
patch post: the assert is clearly a "fair" check on
target_fetch_registers ("I asked you for this register, and you said
'okay'; were you telling the truth?") and it's clearly a condition
developers would want to know about (using the contents of a register
marked as not valid). But at the same time, it's easy to believe that
there are lots of register sets in various architectures that have
grown beyond the ability of some targets to fetch.
If it's the case that many arch/target combinations will trigger the
assert, then an assert is too aggressive, and it should probably be a
warning instead. But silently supplying dummy bits is pretty
unsatisfactory. As a developer, I wanted to know that regcache.c was
happily fetching invalid contents. And as a user, I'd like something
more than a suspicious bit pattern to tell me that a given register is
unavailable.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-08-05 15:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-05 2:02 [PATCH] Provide dummy SSE registers in i387_supply_fsave Mark Kettenis
2004-08-05 13:57 ` Andrew Cagney
2004-08-05 15:43 ` Jim Blandy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox