* Rename remote-es1800.c to remote-es.c
[deliverable/binutils-gdb.git] / gdb / core.c
index ca52e39af10a097b1df0906d94e05d207a258f40..51ffb420211148d99959ea5ae6b41b0682dc323d 100644 (file)
@@ -28,6 +28,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "bfd.h"
 #include "target.h"
 #include "gdbcore.h"
+#include "dis-asm.h"
 
 extern char registers[];
 
@@ -160,6 +161,37 @@ read_memory (memaddr, myaddr, len)
     memory_error (status, memaddr);
 }
 
+/* Like target_read_memory, but slightly different parameters.  */
+
+int
+dis_asm_read_memory (memaddr, myaddr, len, info)
+     bfd_vma memaddr;
+     bfd_byte *myaddr;
+     int len;
+     disassemble_info *info;
+{
+  return target_read_memory (memaddr, (char *) myaddr, len);
+}
+
+/* Like memory_error with slightly different parameters.  */
+void
+dis_asm_memory_error (status, memaddr, info)
+     int status;
+     bfd_vma memaddr;
+     disassemble_info *info;
+{
+  memory_error (status, memaddr);
+}
+
+/* Like print_address with slightly different parameters.  */
+void
+dis_asm_print_address (addr, info)
+     bfd_vma addr;
+     struct disassemble_info *info;
+{
+  print_address (addr, info->stream);
+}
+
 /* Same as target_write_memory, but report an error if can't write.  */
 void
 write_memory (memaddr, myaddr, len)
@@ -212,6 +244,44 @@ read_memory_integer (memaddr, len)
   error ("Cannot handle integers of %d bytes.", len);
   return -1;   /* for lint */
 }
+
+
+unsigned long
+read_memory_unsigned_integer (memaddr, len)
+     CORE_ADDR memaddr;
+     int len;
+{
+  unsigned char cbuf;
+  unsigned short sbuf;
+  unsigned int ibuf;
+  unsigned long lbuf;
+
+  if (len == sizeof (char))
+    {
+      read_memory (memaddr, &cbuf, len);
+      return cbuf;
+    }
+  if (len == sizeof (short))
+    {
+      read_memory (memaddr, (char *)&sbuf, len);
+      SWAP_TARGET_AND_HOST (&sbuf, sizeof (short));
+      return sbuf;
+    }
+  if (len == sizeof (int))
+    {
+      read_memory (memaddr, (char *)&ibuf, len);
+      SWAP_TARGET_AND_HOST (&ibuf, sizeof (int));
+      return ibuf;
+    }
+  if (len == sizeof (lbuf))
+    {
+      read_memory (memaddr, (char *)&lbuf, len);
+      SWAP_TARGET_AND_HOST (&lbuf, sizeof (lbuf));
+      return lbuf;
+    }
+  error ("Cannot handle unsigned integers of %d bytes.", len);
+  return -1;   /* for lint */
+}
 \f
 void
 _initialize_core()
This page took 0.025826 seconds and 4 git commands to generate.