GDBserver
|
#include "server.h"
#include "ax.h"
#include "format.h"
#include "tracepoint.h"
#include "rsp-low.h"
#include "ax.def"
Go to the source code of this file.
Classes | |
struct | bytecode_address |
Macros | |
#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 { gdb_agent_op_last } |
Functions | |
static void | ax_vdebug (const char *,...) |
static const char * | gdb_agent_op_name (int op) |
struct agent_expr * | gdb_parse_agent_expr (char **actparm) |
void | gdb_free_agent_expr (struct agent_expr *aexpr) |
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_address * | bytecode_address_table |
#define ax_debug | ( | FMT, | |
args... | |||
) | ax_debug_1 (1, FMT, ##args) |
Definition at line 49 of file ax.c.
Referenced by ax_printf(), compile_bytecodes(), and gdb_eval_agent_expr().
#define ax_debug_1 | ( | level, | |
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 STACK_MAX 100 |
Referenced by gdb_eval_agent_expr().
#define UNHANDLED |
Referenced by compile_bytecodes().
enum gdb_agent_op |
|
static |
Definition at line 813 of file ax.c.
References _, alloca(), ax_debug, error(), free_format_pieces(), int_arg, literal_piece, long_arg, long_long_arg, parse_format_string(), read_inferior_memory(), format_piece::string, and string_arg.
Referenced by gdb_eval_agent_expr().
|
static |
enum eval_result_type compile_bytecodes | ( | struct agent_expr * | aexpr | ) |
Definition at line 400 of file ax.c.
References bytecode_address::address, ax_debug, bytecode_address_table, agent_expr::bytes, current_insn_ptr, emit_add(), emit_bit_and(), emit_bit_not(), emit_bit_or(), emit_bit_xor(), emit_const(), emit_eq_goto(), emit_equal(), emit_ext(), emit_ge_goto(), emit_goto(), emit_gt_goto(), emit_if_goto(), emit_int_call_1(), emit_le_goto(), emit_less_signed(), emit_less_unsigned(), emit_log_not(), emit_lsh(), emit_lt_goto(), emit_mul(), emit_ne_goto(), emit_pop(), emit_ref(), emit_reg(), emit_rsh_signed(), emit_rsh_unsigned(), emit_stack_adjust(), emit_stack_flush(), emit_sub(), emit_swap(), emit_void_call_2(), emit_zero_ext(), expr_eval_empty_expression, expr_eval_invalid_goto, expr_eval_no_error, expr_eval_unhandled_opcode, expr_eval_unrecognized_opcode, bytecode_address::from_offset, bytecode_address::from_size, gdb_agent_op_name(), get_get_tsv_func_addr(), get_set_tsv_func_addr(), bytecode_address::goto_pc, is_goto_target(), agent_expr::length, bytecode_address::next, paddress(), bytecode_address::pc, target_emit_ops, UNHANDLED, write_goto_address(), and xmalloc().
Referenced by compile_tracepoint_condition().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void emit_epilogue | ( | void | ) |
Definition at line 160 of file ax.c.
References target_emit_ops.
Referenced by compile_tracepoint_condition().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void emit_prologue | ( | void | ) |
Definition at line 154 of file ax.c.
References target_emit_ops.
Referenced by compile_tracepoint_condition().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 83 of file ax.c.
References gdb_agent_op_last.
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 | ||
) |
Definition at line 928 of file ax.c.
References _, agent_get_trace_state_variable_value(), agent_mem_read(), agent_mem_read_string(), agent_set_trace_state_variable_value(), agent_tsv_read(), ax_debug, ax_printf(), agent_expr::bytes, collect_register(), error(), expr_eval_divide_by_zero, expr_eval_empty_expression, expr_eval_empty_stack, expr_eval_no_error, expr_eval_stack_overflow, expr_eval_stack_underflow, expr_eval_unrecognized_opcode, gdb_agent_op_name(), internal_error(), agent_expr::length, phex_nz(), pulongest(), eval_agent_expr_context::regcache, register_size(), STACK_MAX, and regcache::tdesc.
Referenced by condition_true_at_tracepoint(), do_action_at_tracepoint(), gdb_condition_true_at_breakpoint_z_type(), and run_breakpoint_commands_z_type().
void gdb_free_agent_expr | ( | struct agent_expr * | aexpr | ) |
Definition at line 114 of file ax.c.
References agent_expr::bytes.
Referenced by clear_breakpoint_commands(), and clear_breakpoint_conditions().
struct agent_expr* gdb_parse_agent_expr | ( | char ** | actparm | ) |
Definition at line 96 of file ax.c.
References agent_expr::bytes, hex2bin(), agent_expr::length, unpack_varlen_hex(), and xmalloc().
Referenced by add_breakpoint_commands(), add_breakpoint_condition(), add_tracepoint_action(), and cmd_qtdp().
char* gdb_unparse_agent_expr | ( | struct agent_expr * | aexpr | ) |
Definition at line 128 of file ax.c.
References bin2hex(), agent_expr::bytes, agent_expr::length, and xmalloc().
Referenced by response_tracepoint().
int is_goto_target | ( | struct agent_expr * | aexpr, |
int | pc | ||
) |
Definition at line 377 of file ax.c.
References agent_expr::bytes, and agent_expr::length.
Referenced by compile_bytecodes().
struct bytecode_address * bytecode_address_table |
Referenced by compile_bytecodes().
CORE_ADDR current_insn_ptr |
Definition at line 139 of file ax.c.
Referenced by add_insns(), compile_bytecodes(), compile_tracepoint_condition(), i386_emit_call(), i386_emit_const(), i386_emit_int_call_1(), i386_emit_reg(), i386_emit_stack_adjust(), and i386_emit_void_call_2().
int emit_error |
Definition at line 141 of file ax.c.
Referenced by i386_emit_ext(), i386_emit_lsh(), i386_emit_mul(), i386_emit_rsh_signed(), i386_emit_rsh_unsigned(), i386_emit_zero_ext(), and i386_write_goto_address().
|
static |
|
static |