Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

javadis Class Reference

#include <javadis.h>

Inheritance diagram for javadis:

Disassembler Object List of all members.

Public Member Functions

 javadis ()
 javadis (java_token_func token_func, void *context)
virtual ~javadis ()
virtual dis_insndecode (byte *code, int maxlen, CPU_ADDR addr)
virtual dis_insnduplicateInsn (dis_insn *disasm_insn)
virtual void getOpcodeMetrics (int &min_length, int &max_length, int &min_look_ahead, int &avg_look_ahead, int &addr_align)
virtual char * getName ()
virtual byte getSize (dis_insn *disasm_insn)
int load (ht_object_stream *f)
virtual OBJECT_ID object_id () const
virtual char * str (dis_insn *disasm_insn, int options)
virtual char * strf (dis_insn *disasm_insn, int options, char *format)
virtual void store (ht_object_stream *f)
virtual bool validInsn (dis_insn *disasm_insn)

Protected Member Functions

void decode_insn (javaopc_insn *insn)
void decode_op (int optype, bool wideopc, java_insn_op *op)
byte getbyte ()
word getword ()
dword getdword ()
void invalidate ()
void str_format (char **str, char **format, char *p, char *n, char *op[3], int oplen[3], char stopchar, int print)
virtual void str_op (char *opstr, int *opstrlen, javadis_insn *insn, java_insn_op *op)

Protected Attributes

javadis_insn insn
char insnstr [1024]
unsigned char * codep
unsigned char * ocodep
int addr
int maxlen
java_token_func token_func
void * context

Constructor & Destructor Documentation

javadis::javadis  ) 
 

Definition at line 33 of file javadis.cc.

javadis::javadis java_token_func  token_func,
void *  context
 

Definition at line 37 of file javadis.cc.

References context, java_token_func, and token_func.

javadis::~javadis  )  [virtual]
 

Definition at line 43 of file javadis.cc.


Member Function Documentation

dis_insn * javadis::decode byte *  code,
int  maxlen,
CPU_ADDR  addr
[virtual]
 

Implements Disassembler.

Definition at line 47 of file javadis.cc.

References addr, CPU_ADDR::addr32, codep, decode_insn(), dis_insn, getbyte(), java_insn_op::imm, insn, javadis_insn::invalid, java_insns, JAVA_OPTYPE_EMPTY, JAVA_OPTYPE_IMM, JAVA_WIDE_OPCODE, JAVAINSN_MAX_PARAM_COUNT, maxlen, javadis_insn::name, ocodep, javadis_insn::op, javadis_insn::opcode, java_insn_op::size, javadis_insn::size, java_insn_op::type, and javadis_insn::wideopcode.

void javadis::decode_insn javaopc_insn insn  )  [protected]
 

Definition at line 79 of file javadis.cc.

References decode_op(), insn, invalidate(), JAVAINSN_MAX_PARAM_COUNT, javadis_insn::name, javaopc_insn::name, javadis_insn::op, javaopc_insn::optype, and javadis_insn::wideopcode.

Referenced by decode().

void javadis::decode_op int  optype,
bool  wideopc,
java_insn_op op
[protected]
 

Definition at line 91 of file javadis.cc.

References addr, getbyte(), getdword(), getword(), java_insn_op::imm, JAVA_OPTYPE_CONST, JAVA_OPTYPE_EMPTY, JAVA_OPTYPE_IMM, JAVA_OPTYPE_LABEL, JOPC_SIZE, JOPC_SIZE_WIDE, JOPC_TYPE, JOPC_TYPE_BYTE, JOPC_TYPE_CHAR, JOPC_TYPE_CONST, JOPC_TYPE_INT, JOPC_TYPE_LABEL, JOPC_TYPE_LOCAL, JOPC_TYPE_SHORT, java_insn_op::label, java_insn_op::size, and java_insn_op::type.

Referenced by decode_insn().

dis_insn * javadis::duplicateInsn dis_insn disasm_insn  )  [virtual]
 

Implements Disassembler.

Definition at line 152 of file javadis.cc.

References dis_insn, insn, and malloc().

byte javadis::getbyte  )  [protected]
 

Definition at line 159 of file javadis.cc.

References addr, byte, codep, invalidate(), maxlen, and ocodep.

Referenced by decode(), and decode_op().

dword javadis::getdword  )  [protected]
 

Definition at line 184 of file javadis.cc.

References addr, codep, dword, invalidate(), maxlen, and ocodep.

Referenced by decode_op().

char * javadis::getName  )  [virtual]
 

Implements Disassembler.

Definition at line 207 of file javadis.cc.

