GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
cli-dump.c File Reference
#include "defs.h"
#include "cli/cli-decode.h"
#include "cli/cli-cmds.h"
#include "value.h"
#include "completer.h"
#include <ctype.h>
#include "target.h"
#include "readline/tilde.h"
#include "gdbcore.h"
#include "cli/cli-utils.h"
#include "gdb_bfd.h"
#include "gdbsupport/filestuff.h"
#include "gdbsupport/byte-vector.h"
#include "gdbarch.h"

Go to the source code of this file.

Classes

struct  dump_context
 

Functions

static gdb::unique_xmalloc_ptr< char > scan_expression (const char **cmd, const char *def)
 
static gdb::unique_xmalloc_ptr< char > scan_filename (const char **cmd, const char *defname)
 
static gdb_bfd_ref_ptr bfd_openr_or_error (const char *filename, const char *target)
 
static gdb_bfd_ref_ptr bfd_openw_or_error (const char *filename, const char *target, const char *mode)
 
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 (const char *cmd, const char *mode, const char *file_format)
 
static void dump_memory_command (const char *cmd, const char *mode)
 
static void dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
 
static void dump_value_command (const char *cmd, const char *mode)
 
static void dump_srec_memory (const char *args, int from_tty)
 
static void dump_srec_value (const char *args, int from_tty)
 
static void dump_ihex_memory (const char *args, int from_tty)
 
static void dump_ihex_value (const char *args, int from_tty)
 
static void dump_verilog_memory (const char *args, int from_tty)
 
static void dump_verilog_value (const char *args, int from_tty)
 
static void dump_tekhex_memory (const char *args, int from_tty)
 
static void dump_tekhex_value (const char *args, int from_tty)
 
static void dump_binary_memory (const char *args, int from_tty)
 
static void dump_binary_value (const char *args, int from_tty)
 
static void append_binary_memory (const char *args, int from_tty)
 
static void append_binary_value (const char *args, int from_tty)
 
static void call_dump_func (const char *args, int from_tty, cmd_list_element *c)
 
static void add_dump_command (const char *name, void(*func)(const char *args, const char *mode), const char *descr)
 
static void restore_one_section (bfd *ibfd, asection *isec, CORE_ADDR load_offset, CORE_ADDR load_start, CORE_ADDR load_end)
 
static void restore_binary_file (const char *filename, CORE_ADDR load_offset, CORE_ADDR load_start, CORE_ADDR load_end)
 
static void restore_command (const char *args, int from_tty)
 
void _initialize_cli_dump ()
 

Variables

static struct cmd_list_elementdump_cmdlist
 
static struct cmd_list_elementappend_cmdlist
 
static struct cmd_list_elementsrec_cmdlist
 
static struct cmd_list_elementihex_cmdlist
 
static struct cmd_list_elementverilog_cmdlist
 
static struct cmd_list_elementtekhex_cmdlist
 
static struct cmd_list_elementbinary_dump_cmdlist
 
static struct cmd_list_elementbinary_append_cmdlist
 

Function Documentation

◆ _initialize_cli_dump()

void _initialize_cli_dump ( )

Definition at line 569 of file cli-dump.c.

Referenced by initialize_all_files().

◆ add_dump_command()

static void add_dump_command ( const char * name,
void(*)(const char *args, const char *mode) func,
const char * descr )
static

◆ append_binary_memory()

static void append_binary_memory ( const char * args,
int from_tty )
static

Definition at line 316 of file cli-dump.c.

References dump_memory_to_file().

◆ append_binary_value()

static void append_binary_value ( const char * args,
int from_tty )
static

Definition at line 322 of file cli-dump.c.

References dump_value_to_file().

◆ bfd_openr_or_error()

static gdb_bfd_ref_ptr bfd_openr_or_error ( const char * filename,
const char * target )
static

Definition at line 85 of file cli-dump.c.

References gdb_bfd_openr().

Referenced by restore_command().

◆ bfd_openw_or_error()

static gdb_bfd_ref_ptr bfd_openw_or_error ( const char * filename,
const char * target,
const char * mode )
static

Definition at line 99 of file cli-dump.c.

References gdb_bfd_openw().

Referenced by dump_bfd_file().

◆ call_dump_func()

static void call_dump_func ( const char * args,
int from_tty,
cmd_list_element * c )
static

Definition at line 334 of file cli-dump.c.

References cmd_list_element::context(), dump_context::func, and dump_context::mode.

Referenced by add_dump_command().

◆ dump_bfd_file()

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 147 of file cli-dump.c.

References bfd_openw_or_error().

Referenced by dump_memory_to_file(), and dump_value_to_file().

◆ dump_binary_file()

static void dump_binary_file ( const char * filename,
const char * mode,
const bfd_byte * buf,
ULONGEST len )
static

Definition at line 132 of file cli-dump.c.

References status.

Referenced by dump_memory_to_file(), and dump_value_to_file().

