2005-02-06 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / cli / cli-dump.c
index 9e9c3de4b91a8d5904d8f8e6905026f82554dcbf..4030a85693cb176f29e28ba05b3e488bce139673 100644 (file)
@@ -1,6 +1,6 @@
 /* Dump-to-file commands, for GDB, the GNU debugger.
 
-   Copyright 2002 Free Software Foundation, Inc.
+   Copyright 2002, 2005 Free Software Foundation, Inc.
 
    Contributed by Red Hat.
 
@@ -31,7 +31,7 @@
 #include "gdb_assert.h"
 #include <ctype.h>
 #include "target.h"
-#include <readline/readline.h>
+#include "readline/readline.h"
 
 #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE)))
 
@@ -118,7 +118,7 @@ scan_filename_with_cleanup (char **cmd, const char *defname)
 }
 
 FILE *
-fopen_with_cleanup (char *filename, const char *mode)
+fopen_with_cleanup (const char *filename, const char *mode)
 {
   FILE *file = fopen (filename, mode);
   if (file == NULL)
@@ -145,7 +145,8 @@ bfd_openr_with_cleanup (const char *filename, const char *target)
 }
 
 static bfd *
-bfd_openw_with_cleanup (char *filename, const char *target, char *mode)
+bfd_openw_with_cleanup (const char *filename, const char *target,
+                       const char *mode)
 {
   bfd *obfd;
 
@@ -192,8 +193,8 @@ append_command (char *cmd, int from_tty)
 }
 
 static void
-dump_binary_file (char *filename, char *mode, 
-                 char *buf, int len)
+dump_binary_file (const char *filename, const char *mode, 
+                 const bfd_byte *buf, int len)
 {
   FILE *file;
   int status;
@@ -205,9 +206,9 @@ dump_binary_file (char *filename, char *mode,
 }
 
 static void
-dump_bfd_file (char *filename, char *mode, 
-              char *target, CORE_ADDR vaddr, 
-              char *buf, int len)
+dump_bfd_file (const char *filename, const char *mode, 
+              const char *target, CORE_ADDR vaddr, 
+              const bfd_byte *buf, int len)
 {
   bfd *obfd;
   asection *osection;
@@ -299,8 +300,8 @@ dump_value_to_file (char *cmd, char *mode, char *file_format)
   /* Have everything.  Open/write the data.  */
   if (file_format == NULL || strcmp (file_format, "binary") == 0)
     {
-      dump_binary_file (filename, mode, VALUE_CONTENTS (val), 
-                       TYPE_LENGTH (VALUE_TYPE (val)));
+      dump_binary_file (filename, mode, value_contents (val), 
+                       TYPE_LENGTH (value_type (val)));
     }
   else
     {
@@ -317,8 +318,8 @@ dump_value_to_file (char *cmd, char *mode, char *file_format)
        }
 
       dump_bfd_file (filename, mode, file_format, vaddr, 
-                    VALUE_CONTENTS (val), 
-                    TYPE_LENGTH (VALUE_TYPE (val)));
+                    value_contents (val), 
+                    TYPE_LENGTH (value_type (val)));
     }
 
   do_cleanups (old_cleanups);
@@ -427,8 +428,8 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
   set_cmd_context (c, d);
   c->func = call_dump_func;
 
-  /* Replace "Dump " at start of docstring with "Append "
-     (borrowed from add_show_from_set).  */
+  /* Replace "Dump " at start of docstring with "Append " (borrowed
+     from deprecated_add_show_from_set).  */
   if (   c->doc[0] == 'W' 
       && c->doc[1] == 'r' 
       && c->doc[2] == 'i'
This page took 0.025422 seconds and 4 git commands to generate.