Types

Datatypes used by opdis. More...

Data Structures

struct  opdis_insn_buffer_t
 A buffer that stores the output of libopcodes before processing. More...
struct  opdis_buffer_t
 A buffer containing bytes to disassemble. More...

Defines

#define OPDIS_INVALID_OFFSET   ((opdis_off_t) -1 )
#define OPDIS_INVALID_ADDR   ((opdis_vma_t) -1 )

Typedefs

typedef opdis_insn_buffer_topdis_insn_buf_t
typedef bfd_byte opdis_byte_t
 A byte.
typedef bfd_vma opdis_vma_t
typedef opdis_buffer_topdis_buf_t
 Pointer to an opdis buffer.

Functions

opdis_buf_t LIBCALL opdis_buf_alloc (opdis_off_t size, opdis_vma_t addr)
 Allocate an opdis buffer.
void LIBCALL opdis_buf_set_vma (opdis_buf_t buf, opdis_vma_t addr)
 Set the VMA for a buffer.
opdis_buf_t LIBCALL opdis_buf_read (FILE *f, opdis_off_t size, opdis_vma_t addr)
 Allocate an opdis buffer containing contents of file.
int LIBCALL opdis_buf_fill (opdis_buf_t buf, opdis_off_t offset, void *src, opdis_off_t len)
 Fill an opdis buffer from a memory location.
void LIBCALL opdis_buf_free (opdis_buf_t buf)
 Free an opdis buffer.

Detailed Description

Datatypes used by opdis.


Define Documentation

#define OPDIS_INVALID_ADDR   ((opdis_vma_t) -1 )

An invalid address.

See also:
opdis_vma_t
#define OPDIS_INVALID_OFFSET   ((opdis_off_t) -1 )

An invalid buffer offset.

See also:
opdis_off_t

Typedef Documentation

bfd_vma opdis_vma_t

A virtual memory (load) address.


Function Documentation

opdis_buf_t opdis_buf_alloc ( opdis_off_t  size,
opdis_vma_t  addr 
)

Allocate an opdis buffer.

Allocates an opdis_buffer_t of specified size. The buffer contents are initialized to zero.

Parameters:
size Size of buffer in bytes.
addr Load address (vma) of buffer or 0.
Returns:
The allocated opdis buffer.
See also:
opdis_buf_read opdis_buf_free
int opdis_buf_fill ( opdis_buf_t  buf,
opdis_off_t  offset,
void *  src,
opdis_off_t  len 
)

Fill an opdis buffer from a memory location.

Parameters:
buf Opdis buffer to fill.
offset Offset in buf to copy to.
src Memory location to copy from.
len Number of bytes to copy from src to buf.
Returns:
Number of bytes copied from src to buf.
void opdis_buf_free ( opdis_buf_t  buf  ) 

Free an opdis buffer.

Parameters:
buf Opdis buffer to free.
See also:
opdis_buf_alloc
opdis_buf_t opdis_buf_read ( FILE *  f,
opdis_off_t  size,
opdis_vma_t  addr 
)

Allocate an opdis buffer containing contents of file.

Allocates an opdis buffer and fills it with the contents of the file. This reads size bytes from the current position in f, or from the current position to the end of the file if size is 0.

Parameters:
f The file to read from.
size The number of bytes to read from the file, or 0.
addr Load address (vma) of buffer or 0.
Returns:
The allocated opdis buffer.
See also:
opdis_buf_alloc opdis_buf_free
Note:
The current position of the file will be increased by size bytes upon return.
void opdis_buf_set_vma ( opdis_buf_t  buf,
opdis_vma_t  addr 
)

Set the VMA for a buffer.

Parameters:
buf The opdis buffer.
addr Load address (vma) of buffer or 0.

Generated on Wed Mar 10 14:30:46 2010 for Opdis Disassembly Library by  doxygen 1.6.1