/* 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.
#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)))
}
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)
}
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;
}
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;
}
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;
/* 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
{
}
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);
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'