* hppa-tdep.c (hppa_push_arguments): Allocate enough space for
[deliverable/binutils-gdb.git] / gdb / core.c
index f80f66c8f9984f2b9bdc176f828306d05981595b..691637182f633d4ceae437d5d68d4262bd072b4e 100644 (file)
@@ -25,6 +25,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include "inferior.h"
 #include "symtab.h"
 #include "command.h"
+#include "gdbcmd.h"
 #include "bfd.h"
 #include "target.h"
 #include "gdbcore.h"
@@ -170,7 +171,7 @@ dis_asm_read_memory (memaddr, myaddr, len, info)
      int len;
      disassemble_info *info;
 {
-  return target_read_memory (memaddr, myaddr, len);
+  return target_read_memory (memaddr, (char *) myaddr, len);
 }
 
 /* Like memory_error with slightly different parameters.  */
@@ -244,14 +245,52 @@ 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()
 {
-
-  add_com ("core-file", class_files, core_file_command,
-          "Use FILE as core dump for examining memory and registers.\n\
+  struct cmd_list_element *c;
+  c = add_cmd ("core-file", class_files, core_file_command,
+              "Use FILE as core dump for examining memory and registers.\n\
 No arg means have no core file.  This command has been superseded by the\n\
-`target core' and `detach' commands.");
-
+`target core' and `detach' commands.", &cmdlist);
+  c->completer = filename_completer;
 }
This page took 0.023613 seconds and 4 git commands to generate.