* rs6000-tdep.c (rs6000_fetch_instruction)
[deliverable/binutils-gdb.git] / gdb / gdbserver / regcache.c
index a42d95ba9f0100e9c15134d6127cd1fbab38a69d..a324d43df65ccdb6c2d38347bc7f45b564390679 100644 (file)
@@ -86,12 +86,6 @@ regcache_invalidate ()
   for_each_inferior (&all_threads, regcache_invalidate_one);
 }
 
-int
-registers_length (void)
-{
-  return 2 * register_bytes;
-}
-
 void *
 new_register_cache (void)
 {
@@ -147,6 +141,10 @@ set_register_cache (struct reg *regs, int n)
 
   register_bytes = offset / 8;
 
+  /* Make sure PBUFSIZ is large enough to hold a full register packet.  */
+  if (2 * register_bytes + 32 > PBUFSIZ)
+    fatal ("Register packet size exceeds PBUFSIZ.");
+
   /* Re-allocate all pre-existing register caches.  */
   for_each_inferior (&all_threads, realloc_register_cache);
 }
This page took 0.023822 seconds and 4 git commands to generate.