GDB (xrefs)
Classes | Functions | Variables
/tmp/gdb-7.10/gdb/dwarf2expr.c File Reference
#include "defs.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "gdbcore.h"
#include "dwarf2.h"
#include "dwarf2expr.h"

Go to the source code of this file.

Classes

struct  dwarf_gdbarch_types
 

Functions

static void execute_stack_op (struct dwarf_expr_context *, const gdb_byte *, const gdb_byte *)
 
static void * dwarf_gdbarch_types_init (struct gdbarch *gdbarch)
 
static struct typedwarf_expr_address_type (struct dwarf_expr_context *ctx)
 
struct dwarf_expr_contextnew_dwarf_expr_context (void)
 
void free_dwarf_expr_context (struct dwarf_expr_context *ctx)
 
static void free_dwarf_expr_context_cleanup (void *arg)
 
struct cleanupmake_cleanup_free_dwarf_expr_context (struct dwarf_expr_context *ctx)
 
static void dwarf_expr_grow_stack (struct dwarf_expr_context *ctx, size_t need)
 
static void dwarf_expr_push (struct dwarf_expr_context *ctx, struct value *value, int in_stack_memory)
 
void dwarf_expr_push_address (struct dwarf_expr_context *ctx, CORE_ADDR value, int in_stack_memory)
 
static void dwarf_expr_pop (struct dwarf_expr_context *ctx)
 
struct valuedwarf_expr_fetch (struct dwarf_expr_context *ctx, int n)
 
static void dwarf_require_integral (struct type *type)
 
static struct typeget_unsigned_type (struct gdbarch *gdbarch, struct type *type)
 
static struct typeget_signed_type (struct gdbarch *gdbarch, struct type *type)
 
CORE_ADDR dwarf_expr_fetch_address (struct dwarf_expr_context *ctx, int n)
 
int dwarf_expr_fetch_in_stack_memory (struct dwarf_expr_context *ctx, int n)
 
static int dwarf_expr_stack_empty_p (struct dwarf_expr_context *ctx)
 
static void add_piece (struct dwarf_expr_context *ctx, ULONGEST size, ULONGEST offset)
 
void dwarf_expr_eval (struct dwarf_expr_context *ctx, const gdb_byte *addr, size_t len)
 
const gdb_bytesafe_read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end, uint64_t *r)
 
const gdb_bytesafe_read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, int64_t *r)
 
const gdb_bytesafe_skip_leb128 (const gdb_byte *buf, const gdb_byte *buf_end)
 
void dwarf_expr_require_composition (const gdb_byte *op_ptr, const gdb_byte *op_end, const char *op_name)
 
static int base_types_equal_p (struct type *t1, struct type *t2)
 
static struct typedwarf_get_base_type (struct dwarf_expr_context *ctx, cu_offset die, int size)
 
int dwarf_block_to_dwarf_reg (const gdb_byte *buf, const gdb_byte *buf_end)
 
int dwarf_block_to_dwarf_reg_deref (const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *deref_size_return)
 
int dwarf_block_to_fb_offset (const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *fb_offset_return)
 
int dwarf_block_to_sp_offset (struct gdbarch *gdbarch, const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *sp_offset_return)
 
void ctx_no_get_frame_base (void *baton, const gdb_byte **start, size_t *length)
 
CORE_ADDR ctx_no_get_frame_cfa (void *baton)
 
CORE_ADDR ctx_no_get_frame_pc (void *baton)
 
CORE_ADDR ctx_no_get_tls_address (void *baton, CORE_ADDR offset)
 
void ctx_no_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset)
 
struct typectx_no_get_base_type (struct dwarf_expr_context *ctx, cu_offset die)
 
void ctx_no_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, enum call_site_parameter_kind kind, union call_site_parameter_u kind_u, int deref_size)
 
CORE_ADDR ctx_no_get_addr_index (void *baton, unsigned int index)
 
void _initialize_dwarf2expr (void)
 

Variables

static struct gdbarch_datadwarf_arch_cookie
 
initialize_file_ftype _initialize_dwarf2expr
 

Function Documentation

void _initialize_dwarf2expr ( void  )

Definition at line 1581 of file dwarf2expr.c.

References dwarf_gdbarch_types_init(), and gdbarch_data_register_post_init().

static void add_piece ( struct dwarf_expr_context ctx,
ULONGEST  size,
ULONGEST  offset 
)
static
static int base_types_equal_p ( struct type t1,
struct type t2 
)
static

Definition at line 426 of file dwarf2expr.c.

References TYPE_CODE, TYPE_LENGTH, and TYPE_UNSIGNED.

