33#include "gdbsupport/underlying.h"
55 throw_error (GENERIC_ERROR,
56 _(
"%s evaluation requires a frame."), op_name);
64 if (per_cu ==
nullptr)
65 throw_error (GENERIC_ERROR,
66 _(
"%s evaluation requires a compilation unit."), op_name);
75 return (start % HOST_CHAR_BIT + n_bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT;
114 std::vector<dwarf_expr_piece> &&pieces,
123 c->
pieces = std::move (pieces);
124 if (frame ==
nullptr)
131 piece.v.value->incref ();
148 LONGEST offset = 0, max_offset;
149 gdb_byte *v_contents;
150 const gdb_byte *from_contents;
153 gdb::byte_vector buffer;
156 gdb_assert (!check_optimized || from ==
nullptr);
159 from_contents = from->
contents ().data ();
160 v_contents =
nullptr;
165 v_contents =
nullptr;
168 from_contents =
nullptr;
171 ULONGEST bits_to_skip = 8 * v->
offset ();
182 offset = max_offset - v->
bitsize ();
191 for (i = 0; i < c->
pieces.size () && bits_to_skip >= c->
pieces[i].size; i++)
192 bits_to_skip -= c->
pieces[i].size;
194 for (; i < c->
pieces.size () && offset < max_offset; i++)
197 size_t this_size_bits, this_size;
199 this_size_bits = p->
size - bits_to_skip;
200 if (this_size_bits > max_offset - offset)
201 this_size_bits = max_offset - offset;
217 bits_to_skip += reg_bits - (p->
offset + p->
size);
220 bits_to_skip += p->
offset;
223 buffer.resize (this_size);
230 buffer, &optim, &unavail))
239 if (unavail && !check_optimized)
245 if (!check_optimized)
247 buffer.data (), bits_to_skip % 8,
248 this_size_bits, bits_big_endian);
253 if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0)
259 buffer, &optim, &unavail);
261 throw_error (OPTIMIZED_OUT_ERROR,
262 _(
"Can't do read-modify-write to "
263 "update bitfield; containing word "
264 "has been optimized out"));
266 throw_error (NOT_AVAILABLE_ERROR,
267 _(
"Can't do read-modify-write to "
268 "update bitfield; containing word "
273 from_contents, offset,
274 this_size_bits, bits_big_endian);
287 bits_to_skip += p->
offset;
289 CORE_ADDR start_addr = p->
v.
mem.
addr + bits_to_skip / 8;
291 if (bits_to_skip % 8 == 0 && this_size_bits % 8 == 0
304 v_contents + offset / 8,
310 buffer.resize (this_size);
318 buffer.data (), this_size);
320 buffer.data (), bits_to_skip % 8,
321 this_size_bits, bits_big_endian);
326 if (bits_to_skip % 8 != 0 || this_size_bits % 8 != 0)
340 &buffer[this_size - 1], 1);
345 from_contents, offset,
346 this_size_bits, bits_big_endian);
366 ULONGEST stack_value_size_bits
370 if (p->
offset + p->
size > stack_value_size_bits)
375 bits_to_skip += stack_value_size_bits - p->
offset - p->
size;
377 bits_to_skip += p->
offset;
382 this_size_bits, bits_big_endian);
398 size_t n = this_size_bits;
401 bits_to_skip += p->
offset;
402 if (bits_to_skip >= literal_size_bits)
404 if (n > literal_size_bits - bits_to_skip)
405 n = literal_size_bits - bits_to_skip;
431 internal_error (_(
"invalid location type"));
434 offset += this_size_bits;
438 if (offset < max_offset)
480 for (i = 0; i < c->
pieces.size () && bit_length > 0; i++)
483 size_t this_size_bits = p->
size;
487 if (bit_offset >= this_size_bits)
489 bit_offset -= this_size_bits;
493 bit_length -= this_size_bits - bit_offset;
497 bit_length -= this_size_bits;
503 return bit_length == 0;
526 for (i = 0; i < c->
pieces.size () && bit_length > 0; i++)
529 size_t this_size_bits = p->
size;
543 bit_length -= this_size_bits;
549 error (_(
"Invalid use of DW_OP_implicit_pointer"));
555 gdb_assert (piece != NULL && c->
per_cu !=
nullptr);
596 gdb_assert (closure != NULL);
597 gdb_assert (closure->
pieces.size () == 1);
600 (closure->
pieces[0].v.ptr.die_sect_off,
601 closure->
pieces[0].v.ptr.offset,
630 p.v.value->decref ();
657 const char *var_name =
nullptr;
663 error (_(
"Bad DW_OP_GNU_variable_value DIE."));
671 error (_(
"Type of DW_OP_GNU_variable_value DIE must be an integer or pointer."));
673 if (var_name !=
nullptr)
676 if (result !=
nullptr)
695 if (types ==
nullptr)
706 error (_(
"Unsupported address size in DWARF expressions: %d bits"),
714 0,
"<signed DWARF address type>");
724: m_addr_size (addr_size),
725 m_per_objfile (per_objfile)
734 this->
m_stack.emplace_back (value, in_stack_memory);
751 error (_(
"dwarf expression stack underflow"));
761 if (this->
m_stack.size () <= n)
762 error (_(
"Asked for position %d of stack, "
763 "stack only has %zu elements on it."),
779 error (_(
"frame address is not available."));
789 gdb_assert (framefunc != NULL);
807 if (result ==
nullptr)
808 error (_(
"Could not find type for operation"));
822 auto get_pc_from_frame = [frame] ()
833 gdb_assert (
block.per_cu == this->m_per_cu);
879 &caller_per_objfile);
880 const gdb_byte *data_src
886 if (data_src ==
nullptr)
887 throw_error (NO_ENTRY_VALUE_ERROR,
888 _(
"Cannot resolve DW_AT_call_data_value"));
896 scoped_restore save_frame = make_scoped_restore (&this->
m_frame,
898 scoped_restore save_per_cu = make_scoped_restore (&this->
m_per_cu,
900 scoped_restore save_addr_info = make_scoped_restore (&this->
m_addr_info,
902 scoped_restore save_per_objfile = make_scoped_restore (&this->
m_per_objfile,
905 scoped_restore save_addr_size = make_scoped_restore (&this->
m_addr_size);
915 LONGEST subobj_offset,
bool as_lval)
917 value *retval =
nullptr;
923 if (subobj_type ==
nullptr)
933 ULONGEST bit_size = 0;
936 bit_size += piece.size;
966 if (subobj_offset != 0)
967 error (_(
"cannot use offset on synthetic pointer to register"));
969 gdb_assert (this->
m_frame != NULL);
991 struct type *ptr_type;
1003 switch (subobj_type->
code ())
1005 case TYPE_CODE_FUNC:
1006 case TYPE_CODE_METHOD:
1015 retval =
value_at_lazy (subobj_type, address + subobj_offset,
1017 if (in_stack_memory)
1026 size_t len = subobj_type->
length ();
1029 if (subobj_offset + len > max)
1036 subobj_offset += n - max;
1045 size_t n = subobj_type->
length ();
1047 if (subobj_offset + n > this->
m_len)
1052 memcpy (contents, this->
m_data + subobj_offset, n);
1066 internal_error (_(
"invalid location type"));
1082 LONGEST subobj_offset)
1099 &&
type->
code () != TYPE_CODE_BOOL)
1100 error (_(
"integral type expected in DWARF expression"));
1120 error (_(
"no unsigned variant found for type, while evaluating "
1121 "DWARF expression"));
1142 error (_(
"no signed variant found for type, while evaluating "
1143 "DWARF expression"));
1168 gdb_byte *buf = (gdb_byte *) alloca (this->
m_addr_size);
1170 result_val->
type ());
1176 return (CORE_ADDR) result;
1184 if (this->
m_stack.size () <= n)
1185 error (_(
"Asked for position %d of stack, "
1186 "stack only has %zu elements on it."),
1188 return this->
m_stack[this->
m_stack.size () - (1 + n)].in_stack_memory;
1264 error (_(
"DWARF expression error: ran off end of buffer reading uleb128 value"));
1276 error (_(
"DWARF expression error: ran off end of buffer reading sleb128 value"));
1285 error (_(
"DWARF expression error: ran off end of buffer reading leb128 value"));
1296 const char *op_name)
1298 if (op_ptr != op_end && *op_ptr != DW_OP_piece && *op_ptr != DW_OP_bit_piece
1299 && *op_ptr != DW_OP_GNU_uninit)
1300 error (_(
"DWARF-2 expression error: `%s' operations must be "
1301 "used either alone or in conjunction with DW_OP_piece "
1302 "or DW_OP_bit_piece."),
1330 if (*buf >= DW_OP_reg0 && *buf <= DW_OP_reg31)
1332 if (buf_end - buf != 1)
1334 return *buf - DW_OP_reg0;
1337 if (*buf == DW_OP_regval_type || *buf == DW_OP_GNU_regval_type)
1347 else if (*buf == DW_OP_regx)
1356 if (buf != buf_end || (
int) dwarf_reg != dwarf_reg)
1368 CORE_ADDR *deref_size_return)
1376 if (*buf >= DW_OP_breg0 && *buf <= DW_OP_breg31)
1378 dwarf_reg = *buf - DW_OP_breg0;
1383 else if (*buf == DW_OP_bregx)
1389 if ((
int) dwarf_reg != dwarf_reg)
1401 if (*buf == DW_OP_deref)
1404 *deref_size_return = -1;
1406 else if (*buf == DW_OP_deref_size)
1411 *deref_size_return = *buf++;
1427 CORE_ADDR *fb_offset_return)
1434 if (*buf != DW_OP_fbreg)
1441 *fb_offset_return = fb_offset;
1442 if (buf != buf_end || fb_offset != (LONGEST) *fb_offset_return)
1454 const gdb_byte *buf_end, CORE_ADDR *sp_offset_return)
1461 if (*buf >= DW_OP_breg0 && *buf <= DW_OP_breg31)
1463 dwarf_reg = *buf - DW_OP_breg0;
1468 if (*buf != DW_OP_bregx)
1483 *sp_offset_return = sp_offset;
1484 if (buf != buf_end || sp_offset != (LONGEST) *sp_offset_return)
1495 const gdb_byte *op_end)
1512 error (_(
"DWARF-2 expression error: Loop detected (%d)."),
1516 while (op_ptr < op_end)
1518 dwarf_location_atom op = (dwarf_location_atom) *op_ptr++;
1526 bool in_stack_memory =
false;
1527 uint64_t uoffset, reg;
1529 value *result_val = NULL;
1569 result = op - DW_OP_lit0;
1581 if (op_ptr >= op_end || *op_ptr != DW_OP_GNU_push_tls_address)
1587 case DW_OP_GNU_addr_index:
1597 case DW_OP_GNU_const_index:
1694 result = op - DW_OP_reg0;
1708 case DW_OP_implicit_value:
1713 if (op_ptr + len > op_end)
1714 error (_(
"DW_OP_implicit_value: too few bytes available."));
1720 "DW_OP_implicit_value");
1724 case DW_OP_stack_value:
1729 case DW_OP_implicit_pointer:
1730 case DW_OP_GNU_implicit_pointer:
1740 op_ptr += ref_addr_size;
1744 result = (ULONGEST) len;
1749 "DW_OP_implicit_pointer");
1807 const gdb_byte *datastart;
1816 std::vector<dwarf_stack_value> saved_stack = std::move (this->
m_stack);
1823 eval (datastart, datalen);
1830 error (_(
"Not implemented: computing frame "
1831 "base using explicit value operator"));
1832 result = result + offset;
1834 in_stack_memory =
true;
1837 this->
m_stack = std::move (saved_stack);
1844 result_val =
fetch (0);
1854 result_val =
fetch (offset);
1860 if (this->
m_stack.size () < 2)
1861 error (_(
"Not enough elements for "
1862 "DW_OP_swap. Need 2, have %zu."),
1872 result_val =
fetch (1);
1878 if (this->
m_stack.size () < 3)
1879 error (_(
"Not enough elements for "
1880 "DW_OP_rot. Need 3, have %zu."),
1893 case DW_OP_deref_size:
1894 case DW_OP_deref_type:
1895 case DW_OP_GNU_deref_type:
1897 int addr_size = (op == DW_OP_deref ? this->
m_addr_size : *op_ptr++);
1898 gdb_byte *buf = (gdb_byte *) alloca (addr_size);
1904 if (op == DW_OP_deref_type || op == DW_OP_GNU_deref_type)
1907 cu_offset type_die_cu_off = (cu_offset) uoffset;
1913 this->
read_mem (buf, addr, addr_size);
1934 case DW_OP_plus_uconst:
1937 result_val =
fetch (0);
1954 case DW_OP_plus_uconst:
1984 struct value *first, *second;
1993 error (_(
"Incompatible types on DWARF stack"));
2000 result_val =
value_binop (first, second, BINOP_BITWISE_AND);
2003 result_val =
value_binop (first, second, BINOP_DIV);
2006 result_val =
value_binop (first, second, BINOP_SUB);
2011 struct type *orig_type = first->
type ();
2026 result_val =
value_binop (first, second, BINOP_MOD);
2028 result_val =
value_cast (orig_type, result_val);
2032 result_val =
value_binop (first, second, BINOP_MUL);
2037 result_val =
value_binop (first, second, BINOP_BITWISE_IOR);
2040 result_val =
value_binop (first, second, BINOP_ADD);
2045 result_val =
value_binop (first, second, BINOP_LSH);
2058 result_val =
value_binop (first, second, BINOP_RSH);
2061 if (result_val->
type () != second->
type ())
2075 result_val =
value_binop (first, second, BINOP_RSH);
2078 if (result_val->
type () != second->
type ())
2084 result_val =
value_binop (first, second, BINOP_BITWISE_XOR);
2114 internal_error (_(
"Can't be reached."));
2119 case DW_OP_call_frame_cfa:
2124 in_stack_memory =
true;
2127 case DW_OP_GNU_push_tls_address:
2128 case DW_OP_form_tls_address:
2184 case DW_OP_bit_piece:
2186 uint64_t
size, uleb_offset;
2202 case DW_OP_GNU_uninit:
2225 case DW_OP_GNU_variable_value:
2230 sect_offset sect_off
2234 op_ptr += ref_addr_size;
2241 case DW_OP_entry_value:
2242 case DW_OP_GNU_entry_value:
2245 CORE_ADDR deref_size;
2249 if (op_ptr + len > op_end)
2250 error (_(
"DW_OP_entry_value: too few bytes available."));
2267 if (deref_size == -1)
2271 kind_u, deref_size);
2275 error (_(
"DWARF-2 expression error: DW_OP_entry_value is "
2276 "supported only for single DW_OP_reg* "
2277 "or for DW_OP_breg*(0)+DW_OP_deref*"));
2280 case DW_OP_GNU_parameter_ref:
2293 case DW_OP_const_type:
2294 case DW_OP_GNU_const_type:
2297 const gdb_byte *data;
2301 cu_offset type_die_cu_off = (cu_offset) uoffset;
2310 error (_(
"DW_OP_const_type has different sizes for type and data"));
2316 case DW_OP_regval_type:
2317 case DW_OP_GNU_regval_type:
2321 cu_offset type_die_cu_off = (cu_offset) uoffset;
2334 case DW_OP_GNU_convert:
2335 case DW_OP_reinterpret:
2336 case DW_OP_GNU_reinterpret:
2341 cu_offset type_die_cu_off = (cu_offset) uoffset;
2343 if (to_underlying (type_die_cu_off) == 0)
2348 result_val =
fetch (0);
2351 if (op == DW_OP_convert || op == DW_OP_GNU_convert)
2353 else if (
type == result_val->
type ())
2359 error (_(
"DW_OP_reinterpret has wrong size"));
2367 case DW_OP_push_object_address:
2371 && this->m_addr_info->addr == 0))
2372 error (_(
"Location address is not set."));
2379 error (_(
"Unhandled dwarf expression opcode 0x%x"), op);
2383 gdb_assert (result_val != NULL);
2384 push (result_val, in_stack_memory);
const struct block * get_frame_block(frame_info_ptr frame, CORE_ADDR *addr_in_block)
@ CALL_SITE_PARAMETER_DWARF_REG
@ CALL_SITE_PARAMETER_PARAM_OFFSET
void read_memory(CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len)
void write_memory_with_notification(CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len)
static void store_unsigned_integer(gdb_byte *addr, int len, enum bfd_endian byte_order, ULONGEST val)
int longest_to_int(LONGEST)
static LONGEST extract_signed_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
static ULONGEST extract_unsigned_integer(gdb::array_view< const gdb_byte > buf, enum bfd_endian byte_order)
CORE_ADDR dwarf2_frame_cfa(frame_info_ptr this_frame)
static value * indirect_pieced_value(value *value)
const gdb_byte * safe_skip_leb128(const gdb_byte *buf, const gdb_byte *buf_end)
static void dwarf_require_integral(struct type *type)
static void read_pieced_value(value *v)
static void ensure_have_per_cu(dwarf2_per_cu_data *per_cu, const char *op_name)
static void write_pieced_value(value *to, value *from)
static size_t bits_to_bytes(ULONGEST start, ULONGEST n_bits)
static void * copy_pieced_value_closure(const value *v)
static void free_pieced_value_closure(value *v)
static const registry< gdbarch >::key< dwarf_gdbarch_types > dwarf_arch_cookie
static struct type * get_unsigned_type(struct gdbarch *gdbarch, struct type *type)
static bool rw_pieced_value(value *v, value *from, bool check_optimized)
void dwarf_expr_require_composition(const gdb_byte *op_ptr, const gdb_byte *op_end, const char *op_name)
int dwarf_block_to_dwarf_reg_deref(const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *deref_size_return)
const gdb_byte * safe_read_sleb128(const gdb_byte *buf, const gdb_byte *buf_end, int64_t *r)
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 value * coerce_pieced_ref(const value *value)
static int base_types_equal_p(struct type *t1, struct type *t2)
static void ensure_have_frame(frame_info_ptr frame, const char *op_name)
static const struct lval_funcs pieced_value_funcs
static bool is_optimized_out_pieced_value(value *v)
int dwarf_block_to_sp_offset(struct gdbarch *gdbarch, const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *sp_offset_return)
CORE_ADDR read_addr_from_reg(frame_info_ptr frame, int reg)
const gdb_byte * safe_read_uleb128(const gdb_byte *buf, const gdb_byte *buf_end, uint64_t *r)
int dwarf_block_to_fb_offset(const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *fb_offset_return)
static struct type * get_signed_type(struct gdbarch *gdbarch, struct type *type)
static bool check_pieced_synthetic_pointer(const value *value, LONGEST bit_offset, int bit_length)
int dwarf_block_to_dwarf_reg(const gdb_byte *buf, const gdb_byte *buf_end)
static value * sect_variable_value(sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
static const gdb_byte * gdb_read_uleb128(const gdb_byte *buf, const gdb_byte *buf_end, uint64_t *r)
@ DWARF_VALUE_IMPLICIT_POINTER
@ DWARF_VALUE_OPTIMIZED_OUT
void dwarf_expr_require_composition(const gdb_byte *, const gdb_byte *, const char *)
static const gdb_byte * gdb_read_sleb128(const gdb_byte *buf, const gdb_byte *buf_end, int64_t *r)
int dwarf_block_to_dwarf_reg_deref(const gdb_byte *buf, const gdb_byte *buf_end, CORE_ADDR *deref_size_return)
const gdb_byte * safe_read_sleb128(const gdb_byte *buf, const gdb_byte *buf_end, int64_t *r)
static const gdb_byte * gdb_skip_leb128(const gdb_byte *buf, const gdb_byte *buf_end)
CORE_ADDR read_addr_from_reg(frame_info_ptr frame, int reg)
const gdb_byte * safe_read_uleb128(const gdb_byte *buf, const gdb_byte *buf_end, uint64_t *r)
int dwarf_block_to_dwarf_reg(const gdb_byte *buf, const gdb_byte *buf_end)
struct value * value_from_register(struct type *type, int regnum, frame_info_ptr frame)
CORE_ADDR address_from_register(int regnum, frame_info_ptr frame)
const struct frame_id null_frame_id
struct gdbarch * get_frame_arch(frame_info_ptr this_frame)
void put_frame_register_bytes(frame_info_ptr frame, int regnum, CORE_ADDR offset, gdb::array_view< const gdb_byte > buffer)
frame_info_ptr get_selected_frame(const char *message)
frame_info_ptr frame_find_by_id(struct frame_id id)
bool get_frame_register_bytes(frame_info_ptr frame, int regnum, CORE_ADDR offset, gdb::array_view< gdb_byte > buffer, int *optimizedp, int *unavailablep)
CORE_ADDR get_frame_address_in_block(frame_info_ptr this_frame)
struct frame_id get_frame_id(frame_info_ptr fi)
frame_info_ptr get_prev_frame(frame_info_ptr this_frame)
enum bfd_endian gdbarch_byte_order(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_integer_to_address(struct gdbarch *gdbarch, struct type *type, const gdb_byte *buf)
int gdbarch_sp_regnum(struct gdbarch *gdbarch)
bool gdbarch_integer_to_address_p(struct gdbarch *gdbarch)
enum bfd_endian type_byte_order(const struct type *type)
struct type * lookup_pointer_type(struct type *type)
struct type * init_integer_type(type_allocator &alloc, int bit, int unsigned_p, const char *name)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct type * check_typedef(struct type *type)
void invalid_synthetic_pointer(void)
struct call_site_parameter * dwarf_expr_reg_to_entry_parameter(frame_info_ptr frame, enum call_site_parameter_kind kind, union call_site_parameter_u kind_u, dwarf2_per_cu_data **per_cu_return, dwarf2_per_objfile **per_objfile_return)
struct value * indirect_synthetic_pointer(sect_offset die, LONGEST byte_offset, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, frame_info_ptr frame, struct type *type, bool resolve_abstract_p)
int dwarf_reg_to_regnum(struct gdbarch *arch, int dwarf_reg)
int dwarf_reg_to_regnum_or_error(struct gdbarch *arch, ULONGEST dwarf_reg)
value * compute_var_value(const char *name)
void func_get_frame_base_dwarf_block(struct symbol *framefunc, CORE_ADDR pc, const gdb_byte **start, size_t *length)
static struct type * die_type(struct die_info *, struct dwarf2_cu *)
struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off(cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, gdb::function_view< CORE_ADDR()> get_frame_pc)
unrelocated_addr dwarf2_read_addr_index(dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, unsigned int addr_index)
struct type * dwarf2_get_die_type(cu_offset die_offset, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
struct type * dwarf2_fetch_die_type_sect_off(sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, const char **var_name)
int register_size(struct gdbarch *gdbarch, int regnum)
struct symbol * linkage_function() const
struct type * builtin_uint16
struct type * builtin_int8
struct type * builtin_func_ptr
struct type * builtin_data_ptr
struct type * builtin_uint32
struct type * builtin_uint64
struct type * builtin_int64
struct type * builtin_int
struct type * builtin_int32
struct type * builtin_uint8
struct type * builtin_int16
const gdb_byte * data_value
int ref_addr_size() const
CORE_ADDR relocate(unrelocated_addr addr)
void execute_stack_op(const gdb_byte *op_ptr, const gdb_byte *op_end)
std::vector< dwarf_stack_value > m_stack
const struct property_addr_info * m_addr_info
void eval(const gdb_byte *addr, size_t len)
struct value * fetch(int n)
void push_address(CORE_ADDR value, bool in_stack_memory)
std::vector< dwarf_expr_piece > m_pieces
bool stack_empty_p() const
dwarf_expr_context(dwarf2_per_objfile *per_objfile, int addr_size)
struct type * address_type() const
value * evaluate(const gdb_byte *addr, size_t len, bool as_lval, dwarf2_per_cu_data *per_cu, frame_info_ptr frame, const struct property_addr_info *addr_info=nullptr, struct type *type=nullptr, struct type *subobj_type=nullptr, LONGEST subobj_offset=0)
CORE_ADDR fetch_address(int n)
struct type * get_base_type(cu_offset die_cu_off)
void push(struct value *value, bool in_stack_memory)
void dwarf_call(cu_offset die_cu_off)
int m_max_recursion_depth
dwarf_value_location m_location
dwarf2_per_cu_data * m_per_cu
bool fetch_in_stack_memory(int n)
void push_dwarf_reg_entry_value(call_site_parameter_kind kind, call_site_parameter_u kind_u, int deref_size)
dwarf2_per_objfile * m_per_objfile
value * fetch_result(struct type *type, struct type *subobj_type, LONGEST subobj_offset, bool as_lval)
void get_frame_base(const gdb_byte **start, size_t *length)
void read_mem(gdb_byte *buf, CORE_ADDR addr, size_t length)
void add_piece(ULONGEST size, ULONGEST offset)
struct dwarf_expr_piece::@42::@43 mem
enum dwarf_value_location location
struct dwarf_expr_piece::@42::@45 ptr
union dwarf_expr_piece::@42 v
struct dwarf_expr_piece::@42::@44 literal
struct type * dw_types[3]
struct gdbarch * arch() const
CORE_ADDR text_section_offset() const
dwarf2_per_objfile * per_objfile
dwarf2_per_cu_data * per_cu
std::vector< dwarf_expr_piece > pieces
gdb::array_view< const gdb_byte > valaddr
unsigned short bit_offset() const
static struct value * zero(struct type *type, enum lval_type lv)
void set_initialized(bool value)
static struct value * allocate_optimized_out(struct type *type)
gdb::array_view< const gdb_byte > contents_all()
void contents_copy(struct value *dst, LONGEST dst_offset, LONGEST src_offset, LONGEST length)
void mark_bits_optimized_out(LONGEST offset, LONGEST length)
static struct value * allocate_computed(struct type *type, const struct lval_funcs *funcs, void *closure)
static struct value * allocate(struct type *type)
LONGEST embedded_offset() const
gdb::array_view< const gdb_byte > contents()
gdb::array_view< gdb_byte > contents_raw()
struct type * type() const
void set_offset(LONGEST offset)
void * computed_closure() const
void mark_bits_unavailable(LONGEST offset, ULONGEST length)
bool bits_synthetic_pointer(LONGEST offset, LONGEST length) const
CORE_ADDR target_translate_tls_address(struct objfile *objfile, CORE_ADDR offset)
void copy_bitwise(gdb_byte *dest, ULONGEST dest_offset, const gdb_byte *source, ULONGEST source_offset, ULONGEST nbits, int bits_big_endian)
struct value * value_neg(struct value *arg1)
struct value * value_complement(struct value *arg1)
int value_equal(struct value *arg1, struct value *arg2)
int value_less(struct value *arg1, struct value *arg2)
struct value * value_binop(struct value *arg1, struct value *arg2, enum exp_opcode op)
void read_value_memory(struct value *val, LONGEST bit_offset, bool stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length)
struct value * value_at_lazy(struct type *type, CORE_ADDR addr, frame_info_ptr frame)
struct value * value_cast(struct type *type, struct value *arg2)
CORE_ADDR value_as_address(struct value *val)
struct value * value_from_ulongest(struct type *type, ULONGEST num)
struct value * value_from_contents(struct type *type, const gdb_byte *contents)
LONGEST value_as_long(struct value *val)
struct value * value_from_pointer(struct type *type, CORE_ADDR addr)
struct value * value_from_contents_and_address(struct type *type, const gdb_byte *valaddr, CORE_ADDR address, frame_info_ptr frame)