GDB (xrefs)
|
#include "defs.h"
#include "gdb_string.h"
#include "cli/cli-decode.h"
#include "cli/cli-cmds.h"
#include "value.h"
#include "completer.h"
#include "gdb_assert.h"
#include <ctype.h>
#include "target.h"
#include "readline/readline.h"
#include "gdbcore.h"
#include "cli/cli-utils.h"
#include "gdb_bfd.h"
#include "filestuff.h"
Go to the source code of this file.
Classes | |
struct | dump_context |
struct | callback_data |
Functions | |
static char * | scan_expression_with_cleanup (char **cmd, const char *def) |
static char * | scan_filename_with_cleanup (char **cmd, const char *defname) |
static FILE * | fopen_with_cleanup (const char *filename, const char *mode) |
static bfd * | bfd_openr_with_cleanup (const char *filename, const char *target) |
static bfd * | bfd_openw_with_cleanup (const char *filename, const char *target, const char *mode) |
static void | dump_command (char *cmd, int from_tty) |
static void | append_command (char *cmd, int from_tty) |
static void | dump_binary_file (const char *filename, const char *mode, const bfd_byte *buf, ULONGEST len) |
static void | dump_bfd_file (const char *filename, const char *mode, const char *target, CORE_ADDR vaddr, const bfd_byte *buf, ULONGEST len) |
static void | dump_memory_to_file (char *cmd, char *mode, char *file_format) |
static void | dump_memory_command (char *cmd, char *mode) |
static void | dump_value_to_file (char *cmd, char *mode, char *file_format) |
static void | dump_value_command (char *cmd, char *mode) |
static void | dump_srec_memory (char *args, int from_tty) |
static void | dump_srec_value (char *args, int from_tty) |
static void | dump_ihex_memory (char *args, int from_tty) |
static void | dump_ihex_value (char *args, int from_tty) |
static void | dump_tekhex_memory (char *args, int from_tty) |
static void | dump_tekhex_value (char *args, int from_tty) |
static void | dump_binary_memory (char *args, int from_tty) |
static void | dump_binary_value (char *args, int from_tty) |
static void | append_binary_memory (char *args, int from_tty) |
static void | append_binary_value (char *args, int from_tty) |
static void | call_dump_func (struct cmd_list_element *c, char *args, int from_tty) |
static void | add_dump_command (char *name, void(*func)(char *args, char *mode), char *descr) |
static void | restore_section_callback (bfd *ibfd, asection *isec, void *args) |
static void | restore_binary_file (char *filename, struct callback_data *data) |
static void | restore_command (char *args, int from_tty) |
static void | srec_dump_command (char *cmd, int from_tty) |
static void | ihex_dump_command (char *cmd, int from_tty) |
static void | tekhex_dump_command (char *cmd, int from_tty) |
static void | binary_dump_command (char *cmd, int from_tty) |
static void | binary_append_command (char *cmd, int from_tty) |
void | _initialize_cli_dump (void) |
Variables | |
static struct cmd_list_element * | dump_cmdlist |
static struct cmd_list_element * | append_cmdlist |
static struct cmd_list_element * | srec_cmdlist |
static struct cmd_list_element * | ihex_cmdlist |
static struct cmd_list_element * | tekhex_cmdlist |
static struct cmd_list_element * | binary_dump_cmdlist |
static struct cmd_list_element * | binary_append_cmdlist |
initialize_file_ftype | _initialize_cli_dump |
void _initialize_cli_dump | ( | void | ) |
Definition at line 663 of file cli-dump.c.
References _, add_cmd(), add_com(), add_dump_command(), add_prefix_cmd(), all_commands, append_binary_memory(), append_binary_value(), append_command(), binary_append_command(), binary_dump_command(), class_vars, cmdlist, cmd_list_element::completer, dump_binary_memory(), dump_binary_value(), dump_command(), dump_ihex_memory(), dump_ihex_value(), dump_memory_command(), dump_srec_memory(), dump_srec_value(), dump_tekhex_memory(), dump_tekhex_value(), dump_value_command(), ihex_dump_command(), restore_command(), srec_dump_command(), and tekhex_dump_command().
static void add_dump_command | ( | char * | name, |
void(*)(char *args, char *mode) | func, | ||
char * | descr | ||
) | [static] |
Definition at line 390 of file cli-dump.c.
References add_cmd(), all_commands, call_dump_func(), cmd_list_element::completer, cmd_list_element::doc, cmd_list_element::func, dump_context::func, func, dump_context::mode, set_cmd_context(), and XMALLOC.
Referenced by _initialize_cli_dump().
static void append_binary_memory | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 364 of file cli-dump.c.
References dump_memory_to_file().
Referenced by _initialize_cli_dump().
static void append_binary_value | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 370 of file cli-dump.c.
References dump_value_to_file().
Referenced by _initialize_cli_dump().
static void append_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 167 of file cli-dump.c.
References _, gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
static bfd* bfd_openr_with_cleanup | ( | const char * | filename, |
const char * | target | ||
) | [static] |
Definition at line 109 of file cli-dump.c.
References _, error(), gdb_bfd_openr(), and make_cleanup_bfd_unref().
Referenced by restore_command().
static bfd* bfd_openw_with_cleanup | ( | const char * | filename, |
const char * | target, | ||
const char * | mode | ||
) | [static] |
Definition at line 126 of file cli-dump.c.
References _, error(), gdb_bfd_openw(), and make_cleanup_bfd_unref().
Referenced by dump_bfd_file().
static void binary_append_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 654 of file cli-dump.c.
References gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
static void binary_dump_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 647 of file cli-dump.c.
References gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
static void call_dump_func | ( | struct cmd_list_element * | c, |
char * | args, | ||
int | from_tty | ||
) | [static] |
Definition at line 382 of file cli-dump.c.
References dump_context::func, get_cmd_context(), and dump_context::mode.
Referenced by add_dump_command().
static void dump_bfd_file | ( | const char * | filename, |
const char * | mode, | ||
const char * | target, | ||
CORE_ADDR | vaddr, | ||
const bfd_byte * | buf, | ||
ULONGEST | len | ||
) | [static] |
Definition at line 187 of file cli-dump.c.
References _, bfd_openw_with_cleanup(), and warning().
Referenced by dump_memory_to_file(), and dump_value_to_file().
static void dump_binary_file | ( | const char * | filename, |
const char * | mode, | ||
const bfd_byte * | buf, | ||
ULONGEST | len | ||
) | [static] |
Definition at line 174 of file cli-dump.c.
References fopen_with_cleanup(), perror_with_name(), and exsummary::status.
Referenced by dump_memory_to_file(), and dump_value_to_file().
static void dump_binary_memory | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 352 of file cli-dump.c.
References dump_memory_to_file().
Referenced by _initialize_cli_dump().
static void dump_binary_value | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 358 of file cli-dump.c.
References dump_value_to_file().
Referenced by _initialize_cli_dump().
static void dump_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 160 of file cli-dump.c.
References _, gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
static void dump_ihex_memory | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 328 of file cli-dump.c.
References dump_memory_to_file().
Referenced by _initialize_cli_dump().
static void dump_ihex_value | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 334 of file cli-dump.c.
References dump_value_to_file().
Referenced by _initialize_cli_dump().
static void dump_memory_command | ( | char * | cmd, |
char * | mode | ||
) | [static] |
Definition at line 259 of file cli-dump.c.
References dump_memory_to_file().
Referenced by _initialize_cli_dump().
static void dump_memory_to_file | ( | char * | cmd, |
char * | mode, | ||
char * | file_format | ||
) | [static] |
Definition at line 209 of file cli-dump.c.
References _, do_cleanups(), dump_bfd_file(), dump_binary_file(), error(), make_cleanup(), null_cleanup(), parse_and_eval_address(), read_memory(), scan_expression_with_cleanup(), scan_filename_with_cleanup(), ULONGEST, xfree(), and xmalloc().
Referenced by append_binary_memory(), dump_binary_memory(), dump_ihex_memory(), dump_memory_command(), dump_srec_memory(), and dump_tekhex_memory().
static void dump_srec_memory | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 316 of file cli-dump.c.
References dump_memory_to_file().
Referenced by _initialize_cli_dump().
static void dump_srec_value | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 322 of file cli-dump.c.
References dump_value_to_file().
Referenced by _initialize_cli_dump().
static void dump_tekhex_memory | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 340 of file cli-dump.c.
References dump_memory_to_file().
Referenced by _initialize_cli_dump().
static void dump_tekhex_value | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 346 of file cli-dump.c.
References dump_value_to_file().
Referenced by _initialize_cli_dump().
static void dump_value_command | ( | char * | cmd, |
char * | mode | ||
) | [static] |
Definition at line 310 of file cli-dump.c.
References dump_value_to_file().
Referenced by _initialize_cli_dump().
static void dump_value_to_file | ( | char * | cmd, |
char * | mode, | ||
char * | file_format | ||
) | [static] |
Definition at line 265 of file cli-dump.c.
References _, do_cleanups(), dump_bfd_file(), dump_binary_file(), error(), make_cleanup(), null_cleanup(), parse_and_eval(), scan_filename_with_cleanup(), TYPE_LENGTH, value_address(), value_contents(), VALUE_LVAL, value_type(), and warning().
Referenced by append_binary_value(), dump_binary_value(), dump_ihex_value(), dump_srec_value(), dump_tekhex_value(), and dump_value_command().
static FILE* fopen_with_cleanup | ( | const char * | filename, |
const char * | mode | ||
) | [static] |
Definition at line 98 of file cli-dump.c.
References gdb_fopen_cloexec(), make_cleanup_fclose(), and perror_with_name().
Referenced by dump_binary_file(), and restore_binary_file().
static void ihex_dump_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 633 of file cli-dump.c.
References gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
static void restore_binary_file | ( | char * | filename, |
struct callback_data * | data | ||
) | [static] |
Definition at line 506 of file cli-dump.c.
References _, do_cleanups(), error(), fopen_with_cleanup(), len, callback_data::load_end, callback_data::load_offset, callback_data::load_start, make_cleanup(), null_cleanup(), perror_with_name(), printf_filtered(), safe_strerror(), target_write_memory(), warning(), xfree(), and xmalloc().
Referenced by restore_command().
static void restore_command | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 558 of file cli-dump.c.
References _, bfd_openr_with_cleanup(), error(), info_verbose, callback_data::load_end, callback_data::load_offset, callback_data::load_start, noprocess(), parse_and_eval_address(), parse_and_eval_long(), printf_filtered(), restore_binary_file(), restore_section_callback(), scan_expression_with_cleanup(), scan_filename_with_cleanup(), skip_spaces(), and target_has_execution.
Referenced by _initialize_cli_dump().
static void restore_section_callback | ( | bfd * | ibfd, |
asection * | isec, | ||
void * | args | ||
) | [static] |
Definition at line 437 of file cli-dump.c.
References _, do_cleanups(), error(), callback_data::load_end, callback_data::load_offset, callback_data::load_start, make_cleanup(), paddress(), printf_filtered(), puts_filtered(), safe_strerror(), size, target_gdbarch(), target_write_memory(), warning(), xfree(), and xmalloc().
Referenced by restore_command().
static char* scan_expression_with_cleanup | ( | char ** | cmd, |
const char * | def | ||
) | [static] |
Definition at line 39 of file cli-dump.c.
References make_cleanup(), savestring(), skip_spaces(), and xfree().
Referenced by dump_memory_to_file(), and restore_command().
static char* scan_filename_with_cleanup | ( | char ** | cmd, |
const char * | defname | ||
) | [static] |
Definition at line 63 of file cli-dump.c.
References _, error(), gdb_assert, make_cleanup(), savestring(), skip_spaces(), and xfree().
Referenced by dump_memory_to_file(), dump_value_to_file(), and restore_command().
static void srec_dump_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 626 of file cli-dump.c.
References gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
static void tekhex_dump_command | ( | char * | cmd, |
int | from_tty | ||
) | [static] |
Definition at line 640 of file cli-dump.c.
References gdb_stdout, help_list(), and printf_unfiltered().
Referenced by _initialize_cli_dump().
Referenced by initialize_all_files().
struct cmd_list_element* append_cmdlist [static] |
Definition at line 152 of file cli-dump.c.
struct cmd_list_element* binary_append_cmdlist [static] |
Definition at line 157 of file cli-dump.c.
struct cmd_list_element* binary_dump_cmdlist [static] |
Definition at line 156 of file cli-dump.c.
struct cmd_list_element* dump_cmdlist [static] |
Definition at line 151 of file cli-dump.c.
struct cmd_list_element* ihex_cmdlist [static] |
Definition at line 154 of file cli-dump.c.
struct cmd_list_element* srec_cmdlist [static] |
Definition at line 153 of file cli-dump.c.
struct cmd_list_element* tekhex_cmdlist [static] |
Definition at line 155 of file cli-dump.c.