GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
expr.c File Reference
#include "defs.h"
#include "block.h"
#include "symtab.h"
#include "gdbtypes.h"
#include "value.h"
#include "gdbcore.h"
#include "dwarf2.h"
#include "dwarf2/expr.h"
#include "dwarf2/loc.h"
#include "dwarf2/read.h"
#include "frame.h"
#include "gdbsupport/underlying.h"
#include "gdbarch.h"
#include "objfiles.h"

Go to the source code of this file.

Classes

struct  dwarf_gdbarch_types
 
struct  piece_closure
 

Functions

static void ensure_have_frame (frame_info_ptr frame, const char *op_name)
 
static void ensure_have_per_cu (dwarf2_per_cu_data *per_cu, const char *op_name)
 
static size_t bits_to_bytes (ULONGEST start, ULONGEST n_bits)
 
CORE_ADDR read_addr_from_reg (frame_info_ptr frame, int reg)
 
static piece_closureallocate_piece_closure (dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, std::vector< dwarf_expr_piece > &&pieces, frame_info_ptr frame)
 
static bool rw_pieced_value (value *v, value *from, bool check_optimized)
 
static void read_pieced_value (value *v)
 
static void write_pieced_value (value *to, value *from)
 
static bool is_optimized_out_pieced_value (value *v)
 
static bool check_pieced_synthetic_pointer (const value *value, LONGEST bit_offset, int bit_length)
 
static valueindirect_pieced_value (value *value)
 
static valuecoerce_pieced_ref (const value *value)
 
static void * copy_pieced_value_closure (const value *v)
 
static void free_pieced_value_closure (value *v)
 
static valuesect_variable_value (sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
 
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)
 
const gdb_byte * safe_read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end, uint64_t *r)
 
const gdb_byte * safe_read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, int64_t *r)
 
const gdb_byte * safe_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)
 
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)
 

Variables

static const registry< gdbarch >::key< dwarf_gdbarch_typesdwarf_arch_cookie
 
static const struct lval_funcs pieced_value_funcs
 

Function Documentation

◆ allocate_piece_closure()

static piece_closure * allocate_piece_closure ( dwarf2_per_cu_data * per_cu,
dwarf2_per_objfile * per_objfile,
std::vector< dwarf_expr_piece > && pieces,
frame_info_ptr frame )
static

◆ base_types_equal_p()

static int base_types_equal_p ( struct type * t1,
struct type * t2 )
static

Definition at line 1311 of file expr.c.

References type::code(), type::is_unsigned(), and type::length().

Referenced by dwarf_expr_context::execute_stack_op().

◆ bits_to_bytes()

static size_t bits_to_bytes ( ULONGEST start,
ULONGEST n_bits )
static

Definition at line 73 of file expr.c.

Referenced by rw_pieced_value().

◆ check_pieced_synthetic_pointer()

static bool check_pieced_synthetic_pointer ( const value * value,
LONGEST bit_offset,
int bit_length )
static

◆ coerce_pieced_ref()

static value * coerce_pieced_ref ( const value * value)
static

◆ copy_pieced_value_closure()

static void * copy_pieced_value_closure ( const value * v)
static

Definition at line 612 of file expr.c.

References value::computed_closure(), and piece_closure::refc.

◆ dwarf_block_to_dwarf_reg()

int dwarf_block_to_dwarf_reg ( const gdb_byte * buf,
const gdb_byte * buf_end )

◆ dwarf_block_to_dwarf_reg_deref()

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

Definition at line 1367 of file expr.c.

References gdb_read_sleb128(), and gdb_read_uleb128().

Referenced by dwarf_expr_context::execute_stack_op().

◆ dwarf_block_to_fb_offset()

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

Definition at line 1426 of file expr.c.

References gdb_read_sleb128().

Referenced by value_of_dwarf_block_entry().

◆ dwarf_block_to_sp_offset()

