GDBserver
Classes | Defines | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/gdbserver/ax.c File Reference
#include "server.h"
#include "ax.h"
#include "format.h"
#include "tracepoint.h"
#include "ax.def"

Go to the source code of this file.

Classes

struct  bytecode_address

Defines

#define ax_debug_1(level, fmt, args...)
#define ax_debug(FMT, args...)   ax_debug_1 (1, FMT, ##args)
#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE)   gdb_agent_op_ ## NAME = VALUE,
#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE)   , # NAME
#define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE)   , SIZE
#define UNHANDLED
#define STACK_MAX   100

Enumerations

enum  gdb_agent_op

Functions

static void ax_vdebug (const char *,...)
static const char * gdb_agent_op_name (int op)
struct agent_exprgdb_parse_agent_expr (char **actparm)
char * gdb_unparse_agent_expr (struct agent_expr *aexpr)
void emit_prologue (void)
void emit_epilogue (void)
static void emit_add (void)
static void emit_sub (void)
static void emit_mul (void)
static void emit_lsh (void)
static void emit_rsh_signed (void)
static void emit_rsh_unsigned (void)
static void emit_ext (int arg)
static void emit_log_not (void)
static void emit_bit_and (void)
static void emit_bit_or (void)
static void emit_bit_xor (void)
static void emit_bit_not (void)
static void emit_equal (void)
static void emit_less_signed (void)
static void emit_less_unsigned (void)
static void emit_ref (int size)
static void emit_if_goto (int *offset_p, int *size_p)
static void emit_goto (int *offset_p, int *size_p)
static void write_goto_address (CORE_ADDR from, CORE_ADDR to, int size)
static void emit_const (LONGEST num)
static void emit_reg (int reg)
static void emit_pop (void)
static void emit_stack_flush (void)
static void emit_zero_ext (int arg)
static void emit_swap (void)
static void emit_stack_adjust (int n)
static void emit_int_call_1 (CORE_ADDR fn, int arg1)
static void emit_void_call_2 (CORE_ADDR fn, int arg1)
static void emit_eq_goto (int *offset_p, int *size_p)
static void emit_ne_goto (int *offset_p, int *size_p)
static void emit_lt_goto (int *offset_p, int *size_p)
static void emit_ge_goto (int *offset_p, int *size_p)
static void emit_gt_goto (int *offset_p, int *size_p)
static void emit_le_goto (int *offset_p, int *size_p)
int is_goto_target (struct agent_expr *aexpr, int pc)
enum eval_result_type compile_bytecodes (struct agent_expr *aexpr)
static void ax_printf (CORE_ADDR fn, CORE_ADDR chan, const char *format, int nargs, ULONGEST *args)
enum eval_result_type gdb_eval_agent_expr (struct eval_agent_expr_context *ctx, struct agent_expr *aexpr, ULONGEST *rslt)

Variables

static const char * gdb_agent_op_names [gdb_agent_op_last]
static const unsigned char gdb_agent_op_sizes [gdb_agent_op_last]
CORE_ADDR current_insn_ptr
int emit_error
struct bytecode_addressbytecode_address_table

Define Documentation

#define ax_debug (   FMT,
  args... 
)    ax_debug_1 (1, FMT, ##args)

Definition at line 48 of file ax.c.

Referenced by ax_printf(), compile_bytecodes(), and gdb_eval_agent_expr().

#define ax_debug_1 (   level,
  fmt,
  args... 
)
Value:
do {                                            \
    if (level <= debug_threads)                 \
      ax_vdebug ((fmt), ##args);                \
  } while (0)

Definition at line 42 of file ax.c.

#define DEFOP (   NAME,
  SIZE,
  DATA_SIZE,
  CONSUMED,
  PRODUCED,
  VALUE 
)    gdb_agent_op_ ## NAME = VALUE,

Definition at line 56 of file ax.c.

#define DEFOP (   NAME,
  SIZE,
  DATA_SIZE,
  CONSUMED,
  PRODUCED,
  VALUE 
)    , # NAME

Definition at line 56 of file ax.c.

#define DEFOP (   NAME,
  SIZE,
  DATA_SIZE,
  CONSUMED,
  PRODUCED,
  VALUE 
)    , SIZE

Definition at line 56 of file ax.c.

#define STACK_MAX   100