Referenced by execute_stack_op().

void ctx_no_dwarf_call ( struct dwarf_expr_context ctx,
cu_offset  die_offset 
)

Definition at line 1543 of file dwarf2expr.c.

References _, and error().

CORE_ADDR ctx_no_get_addr_index ( void *  baton,
unsigned int  index 
)

Definition at line 1572 of file dwarf2expr.c.

References _, and error().

struct type* ctx_no_get_base_type ( struct dwarf_expr_context ctx,
cu_offset  die 
)

Definition at line 1551 of file dwarf2expr.c.

References _, and error().

void ctx_no_get_frame_base ( void *  baton,
const gdb_byte **  start,
size_t *  length 
)

Definition at line 1511 of file dwarf2expr.c.

References _, and error().

CORE_ADDR ctx_no_get_frame_cfa ( void *  baton)

Definition at line 1519 of file dwarf2expr.c.

References _, and error().

CORE_ADDR ctx_no_get_frame_pc ( void *  baton)

Definition at line 1527 of file dwarf2expr.c.

References _, and error().

CORE_ADDR ctx_no_get_tls_address ( void *  baton,
CORE_ADDR  offset 
)

Definition at line 1535 of file dwarf2expr.c.

References _, and error().

void ctx_no_push_dwarf_reg_entry_value ( struct dwarf_expr_context ctx,
enum call_site_parameter_kind  kind,
union call_site_parameter_u  kind_u,
int  deref_size 
)

Definition at line 1560 of file dwarf2expr.c.

References _, and internal_error().

int dwarf_block_to_dwarf_reg ( const gdb_byte buf,
const gdb_byte buf_end 
)
int dwarf_block_to_dwarf_reg_deref ( const gdb_byte buf,
const gdb_byte buf_end,
CORE_ADDR deref_size_return 
)

Definition at line 507 of file dwarf2expr.c.

References gdb_read_sleb128(), gdb_read_uleb128(), and offset.

Referenced by execute_stack_op().

int dwarf_block_to_fb_offset ( const gdb_byte buf,
const gdb_byte buf_end,
CORE_ADDR fb_offset_return 
)

Definition at line 566 of file dwarf2expr.c.

References gdb_read_sleb128().

Referenced by value_of_dwarf_block_entry().

int dwarf_block_to_sp_offset ( struct gdbarch gdbarch,
const gdb_byte buf,
const gdb_byte buf_end,
CORE_ADDR sp_offset_return 
)
static struct type* dwarf_expr_address_type ( struct dwarf_expr_context ctx)
static
void dwarf_expr_eval ( struct dwarf_expr_context ctx,
const gdb_byte addr,
size_t  len 
)
struct value* dwarf_expr_fetch ( struct dwarf_expr_context ctx,
int  n 
)
CORE_ADDR dwarf_expr_fetch_address ( struct dwarf_expr_context ctx,
int  n 
)
int dwarf_expr_fetch_in_stack_memory ( struct dwarf_expr_context ctx,
int  n 
)
static void dwarf_expr_grow_stack ( struct dwarf_expr_context ctx,
size_t  need 
)
static
static void dwarf_expr_pop ( struct dwarf_expr_context ctx)
static

Definition at line 178 of file dwarf2expr.c.

References _, error(), and dwarf_expr_context::stack_len.

Referenced by execute_stack_op().

static void dwarf_expr_push ( struct dwarf_expr_context ctx,
struct value value,
int  in_stack_memory 
)
static
void dwarf_expr_push_address ( struct dwarf_expr_context ctx,
CORE_ADDR  value,
int  in_stack_memory 
)
void dwarf_expr_require_composition ( const gdb_byte op_ptr,
const gdb_byte op_end,
const char *  op_name 
)

Definition at line 408 of file dwarf2expr.c.

References _, and error().

Referenced by do_compile_dwarf_expr_to_c(), dwarf2_compile_expr_to_ax(), and execute_stack_op().

static int dwarf_expr_stack_empty_p ( struct dwarf_expr_context ctx)
static

Definition at line 300 of file dwarf2expr.c.

References dwarf_expr_context::stack_len.

Referenced by add_piece().

static void* dwarf_gdbarch_types_init ( struct gdbarch gdbarch)
static

Definition at line 50 of file dwarf2expr.c.

References GDBARCH_OBSTACK_ZALLOC.

Referenced by _initialize_dwarf2expr().

static struct type* dwarf_get_base_type ( struct dwarf_expr_context ctx,
cu_offset  die,
int  size 
)
static
static void dwarf_require_integral ( struct type type)
static

