GDB (xrefs)
Classes | Functions | Variables
scm-disasm.c File Reference
#include "defs.h"
#include "arch-utils.h"
#include "disasm.h"
#include "dis-asm.h"
#include "gdbarch.h"
#include "gdbcore.h"
#include "guile-internal.h"

Go to the source code of this file.

Classes

struct  gdbscm_disasm_data
 
struct  gdbscm_disasm_read_data
 

Functions

static SCM dascm_make_insn (CORE_ADDR pc, const char *assembly, int insn_len)
 
static void * gdbscm_disasm_read_memory_worker (void *datap)
 
static int gdbscm_disasm_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *dinfo)
 
static void gdbscm_disasm_memory_error (int status, bfd_vma memaddr, struct disassemble_info *info)
 
static void gdbscm_disasm_print_address (bfd_vma addr, struct disassemble_info *info)
 
static int gdbscm_print_insn_from_port (struct gdbarch *gdbarch, SCM port, ULONGEST offset, CORE_ADDR memaddr, struct ui_file *stream, int *branch_delay_insns)
 
static SCM gdbscm_arch_disassemble (SCM self, SCM start_scm, SCM rest)
 
void gdbscm_initialize_disasm (void)
 

Variables

static SCM port_keyword
 
static SCM offset_keyword
 
static SCM size_keyword
 
static SCM count_keyword
 
static SCM address_symbol
 
static SCM asm_symbol
 
static SCM length_symbol
 
static const scheme_function disasm_functions []
 

Function Documentation

static SCM dascm_make_insn ( CORE_ADDR  pc,
const char *  assembly,
int  insn_len 
)
static
static SCM gdbscm_arch_disassemble ( SCM  self,
SCM  start_scm,
SCM  rest 
)
static
static void gdbscm_disasm_memory_error ( int  status,
bfd_vma  memaddr,
struct disassemble_info *  info 
)
static

Definition at line 131 of file scm-disasm.c.

References memory_error().

Referenced by gdbscm_print_insn_from_port().

static void gdbscm_disasm_print_address ( bfd_vma  addr,
struct disassemble_info *  info 
)
static

Definition at line 142 of file scm-disasm.c.

References gdbscm_disasm_data::gdbarch, and print_address().

Referenced by gdbscm_print_insn_from_port().

static int gdbscm_disasm_read_memory ( bfd_vma  memaddr,
bfd_byte *  myaddr,
unsigned int  length,
struct disassemble_info *  dinfo 
)
static
static void* gdbscm_disasm_read_memory_worker ( void *  datap)
static
void gdbscm_initialize_disasm ( void  )
static int gdbscm_print_insn_from_port ( struct gdbarch gdbarch,
SCM  port,
ULONGEST  offset,
CORE_ADDR  memaddr,
struct ui_file stream,
int branch_delay_insns 
)
static

Variable Documentation

SCM address_symbol
static

Definition at line 36 of file scm-disasm.c.

Referenced by dascm_make_insn(), and gdbscm_initialize_disasm().

SCM asm_symbol
static

Definition at line 37 of file scm-disasm.c.

Referenced by dascm_make_insn(), and gdbscm_initialize_disasm().

SCM count_keyword
static

Definition at line 34 of file scm-disasm.c.

Referenced by gdbscm_arch_disassemble(), and gdbscm_initialize_disasm().

const scheme_function disasm_functions[]
static
Initial value:
=
{
{ "arch-disassemble", 2, 0, 1, gdbscm_arch_disassemble,
"\
Return list of disassembled instructions in memory.\n\
\n\
Arguments: <gdb:arch> start-address\n\
[#:port port] [#:offset address]\n\
[#:size <integer>] [#:count <integer>]\n\
port: If non-#f, it is an input port to read bytes from.\n\
offset: Specifies the address offset of the first byte in the port.\n\
This is useful if the input is from something other than memory\n\
(e.g., a bytevector) and you want the result to be as if the bytes\n\
came from that address. The value to pass for start-address is\n\
then also the desired disassembly address, not the offset in, e.g.,\n\
the bytevector.\n\
size: Limit the number of bytes read to this amount.\n\
count: Limit the number of instructions to this amount.\n\
\n\
Returns:\n\
Each instruction in the result is an alist:\n\
(('address . address) ('asm . disassembly) ('length . length))." },
}
static SCM gdbscm_arch_disassemble(SCM self, SCM start_scm, SCM rest)
Definition: scm-disasm.c:209
#define END_FUNCTIONS

Definition at line 319 of file scm-disasm.c.

SCM length_symbol
static

Definition at line 38 of file scm-disasm.c.

Referenced by dascm_make_insn(), and gdbscm_initialize_disasm().

SCM offset_keyword
static

Definition at line 32 of file scm-disasm.c.

Referenced by gdbscm_arch_disassemble(), and gdbscm_initialize_disasm().

SCM port_keyword
static

Definition at line 31 of file scm-disasm.c.

Referenced by gdbscm_arch_disassemble(), and gdbscm_initialize_disasm().

SCM size_keyword
static

Definition at line 33 of file scm-disasm.c.

Referenced by gdbscm_arch_disassemble(), and gdbscm_initialize_disasm().