◆ dump_binary_memory()

static void dump_binary_memory ( const char * args,
int from_tty )
static

Definition at line 304 of file cli-dump.c.

References dump_memory_to_file().

◆ dump_binary_value()

static void dump_binary_value ( const char * args,
int from_tty )
static

Definition at line 310 of file cli-dump.c.

References dump_value_to_file().

◆ dump_ihex_memory()

static void dump_ihex_memory ( const char * args,
int from_tty )
static

Definition at line 268 of file cli-dump.c.

References dump_memory_to_file().

◆ dump_ihex_value()

static void dump_ihex_value ( const char * args,
int from_tty )
static

Definition at line 274 of file cli-dump.c.

References dump_value_to_file().

◆ dump_memory_command()

static void dump_memory_command ( const char * cmd,
const char * mode )
static

Definition at line 205 of file cli-dump.c.

References dump_memory_to_file().

◆ dump_memory_to_file()

static void dump_memory_to_file ( const char * cmd,
const char * mode,
const char * file_format )
static

◆ dump_srec_memory()

static void dump_srec_memory ( const char * args,
int from_tty )
static

Definition at line 256 of file cli-dump.c.

References dump_memory_to_file().

◆ dump_srec_value()

static void dump_srec_value ( const char * args,
int from_tty )
static

Definition at line 262 of file cli-dump.c.

References dump_value_to_file().

◆ dump_tekhex_memory()

static void dump_tekhex_memory ( const char * args,
int from_tty )
static

Definition at line 292 of file cli-dump.c.

References dump_memory_to_file().

◆ dump_tekhex_value()

static void dump_tekhex_value ( const char * args,
int from_tty )
static

Definition at line 298 of file cli-dump.c.

References dump_value_to_file().

◆ dump_value_command()

static void dump_value_command ( const char * cmd,
const char * mode )
static

Definition at line 250 of file cli-dump.c.

References dump_value_to_file().

◆ dump_value_to_file()

static void dump_value_to_file ( const char * cmd,
const char * mode,
const char * file_format )
static

◆ dump_verilog_memory()

static void dump_verilog_memory ( const char * args,
int from_tty )
static

Definition at line 280 of file cli-dump.c.

References dump_memory_to_file().

◆ dump_verilog_value()

static void dump_verilog_value ( const char * args,
int from_tty )
static

Definition at line 286 of file cli-dump.c.

References dump_value_to_file().

◆ restore_binary_file()

static void restore_binary_file ( const char * filename,
CORE_ADDR load_offset,
CORE_ADDR load_start,
CORE_ADDR load_end )
static

Definition at line 446 of file cli-dump.c.

References gdb_printf(), SEEK_SET, and target_write_memory().

Referenced by restore_command().

◆ restore_command()

static void restore_command ( const char * args,
int from_tty )
static

◆ restore_one_section()

static void restore_one_section ( bfd * ibfd,
asection * isec,
CORE_ADDR load_offset,
CORE_ADDR load_start,
CORE_ADDR load_end )
static

Definition at line 380 of file cli-dump.c.

References gdb_printf(), gdb_puts(), paddress(), size, target_gdbarch(), and target_write_memory().

Referenced by restore_command().

◆ scan_expression()

static gdb::unique_xmalloc_ptr< char > scan_expression ( const char ** cmd,
const char * def )
static

Definition at line 38 of file cli-dump.c.

Referenced by dump_memory_to_file(), and restore_command().

◆ scan_filename()

static gdb::unique_xmalloc_ptr< char > scan_filename ( const char ** cmd,
const char * defname )
static

Definition at line 56 of file cli-dump.c.

Referenced by dump_memory_to_file(), dump_value_to_file(), and restore_command().

Variable Documentation

◆ append_cmdlist

struct cmd_list_element* append_cmdlist
static

Definition at line 123 of file cli-dump.c.

Referenced by add_dump_command().

◆ binary_append_cmdlist

struct cmd_list_element* binary_append_cmdlist
static

Definition at line 129 of file cli-dump.c.

◆ binary_dump_cmdlist

struct cmd_list_element* binary_dump_cmdlist
static

Definition at line 128 of file cli-dump.c.

◆ dump_cmdlist

struct cmd_list_element* dump_cmdlist
static

Definition at line 122 of file cli-dump.c.

Referenced by add_dump_command().

◆ ihex_cmdlist

struct cmd_list_element* ihex_cmdlist
static

Definition at line 125 of file cli-dump.c.

◆ srec_cmdlist

struct cmd_list_element* srec_cmdlist
static

Definition at line 124 of file cli-dump.c.

◆ tekhex_cmdlist

struct cmd_list_element* tekhex_cmdlist
static

Definition at line 127 of file cli-dump.c.

◆ verilog_cmdlist

struct cmd_list_element* verilog_cmdlist
static

Definition at line 126 of file cli-dump.c.