int dwarf_block_to_sp_offset ( struct gdbarch * gdbarch,
const gdb_byte * buf,
const gdb_byte * buf_end,
CORE_ADDR * sp_offset_return )

◆ dwarf_expr_require_composition()

void dwarf_expr_require_composition ( const gdb_byte * op_ptr,
const gdb_byte * op_end,
const char * op_name )

◆ dwarf_require_integral()

static void dwarf_require_integral ( struct type * type)
static

Definition at line 1095 of file expr.c.

References type::code().

Referenced by dwarf_expr_context::execute_stack_op(), and dwarf_expr_context::fetch_address().

◆ ensure_have_frame()

static void ensure_have_frame ( frame_info_ptr frame,
const char * op_name )
static

◆ ensure_have_per_cu()

static void ensure_have_per_cu ( dwarf2_per_cu_data * per_cu,
const char * op_name )
static

◆ free_pieced_value_closure()

static void free_pieced_value_closure ( value * v)
static

◆ get_signed_type()

static struct type * get_signed_type ( struct gdbarch * gdbarch,
struct type * type )
static

◆ get_unsigned_type()

static struct type * get_unsigned_type ( struct gdbarch * gdbarch,
struct type * type )
static

◆ indirect_pieced_value()

static value * indirect_pieced_value ( value * value)
static

◆ is_optimized_out_pieced_value()

static bool is_optimized_out_pieced_value ( value * v)
static

Definition at line 461 of file expr.c.

References rw_pieced_value().

◆ read_addr_from_reg()

CORE_ADDR read_addr_from_reg ( frame_info_ptr frame,
int reg )

◆ read_pieced_value()

static void read_pieced_value ( value * v)
static

Definition at line 449 of file expr.c.

References rw_pieced_value().

◆ rw_pieced_value()

static bool rw_pieced_value ( value * v,
value * from,
bool check_optimized )
static

◆ safe_read_sleb128()

const gdb_byte * safe_read_sleb128 ( const gdb_byte * buf,
const gdb_byte * buf_end,
int64_t * r )

◆ safe_read_uleb128()

const gdb_byte * safe_read_uleb128 ( const gdb_byte * buf,
const gdb_byte * buf_end,
uint64_t * r )

◆ safe_skip_leb128()

const gdb_byte * safe_skip_leb128 ( const gdb_byte * buf,
const gdb_byte * buf_end )

Definition at line 1281 of file expr.c.

References gdb_skip_leb128().

Referenced by dwarf2_get_symbol_read_needs(), and skip_one_die().

◆ sect_variable_value()

static value * sect_variable_value ( sect_offset sect_off,
dwarf2_per_cu_data * per_cu,
dwarf2_per_objfile * per_objfile )
static

◆ write_pieced_value()

static void write_pieced_value ( value * to,
value * from )
static

Definition at line 455 of file expr.c.

References rw_pieced_value().

Variable Documentation

◆ dwarf_arch_cookie

const registry<gdbarch>::key<dwarf_gdbarch_types> dwarf_arch_cookie
static

Definition at line 47 of file expr.c.

Referenced by dwarf_expr_context::address_type().

◆ pieced_value_funcs

const struct lval_funcs pieced_value_funcs
static
Initial value:
= {
}
static value * indirect_pieced_value(value *value)
Definition expr.c:510
static void read_pieced_value(value *v)
Definition expr.c:449
static void write_pieced_value(value *to, value *from)
Definition expr.c:455
static void * copy_pieced_value_closure(const value *v)
Definition expr.c:612
static void free_pieced_value_closure(value *v)
Definition expr.c:621
static value * coerce_pieced_ref(const value *value)
Definition expr.c:582
static bool is_optimized_out_pieced_value(value *v)
Definition expr.c:461
static bool check_pieced_synthetic_pointer(const value *value, LONGEST bit_offset, int bit_length)
Definition expr.c:470

Definition at line 637 of file expr.c.

Referenced by dwarf_expr_context::fetch_result().