Do not include parser-defs.h from c-lang.h
[deliverable/binutils-gdb.git] / gdbserver / regcache.cc
index f63463344afaf02cc96df5a750cc7909406f144f..8ae195e0304eb45d6e1c46efa8195af78427b07d 100644 (file)
@@ -198,7 +198,7 @@ regcache_cpy (struct regcache *dst, struct regcache *src)
 
 /* Return a reference to the description of register N.  */
 
-static const struct reg &
+static const struct gdb::reg &
 find_register_by_number (const struct target_desc *tdesc, int n)
 {
   return tdesc->reg_defs[n];
@@ -300,7 +300,7 @@ regcache_register_size (const struct regcache *regcache, int n)
 }
 
 static unsigned char *
-register_data (const struct regcache *regcache, int n, int fetch)
+register_data (const struct regcache *regcache, int n)
 {
   return (regcache->registers
          + find_register_by_number (regcache->tdesc, n).offset / 8);
@@ -319,7 +319,7 @@ regcache::raw_supply (int n, const void *buf)
 {
   if (buf)
     {
-      memcpy (register_data (this, n, 0), buf, register_size (tdesc, n));
+      memcpy (register_data (this, n), buf, register_size (tdesc, n));
 #ifndef IN_PROCESS_AGENT
       if (register_status != NULL)
        register_status[n] = REG_VALID;
@@ -327,7 +327,7 @@ regcache::raw_supply (int n, const void *buf)
     }
   else
     {
-      memset (register_data (this, n, 0), 0, register_size (tdesc, n));
+      memset (register_data (this, n), 0, register_size (tdesc, n));
 #ifndef IN_PROCESS_AGENT
       if (register_status != NULL)
        register_status[n] = REG_UNAVAILABLE;
@@ -340,7 +340,7 @@ regcache::raw_supply (int n, const void *buf)
 void
 supply_register_zeroed (struct regcache *regcache, int n)
 {
-  memset (register_data (regcache, n, 0), 0,
+  memset (register_data (regcache, n), 0,
          register_size (regcache->tdesc, n));
 #ifndef IN_PROCESS_AGENT
   if (regcache->register_status != NULL)
@@ -420,7 +420,7 @@ collect_register (struct regcache *regcache, int n, void *buf)
 void
 regcache::raw_collect (int n, void *buf) const
 {
-  memcpy (buf, register_data (this, n, 1), register_size (tdesc, n));
+  memcpy (buf, register_data (this, n), register_size (tdesc, n));
 }
 
 enum register_status
@@ -437,8 +437,8 @@ regcache_raw_read_unsigned (struct regcache *regcache, int regnum,
 
   if (size > (int) sizeof (ULONGEST))
     error (_("That operation is not available on integers of more than"
-            "%d bytes."),
-          (int) sizeof (ULONGEST));
+           "%d bytes."),
+         (int) sizeof (ULONGEST));
 
   *val = 0;
   collect_register (regcache, regnum, val);
@@ -461,7 +461,7 @@ regcache_raw_get_unsigned_by_name (struct regcache *regcache,
 void
 collect_register_as_string (struct regcache *regcache, int n, char *buf)
 {
-  bin2hex (register_data (regcache, n, 1), buf,
+  bin2hex (register_data (regcache, n), buf,
           register_size (regcache->tdesc, n));
 }
 
@@ -477,25 +477,13 @@ collect_register_by_name (struct regcache *regcache,
 CORE_ADDR
 regcache_read_pc (struct regcache *regcache)
 {
-  CORE_ADDR pc_val;
-
-  if (the_target->read_pc)
-    pc_val = the_target->read_pc (regcache);
-  else
-    internal_error (__FILE__, __LINE__,
-                   "regcache_read_pc: Unable to find PC");
-
-  return pc_val;
+  return the_target->read_pc (regcache);
 }
 
 void
 regcache_write_pc (struct regcache *regcache, CORE_ADDR pc)
 {
-  if (the_target->write_pc)
-    the_target->write_pc (regcache, pc);
-  else
-    internal_error (__FILE__, __LINE__,
-                   "regcache_write_pc: Unable to update PC");
+  the_target->write_pc (regcache, pc);
 }
 
 #endif
@@ -520,7 +508,7 @@ regcache::raw_compare (int regnum, const void *buf, int offset) const
 {
   gdb_assert (buf != NULL);
 
-  const unsigned char *regbuf = register_data (this, regnum, 1);
+  const unsigned char *regbuf = register_data (this, regnum);
   int size = register_size (tdesc, regnum);
   gdb_assert (size >= offset);
 
This page took 0.027171 seconds and 4 git commands to generate.