summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2002-04-11 20:30:08 +0000
committerDaniel Jacobowitz <dan@debian.org>2002-04-11 20:30:08 +0000
commit02d75b43c2f6312a68c2ea43af541b7f5215c919 (patch)
treec515344dc4a389cbd2533d820e195d5a4801f80d
parent56df7850095eebecd554bac3133cffc911bd6f74 (diff)
downloadgdb-02d75b43c2f6312a68c2ea43af541b7f5215c919.tar.gz
2002-04-11 Daniel Jacobowitz <drow@mvista.com>
* gdbserver/linux-low.c (usr_store_inferior_registers): Support registers which are allowed to fail to store. * gdbserver/linux-low.h (linux_target_ops): Likewise. * gdbserver/linux-ppc-low.c (ppc_regmap): Support FPSCR. (ppc_cannot_store_register): FPSCR may not be storable. * regformats/reg-ppc.dat: Support FPSCR.
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/gdbserver/linux-low.c19
-rw-r--r--gdb/gdbserver/linux-low.h4
-rw-r--r--gdb/gdbserver/linux-ppc-low.c6
-rw-r--r--gdb/regformats/reg-ppc.dat2
5 files changed, 29 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index dd24b743b60..90075b5a4da 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2002-04-11 Daniel Jacobowitz <drow@mvista.com>
+
+ * gdbserver/linux-low.c (usr_store_inferior_registers): Support
+ registers which are allowed to fail to store.
+ * gdbserver/linux-low.h (linux_target_ops): Likewise.
+ * gdbserver/linux-ppc-low.c (ppc_regmap): Support FPSCR.
+ (ppc_cannot_store_register): FPSCR may not be storable.
+ * regformats/reg-ppc.dat: Support FPSCR.
+
2002-04-11 Kevin Buettner <kevinb@redhat.com>
* ppc-tdep.h (struct gdbarch_tdep): Add new field ``ppc_fpscr_regnum''.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 8c729df2feb..bd1a87601f5 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -240,7 +240,7 @@ usr_store_inferior_registers (int regno)
if (regno >= the_low_target.num_regs)
return;
- if ((*the_low_target.cannot_store_register) (regno))
+ if ((*the_low_target.cannot_store_register) (regno) == 1)
return;
regaddr = register_addr (regno);
@@ -254,14 +254,15 @@ usr_store_inferior_registers (int regno)
*(int *) (register_data (regno) + i));
if (errno != 0)
{
- /* Warning, not error, in case we are attached; sometimes the
- kernel doesn't let us at the registers. */
- char *err = strerror (errno);
- char *msg = alloca (strlen (err) + 128);
- sprintf (msg, "writing register %d: %s",
- regno, err);
- error (msg);
- return;
+ if ((*the_low_target.cannot_store_register) (regno) == 0)
+ {
+ char *err = strerror (errno);
+ char *msg = alloca (strlen (err) + 128);
+ sprintf (msg, "writing register %d: %s",
+ regno, err);
+ error (msg);
+ return;
+ }
}
regaddr += sizeof (int);
}
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h
index 0d0050dcd58..e485a8ee013 100644
--- a/gdb/gdbserver/linux-low.h
+++ b/gdb/gdbserver/linux-low.h
@@ -34,6 +34,10 @@ struct linux_target_ops
int num_regs;
int *regmap;
int (*cannot_fetch_register) (int);
+
+ /* Returns 0 if we can store the register, 1 if we can not
+ store the register, and 2 if failure to store the register
+ is acceptable. */
int (*cannot_store_register) (int);
};
diff --git a/gdb/gdbserver/linux-ppc-low.c b/gdb/gdbserver/linux-ppc-low.c
index e626eab3cbc..7cb315a304a 100644
--- a/gdb/gdbserver/linux-ppc-low.c
+++ b/gdb/gdbserver/linux-ppc-low.c
@@ -46,11 +46,15 @@ static int ppc_regmap[] =
PT_FPR0*4+192, PT_FPR0*4+200, PT_FPR0*4+208, PT_FPR0*4+216,
PT_FPR0*4+224, PT_FPR0*4+232, PT_FPR0*4+240, PT_FPR0*4+248,
PT_NIP * 4, PT_MSR * 4, PT_CCR * 4, PT_LNK * 4,
- PT_CTR * 4, PT_XER * 4, -1, };
+ PT_CTR * 4, PT_XER * 4, PT_FPSCR * 4, };
static int
ppc_cannot_store_register (int regno)
{
+ /* Some kernels do not allow us to store fpscr. */
+ if (regno == find_regno ("fpscr"))
+ return 2;
+
return 0;
}
diff --git a/gdb/regformats/reg-ppc.dat b/gdb/regformats/reg-ppc.dat
index d915996cc01..d7f9b88c355 100644
--- a/gdb/regformats/reg-ppc.dat
+++ b/gdb/regformats/reg-ppc.dat
@@ -73,4 +73,4 @@ expedite:r1,pc
32:lr
32:ctr
32:xer
-0:
+32:fpscr