void javadis::getOpcodeMetrics int &  min_length,
int &  max_length,
int &  min_look_ahead,
int &  avg_look_ahead,
int &  addr_align
[virtual]
 

Implements Disassembler.

Definition at line 198 of file javadis.cc.

byte javadis::getSize dis_insn disasm_insn  )  [virtual]
 

Implements Disassembler.

Definition at line 212 of file javadis.cc.

References byte, and dis_insn.

word javadis::getword  )  [protected]
 

Definition at line 170 of file javadis.cc.

References addr, codep, invalidate(), maxlen, ocodep, and word.

Referenced by decode_op().

void javadis::invalidate  )  [protected]
 

Definition at line 217 of file javadis.cc.

References insn, and javadis_insn::invalid.

Referenced by decode_insn(), getbyte(), getdword(), and getword().

int javadis::load ht_object_stream f  )  [virtual]
 

loads object from object stream.

Returns:
ht_stream errorcode

Reimplemented from Object.

Definition at line 222 of file javadis.cc.

References ht_layer_stream::get_error().

OBJECT_ID javadis::object_id  )  const [virtual]
 

Returns:
unique object id.

Reimplemented from Object.

Definition at line 227 of file javadis.cc.

References ATOM_DISASM_JAVA.

void javadis::store ht_object_stream f  )  [virtual]
 

stores object.

Reimplemented from Object.

Definition at line 431 of file javadis.cc.

char * javadis::str dis_insn disasm_insn,
int  options
[virtual]
 

Reimplemented from Disassembler.

Definition at line 403 of file javadis.cc.

References dis_insn, DISASM_STRF_DEFAULT_FORMAT, options, and strf().

void javadis::str_format char **  str,
char **  format,
char *  p,
char *  n,
char *  op[3],
int  oplen[3],
char  stopchar,
int  print
[protected]
 

Definition at line 311 of file javadis.cc.

References DISASM_STRF_COND, DISASM_STRF_FIRST, DISASM_STRF_NAME, DISASM_STRF_PREFIX, DISASM_STRF_SECOND, DISASM_STRF_THIRD, DISASM_STRF_VAR, e_cs_default, e_cs_symbol, Disassembler::get_cs(), insnstr, and NULL.

Referenced by strf().

void javadis::str_op char *  opstr,
int *  opstrlen,
javadis_insn insn,
java_insn_op op
[protected, virtual]
 

Definition at line 232 of file javadis.cc.

References CPU_ADDR::addr32, addr_sym_func, addr_sym_func_context, context, e_cs_comment, e_cs_default, e_cs_number, Disassembler::get_cs(), Disassembler::hexd(), java_insn_op::imm, JAVA_OPTYPE_CONST, JAVA_OPTYPE_IMM, JAVA_OPTYPE_LABEL, NULL, java_insn_op::size, token_func, and java_insn_op::type.

Referenced by strf().

char * javadis::strf dis_insn disasm_insn,
int  options,
char *  format
[virtual]
 

Implements Disassembler.

Definition at line 408 of file javadis.cc.

References dis_insn, DIS_STYLE_HIGHLIGHT, Disassembler::disable_highlighting(), Disassembler::enable_highlighting(), insn, insnstr, javadis_insn::name, javadis_insn::op, str_format(), and str_op().

Referenced by str().

bool javadis::validInsn dis_insn disasm_insn  )  [virtual]
 

Implements Disassembler.

Definition at line 435 of file javadis.cc.

References dis_insn.


Member Data Documentation

int javadis::addr [protected]
 

Definition at line 56 of file javadis.h.

Referenced by decode(), decode_op(), getbyte(), getdword(), and getword().

unsigned char* javadis::codep [protected]
 

Definition at line 55 of file javadis.h.

Referenced by decode(), getbyte(), getdword(), and getword().

void* javadis::context [protected]
 

Definition at line 59 of file javadis.h.

Referenced by javadis(), and str_op().

javadis_insn javadis::insn [protected]
 

Definition at line 52 of file javadis.h.

Referenced by decode(), decode_insn(), duplicateInsn(), invalidate(), and strf().

char javadis::insnstr[1024] [protected]
 

Definition at line 53 of file javadis.h.

Referenced by str_format(), and strf().

int javadis::maxlen [protected]
 

Definition at line 57 of file javadis.h.

Referenced by decode(), getbyte(), getdword(), and getword().

unsigned char * javadis::ocodep [protected]
 

Definition at line 55 of file javadis.h.

Referenced by decode(), getbyte(), getdword(), and getword().

java_token_func javadis::token_func [protected]
 

Definition at line 58 of file javadis.h.

Referenced by javadis(), and str_op().


The documentation for this class was generated from the following files:
Generated on Fri May 7 21:16:06 2004 by doxygen 1.3.5