Definition at line 200 of file dwarf2expr.c.

References _, error(), TYPE_CODE, TYPE_CODE_BOOL, TYPE_CODE_CHAR, and TYPE_CODE_INT.

Referenced by dwarf_expr_fetch_address(), and execute_stack_op().

static void execute_stack_op ( struct dwarf_expr_context ctx,
const gdb_byte op_ptr,
const gdb_byte op_end 
)
static

Definition at line 634 of file dwarf2expr.c.

References _, add_piece(), dwarf_expr_context::addr_size, base_types_equal_p(), dwarf_expr_context::baton, CALL_SITE_PARAMETER_DWARF_REG, CALL_SITE_PARAMETER_PARAM_OFFSET, cu_offset::cu_off, dwarf_expr_context::data, dwarf_block_to_dwarf_reg(), dwarf_block_to_dwarf_reg_deref(), dwarf_expr_context_funcs::dwarf_call, dwarf_expr_address_type(), dwarf_expr_eval(), dwarf_expr_fetch(), dwarf_expr_fetch_address(), dwarf_expr_fetch_in_stack_memory(), dwarf_expr_pop(), dwarf_expr_push(), dwarf_expr_require_composition(), dwarf_get_base_type(), call_site_parameter_u::dwarf_reg, dwarf_require_integral(), DWARF_VALUE_IMPLICIT_POINTER, DWARF_VALUE_LITERAL, DWARF_VALUE_MEMORY, DWARF_VALUE_OPTIMIZED_OUT, DWARF_VALUE_REGISTER, DWARF_VALUE_STACK, error(), extract_signed_integer(), extract_unsigned_integer(), dwarf_expr_context::funcs, gdb_assert, dwarf_expr_context::gdbarch, gdbarch_byte_order(), dwarf_expr_context_funcs::get_addr_index, dwarf_expr_context_funcs::get_frame_base, dwarf_expr_context_funcs::get_frame_cfa, dwarf_expr_context_funcs::get_object_address, dwarf_expr_context_funcs::get_reg_value, get_signed_type(), dwarf_expr_context_funcs::get_tls_address, get_unsigned_type(), dwarf_expr_context::initialized, internal_error(), dwarf_expr_context::len, len, dwarf_expr_context::location, dwarf_expr_context::max_recursion_depth, not_lval, offset, dwarf_expr_context::offset, call_site_parameter_u::param_offset, dwarf_expr_context_funcs::push_dwarf_reg_entry_value, QUIT, dwarf_expr_context_funcs::read_addr_from_reg, dwarf_expr_context_funcs::read_mem, dwarf_expr_context::recursion_depth, dwarf_expr_context::ref_addr_size, safe_read_sleb128(), safe_read_uleb128(), size, dwarf_expr_context::stack, dwarf_expr_context::stack_len, store_unsigned_integer(), stype, type, TYPE_LENGTH, TYPE_UNSIGNED, value_as_long(), value_binop(), value_cast(), value_complement(), value_contents_all(), value_equal(), value_from_contents(), value_from_contents_and_address(), value_from_ulongest(), value_less(), value_neg(), value_type(), and value_zero().

Referenced by dwarf_expr_eval().

void free_dwarf_expr_context ( struct dwarf_expr_context ctx)
static void free_dwarf_expr_context_cleanup ( void *  arg)
static

Definition at line 121 of file dwarf2expr.c.

References free_dwarf_expr_context().

Referenced by make_cleanup_free_dwarf_expr_context().

static struct type* get_signed_type ( struct gdbarch gdbarch,
struct type type 
)
static
static struct type* get_unsigned_type ( struct gdbarch gdbarch,
struct type type 
)
static
struct cleanup* make_cleanup_free_dwarf_expr_context ( struct dwarf_expr_context ctx)
struct dwarf_expr_context* new_dwarf_expr_context ( void  )
const gdb_byte* safe_read_sleb128 ( const gdb_byte buf,
const gdb_byte buf_end,
int64_t *  r 
)
const gdb_byte* safe_read_uleb128 ( const gdb_byte buf,
const gdb_byte buf_end,
uint64_t *  r 
)
const gdb_byte* safe_skip_leb128 ( const gdb_byte buf,
const gdb_byte buf_end 
)

Definition at line 395 of file dwarf2expr.c.

References _, error(), and gdb_skip_leb128().

Referenced by skip_one_die().

Variable Documentation

initialize_file_ftype _initialize_dwarf2expr
struct gdbarch_data* dwarf_arch_cookie
static

Definition at line 37 of file dwarf2expr.c.