aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2011-01-11 14:19:34 +0000
committerAndrew Burgess <aburgess@broadcom.com>2011-01-11 14:19:34 +0000
commitdae477fed8cdd8063a79042f2781a983be1c728d (patch)
treed14a1dc5e9e404f027a4a5008f5d2fc8e8704a16
parent7a88bc9c3dd8284dcd8f4222ec3524d146810884 (diff)
downloadgdb-dae477fed8cdd8063a79042f2781a983be1c728d.zip
gdb-dae477fed8cdd8063a79042f2781a983be1c728d.tar.gz
gdb-dae477fed8cdd8063a79042f2781a983be1c728d.tar.bz2
http://sourceware.org/ml/gdb-patches/2010-11/msg00112.html
gdb/ChangeLog * remote-sim.c (gdbsim_store_register): Update API to sim_store_register to check more error conditions. include/gdb/ChangeLog * remote-sim.h (sim_store_register): Update the API documentation for this function. sim/erc32/ChangeLog sim/h8300/ChangeLog sim/m32c/ChangeLog sim/mn10300/ChangeLog sim/ppc/ChangeLog sim/rx/ChangeLog sim/v850/ChangeLog * ???.c (sim_store_register): Update return value to match new API.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/remote-sim.c10
-rw-r--r--include/gdb/ChangeLog5
-rw-r--r--include/gdb/remote-sim.h12
-rw-r--r--sim/erc32/ChangeLog5
-rw-r--r--sim/erc32/interf.c2
-rw-r--r--sim/h8300/ChangeLog5
-rw-r--r--sim/h8300/compile.c2
-rw-r--r--sim/m32c/ChangeLog5
-rw-r--r--sim/m32c/gdb-if.c4
-rw-r--r--sim/mn10300/ChangeLog5
-rw-r--r--sim/mn10300/interp.c2
-rw-r--r--sim/ppc/ChangeLog5
-rw-r--r--sim/ppc/gdb-sim.c2
-rw-r--r--sim/rx/ChangeLog5
-rw-r--r--sim/rx/gdb-if.c6
-rw-r--r--sim/v850/ChangeLog5
-rw-r--r--sim/v850/interp.c2
18 files changed, 69 insertions, 18 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2e86bb8..18f70ef 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * remote-sim.c (gdbsim_store_register): Update API to
+ sim_store_register to check more error conditions.
+
2011-01-10 Michael Snyder <msnyder@vmware.com>
* nto-procfs.c: Comment cleanup, mostly periods and spaces.
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index f2015f0..baaf439 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -529,9 +529,13 @@ gdbsim_store_register (struct target_ops *ops,
if (nr_bytes > 0 && nr_bytes != register_size (gdbarch, regno))
internal_error (__FILE__, __LINE__,
_("Register size different to expected"));
- /* FIXME: cagney/2002-05-27: Should check `nr_bytes == 0'
- indicating that GDB and the SIM have different ideas about
- which registers are fetchable. */
+ if (nr_bytes < 0)
+ internal_error (__FILE__, __LINE__,
+ _("Register %d not updated"), regno);
+ if (nr_bytes == 0)
+ warning (_("Register %s not updated"),
+ gdbarch_register_name (gdbarch, regno));
+
if (remote_debug)
{
printf_filtered ("gdbsim_store_register: %d", regno);
diff --git a/include/gdb/ChangeLog b/include/gdb/ChangeLog
index 4e6b852..19509e2 100644
--- a/include/gdb/ChangeLog
+++ b/include/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * remote-sim.h (sim_store_register): Update the API
+ documentation for this function.
+
2010-09-06 Pedro Alves <pedro@codesourcery.com>
* signals.def: Replace all ANY uses by SET with specific numbers.
diff --git a/include/gdb/remote-sim.h b/include/gdb/remote-sim.h
index 9c20452..a171cfd 100644
--- a/include/gdb/remote-sim.h
+++ b/include/gdb/remote-sim.h
@@ -191,13 +191,15 @@ int sim_fetch_register (SIM_DESC sd, int regno, unsigned char *buf, int length);
/* Store register REGNO from the raw (target endian) value in BUF.
- Return the actual size of the register or zero if REGNO is not
- applicable.
- Legacy implementations ignore LENGTH and always return -1.
+ Return the actual size of the register, any size not equal to
+ LENGTH indicates the register was not updated correctly.
- If LENGTH does not match the size of REGNO no data is transfered
- (the actual register size is still returned). */
+ Return a LENGTH of -1 to indicate the register was not updated
+ and an error has occurred.
+
+ Return a LENGTH of 0 to indicate the register was not updated
+ but no error has occurred. */
int sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length);
diff --git a/sim/erc32/ChangeLog b/sim/erc32/ChangeLog
index cdfcc59..cf128ba 100644
--- a/sim/erc32/ChangeLog
+++ b/sim/erc32/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * interf.c (sim_store_register): Update return value to
+ match new API.
+
2010-05-20 Joel Brobecker <brobecker@adacore.com>
* sis.h: Remove #include <stdint.h>.
diff --git a/sim/erc32/interf.c b/sim/erc32/interf.c
index edba534..d81511a 100644
--- a/sim/erc32/interf.c
+++ b/sim/erc32/interf.c
@@ -330,7 +330,7 @@ sim_store_register(sd, regno, value, length)
regval = (value[3] << 24) | (value[2] << 16)
| (value[1] << 8) | value[0];
set_regi(&sregs, regno, regval);
- return -1;
+ return length;
}
diff --git a/sim/h8300/ChangeLog b/sim/h8300/ChangeLog
index adda60e..81d9d01 100644
--- a/sim/h8300/ChangeLog
+++ b/sim/h8300/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * compile.c (sim_store_register): Update return value to
+ match new API.
+
2010-04-14 Mike Frysinger <vapier@gentoo.org>
* compile.c (sim_write): Add const to buffer arg.
diff --git a/sim/h8300/compile.c b/sim/h8300/compile.c
index 44d60f6..b249080 100644
--- a/sim/h8300/compile.c
+++ b/sim/h8300/compile.c
@@ -4715,7 +4715,7 @@ sim_store_register (SIM_DESC sd, int rn, unsigned char *value, int length)
h8_set_ticks (sd, longval);
break;
}
- return -1;
+ return length;
}
int
diff --git a/sim/m32c/ChangeLog b/sim/m32c/ChangeLog
index 89e6643..1a34d71 100644
--- a/sim/m32c/ChangeLog
+++ b/sim/m32c/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * gdb-if.c (sim_store_register): Update return value to
+ match new API.
+
2010-12-04 Masaki Muranaka <monaka@monami-software.com>
* Makefile.in: Use CC_FOR_BUILD to build opc2c.
diff --git a/sim/m32c/gdb-if.c b/sim/m32c/gdb-if.c
index 1a93ab6..7da4416 100644
--- a/sim/m32c/gdb-if.c
+++ b/sim/m32c/gdb-if.c
@@ -406,7 +406,7 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
check_desc (sd);
if (!check_regno (regno))
- return 0;
+ return -1;
size = reg_size (regno);
@@ -503,7 +503,7 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
default:
fprintf (stderr, "m32c minisim: unrecognized register number: %d\n",
regno);
- return -1;
+ return 0;
}
}
diff --git a/sim/mn10300/ChangeLog b/sim/mn10300/ChangeLog
index 0717a71..2077186 100644
--- a/sim/mn10300/ChangeLog
+++ b/sim/mn10300/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * interp.c (sim_store_register): Update return value to
+ match new API.
+
2010-04-19 Mike Frysinger <vapier@gentoo.org>
* dv-mn103ser.c (sockser_addr, USE_SOCKSER_P): Delete
diff --git a/sim/mn10300/interp.c b/sim/mn10300/interp.c
index 6beac48..1230bf5 100644
--- a/sim/mn10300/interp.c
+++ b/sim/mn10300/interp.c
@@ -410,7 +410,7 @@ sim_store_register (SIM_DESC sd,
int length)
{
State.regs[rn] = get_word (memory);
- return -1;
+ return length;
}
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 3a2f8ce..faeec4f 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * gdb-sim.c (sim_store_register): Update return value to
+ match new API.
+
2011-01-05 Joel Brobecker <brobecker@adacore.com>
* psim.texinfo: Copyright year update.
diff --git a/sim/ppc/gdb-sim.c b/sim/ppc/gdb-sim.c
index 97567ec..9041f70 100644
--- a/sim/ppc/gdb-sim.c
+++ b/sim/ppc/gdb-sim.c
@@ -1290,7 +1290,7 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
const char *regname = regnum2name (regno);
if (simulator == NULL || regname == NULL)
- return -1;
+ return 0;
TRACE(trace_gdb, ("sim_store_register(regno=%d(%s), buf=0x%lx)\n",
regno, regname, (long)buf));
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
index 1f9866a..f29cb93 100644
--- a/sim/rx/ChangeLog
+++ b/sim/rx/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * gdb-if.c (sim_store_register): Update return value to
+ match new API.
+
2010-12-14 DJ Delorie <dj@redhat.com>
* rx.c (decode_opcode): For "MVFC PC,", use the address of the
diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c
index 8922228..ca41161 100644
--- a/sim/rx/gdb-if.c
+++ b/sim/rx/gdb-if.c
@@ -534,12 +534,12 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
check_desc (sd);
if (!check_regno (regno))
- return 0;
+ return -1;
size = reg_size (regno);
if (length != size)
- return 0;
+ return -1;
if (rx_big_endian)
val = get_be (buf, length);
@@ -630,7 +630,7 @@ sim_store_register (SIM_DESC sd, int regno, unsigned char *buf, int length)
default:
fprintf (stderr, "rx minisim: unrecognized register number: %d\n",
regno);
- return -1;
+ return 0;
}
return size;
diff --git a/sim/v850/ChangeLog b/sim/v850/ChangeLog
index 4d43d3e..5ca0e57 100644
--- a/sim/v850/ChangeLog
+++ b/sim/v850/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-11 Andrew Burgess <aburgess@broadcom.com>
+
+ * interp.c (sim_store_register): Update return value to
+ match new API.
+
2010-03-30 Mike Frysinger <vapier@gentoo.org>
* interp.c (interrupt_names): Add const to pointer type.
diff --git a/sim/v850/interp.c b/sim/v850/interp.c
index e8bea5f..21b587e 100644
--- a/sim/v850/interp.c
+++ b/sim/v850/interp.c
@@ -327,7 +327,7 @@ sim_store_register (sd, rn, memory, length)
int length;
{
State.regs[rn] = T2H_4 (*(unsigned32*)memory);
- return -1;
+ return length;
}
void