Referenced by gdb_eval_agent_expr().

#define UNHANDLED
Value:
do                                                      \
    {                                                   \
      ax_debug ("Cannot compile op 0x%x\n", op);        \
      return expr_eval_unhandled_opcode;                \
    } while (0)

Referenced by compile_bytecodes().


Enumeration Type Documentation

Definition at line 54 of file ax.c.


Function Documentation

static void ax_printf ( CORE_ADDR  fn,
CORE_ADDR  chan,
const char *  format,
int  nargs,
ULONGEST args 
) [static]
static void ax_vdebug ( const char *  ,
  ... 
) [static]

Definition at line 24 of file ax.c.

References PROG.

enum eval_result_type compile_bytecodes ( struct agent_expr aexpr)
static void emit_add ( void  ) [static]

Definition at line 155 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_bit_and ( void  ) [static]

Definition at line 203 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_bit_not ( void  ) [static]

Definition at line 221 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_bit_or ( void  ) [static]

Definition at line 209 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_bit_xor ( void  ) [static]

Definition at line 215 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_const ( LONGEST  num) [static]

Definition at line 269 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

void emit_epilogue ( void  )

Definition at line 149 of file ax.c.

References target_emit_ops.

Referenced by compile_tracepoint_condition().

static void emit_eq_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 327 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_equal ( void  ) [static]

Definition at line 227 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_ext ( int  arg) [static]

Definition at line 191 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_ge_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 345 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 257 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_gt_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 351 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_if_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 251 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_int_call_1 ( CORE_ADDR  fn,
int  arg1 
) [static]

Definition at line 313 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_le_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 357 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_less_signed ( void  ) [static]

Definition at line 233 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_less_unsigned ( void  ) [static]

Definition at line 239 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_log_not ( void  ) [static]

Definition at line 197 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_lsh ( void  ) [static]

Definition at line 173 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_lt_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 339 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_mul ( void  ) [static]

Definition at line 167 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_ne_goto ( int *  offset_p,
int *  size_p 
) [static]

Definition at line 333 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_pop ( void  ) [static]

Definition at line 281 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

void emit_prologue ( void  )

Definition at line 143 of file ax.c.

References target_emit_ops.

Referenced by compile_tracepoint_condition().

static void emit_ref ( int  size) [static]

Definition at line 245 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_reg ( int  reg) [static]

Definition at line 275 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_rsh_signed ( void  ) [static]

Definition at line 179 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_rsh_unsigned ( void  ) [static]

Definition at line 185 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_stack_adjust ( int  n) [static]

Definition at line 305 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_stack_flush ( void  ) [static]

Definition at line 287 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_sub ( void  ) [static]

Definition at line 161 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_swap ( void  ) [static]

Definition at line 299 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_void_call_2 ( CORE_ADDR  fn,
int  arg1 
) [static]

Definition at line 321 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static void emit_zero_ext ( int  arg) [static]

Definition at line 293 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().

static const char* gdb_agent_op_name ( int  op) [static]

Definition at line 82 of file ax.c.

Referenced by compile_bytecodes(), and gdb_eval_agent_expr().

enum eval_result_type gdb_eval_agent_expr ( struct eval_agent_expr_context ctx,
struct agent_expr aexpr,
ULONGEST rslt 
)
struct agent_expr* gdb_parse_agent_expr ( char **  actparm) [read]
char* gdb_unparse_agent_expr ( struct agent_expr aexpr)

Definition at line 117 of file ax.c.

References agent_expr::bytes, convert_int_to_ascii(), agent_expr::length, and xmalloc().

Referenced by response_tracepoint().

int is_goto_target ( struct agent_expr aexpr,
int  pc 
)

Definition at line 366 of file ax.c.

References agent_expr::bytes, and agent_expr::length.

Referenced by compile_bytecodes().

static void write_goto_address ( CORE_ADDR  from,
CORE_ADDR  to,
int  size 
) [static]

Definition at line 263 of file ax.c.

References target_emit_ops.

Referenced by compile_bytecodes().


Variable Documentation

Referenced by compile_bytecodes().

const char* gdb_agent_op_names[gdb_agent_op_last] [static]

Definition at line 63 of file ax.c.

const unsigned char gdb_agent_op_sizes[gdb_agent_op_last] [static]

Definition at line 71 of file ax.c.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines