This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] Allow 'NULL' to i387_supply_fsave et. al.
- From: Klee Dienes <klee at apple dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Fri, 11 Oct 2002 04:43:55 -0400
- Subject: [PATCH] Allow 'NULL' to i387_supply_fsave et. al.
The following patch allows one to pass 'NULL' to i387_supply_fsave,
i387_supply_fxsave, and i387_supply_register, to mean "no register data
is available". This is convenient for clients of i387-tdep.c that may
have gotten a "no register data available" response from the OS while
trying to fetch information, and causes the i387_supply_* functions to
have the same behavior as supply_register.
2002-10-05 Klee Dienes <kdienes@apple.com>
* i387-tdep.c (i387_supply_register): When called with NULL as a
buffer, mark the register as not provided (to mirror the
behavior
of supply_register).
(i387_supply_fxsave): Ditto.
(i387_supply_fsave): Ditto (inherits the behavior from
i387_supply_register).
diff -u -r1.1.1.9 -r1.10
--- i387-tdep.c 2002/09/26 20:57:02 1.1.1.9
+++ i387-tdep.c 2002/10/05 06:22:06 1.10
@@ -435,6 +435,12 @@
void
i387_supply_register (int regnum, char *fsave)
{
+ if (fsave == NULL)
+ {
+ supply_register (regnum, NULL);
+ return;
+ }
+
/* Most of the FPU control registers occupy only 16 bits in
the fsave area. Give those a special treatment. */
if (regnum >= FPC_REGNUM
@@ -555,6 +561,12 @@
for (i = FP0_REGNUM; i <= last_regnum; i++)
{
+ if (fxsave == NULL)
+ {
+ supply_register (i, NULL);
+ continue;
+ }
+
/* Most of the FPU control registers occupy only 16 bits in
the fxsave area. Give those a special treatment. */
if (i >= FPC_REGNUM && i < XMM0_REGNUM