#include "gdbsupport/underlying.h"
#include "gdbsupport/byte-vector.h"
-static struct value *dwarf2_evaluate_loc_desc_full (struct type *type,
- struct frame_info *frame,
- const gdb_byte *data,
- size_t size,
- struct dwarf2_per_cu_data *per_cu,
- struct type *subobj_type,
- LONGEST subobj_byte_offset);
+static struct value *dwarf2_evaluate_loc_desc_full
+ (struct type *type, struct frame_info *frame, const gdb_byte *data,
+ size_t size, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile,
+ struct type *subobj_type, LONGEST subobj_byte_offset);
static struct call_site_parameter *dwarf_expr_reg_to_entry_parameter
(struct frame_info *frame,
enum call_site_parameter_kind kind,
union call_site_parameter_u kind_u,
- struct dwarf2_per_cu_data **per_cu_return);
+ dwarf2_per_cu_data **per_cu_return,
+ dwarf2_per_objfile **per_objfile_return);
static struct value *indirect_synthetic_pointer
(sect_offset die, LONGEST byte_offset,
- struct dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
struct frame_info *frame,
struct type *type, bool resolve_abstract_p = false);
The result indicates the kind of entry found. */
static enum debug_loc_kind
-decode_debug_loclists_addresses (struct dwarf2_per_cu_data *per_cu,
+decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
const gdb_byte *loc_ptr,
const gdb_byte *buf_end,
const gdb_byte **new_ptr,
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &u64);
if (loc_ptr == NULL)
return DEBUG_LOC_BUFFER_OVERFLOW;
- *high = dwarf2_read_addr_index (per_cu, u64);
+ *high = dwarf2_read_addr_index (per_cu, per_objfile, u64);
*new_ptr = loc_ptr;
return DEBUG_LOC_BASE_ADDRESS;
case DW_LLE_startx_length:
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &u64);
if (loc_ptr == NULL)
return DEBUG_LOC_BUFFER_OVERFLOW;
- *low = dwarf2_read_addr_index (per_cu, u64);
+ *low = dwarf2_read_addr_index (per_cu, per_objfile, u64);
*high = *low;
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &u64);
if (loc_ptr == NULL)
The result indicates the kind of entry found. */
static enum debug_loc_kind
-decode_debug_loc_dwo_addresses (struct dwarf2_per_cu_data *per_cu,
+decode_debug_loc_dwo_addresses (dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
const gdb_byte *loc_ptr,
const gdb_byte *buf_end,
const gdb_byte **new_ptr,
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &high_index);
if (loc_ptr == NULL)
return DEBUG_LOC_BUFFER_OVERFLOW;
- *high = dwarf2_read_addr_index (per_cu, high_index);
+ *high = dwarf2_read_addr_index (per_cu, per_objfile, high_index);
*new_ptr = loc_ptr;
return DEBUG_LOC_BASE_ADDRESS;
case DW_LLE_GNU_start_end_entry:
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &low_index);
if (loc_ptr == NULL)
return DEBUG_LOC_BUFFER_OVERFLOW;
- *low = dwarf2_read_addr_index (per_cu, low_index);
+ *low = dwarf2_read_addr_index (per_cu, per_objfile, low_index);
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &high_index);
if (loc_ptr == NULL)
return DEBUG_LOC_BUFFER_OVERFLOW;
- *high = dwarf2_read_addr_index (per_cu, high_index);
+ *high = dwarf2_read_addr_index (per_cu, per_objfile, high_index);
*new_ptr = loc_ptr;
return DEBUG_LOC_START_END;
case DW_LLE_GNU_start_length_entry:
loc_ptr = gdb_read_uleb128 (loc_ptr, buf_end, &low_index);
if (loc_ptr == NULL)
return DEBUG_LOC_BUFFER_OVERFLOW;
- *low = dwarf2_read_addr_index (per_cu, low_index);
+ *low = dwarf2_read_addr_index (per_cu, per_objfile, low_index);
if (loc_ptr + 4 > buf_end)
return DEBUG_LOC_BUFFER_OVERFLOW;
*high = *low;
if (baton->per_cu->version () < 5 && baton->from_dwo)
kind = decode_debug_loc_dwo_addresses (baton->per_cu,
+ baton->per_objfile,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order);
else if (baton->per_cu->version () < 5)
signed_addr_p);
else
kind = decode_debug_loclists_addresses (baton->per_cu,
+ baton->per_objfile,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order,
addr_size, signed_addr_p);
SYMBOL_BLOCK_OPS (framefunc)->find_frame_base_location
(framefunc, get_frame_pc (frame), &start, &length);
result = dwarf2_evaluate_loc_desc (type, frame, start, length,
- dlbaton->per_cu);
+ dlbaton->per_cu, dlbaton->per_objfile);
/* The DW_AT_frame_base attribute contains a location description which
computes the base address itself. However, the call to
SYMBOL_BLOCK_OPS (framefunc)->find_frame_base_location
(framefunc, get_frame_pc (frame), &start, &length);
result = dwarf2_evaluate_loc_desc (type, frame, start, length,
- dlbaton->per_cu);
+ dlbaton->per_cu, dlbaton->per_objfile);
/* The DW_AT_frame_base attribute contains a location description which
computes the base address itself. However, the call to
static void
per_cu_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset,
- struct dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
{
struct dwarf2_locexpr_baton block;
- block = dwarf2_fetch_die_loc_cu_off (die_offset, per_cu,
+ block = dwarf2_fetch_die_loc_cu_off (die_offset, per_cu, per_objfile,
get_frame_pc_for_per_cu_dwarf_call,
ctx);
static struct value *
sect_variable_value (struct dwarf_expr_context *ctx, sect_offset sect_off,
- struct dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile)
{
- struct type *die_type = dwarf2_fetch_die_type_sect_off (sect_off, per_cu);
+ struct type *die_type
+ = dwarf2_fetch_die_type_sect_off (sect_off, per_cu, per_objfile);
if (die_type == NULL)
error (_("Bad DW_OP_GNU_variable_value DIE."));
struct type *type = lookup_pointer_type (die_type);
struct frame_info *frame = get_selected_frame (_("No frame selected."));
- return indirect_synthetic_pointer (sect_off, 0, per_cu, frame, type, true);
+ return indirect_synthetic_pointer (sect_off, 0, per_cu, per_objfile, frame,
+ type, true);
}
class dwarf_evaluate_loc_desc : public dwarf_expr_context
current thread's thread-local storage with offset OFFSET. */
CORE_ADDR get_tls_address (CORE_ADDR offset) override
{
- struct objfile *objfile = per_cu->objfile ();
-
- return target_translate_tls_address (objfile, offset);
+ return target_translate_tls_address (per_objfile->objfile, offset);
}
/* Helper interface of per_cu_dwarf_call for
void dwarf_call (cu_offset die_offset) override
{
- per_cu_dwarf_call (this, die_offset, per_cu);
+ per_cu_dwarf_call (this, die_offset, per_cu, per_objfile);
}
/* Helper interface of sect_variable_value for
struct value *dwarf_variable_value (sect_offset sect_off) override
{
- return sect_variable_value (this, sect_off, per_cu);
+ return sect_variable_value (this, sect_off, per_cu, per_objfile);
}
struct type *get_base_type (cu_offset die_offset, int size) override
{
- struct type *result = dwarf2_get_die_type (die_offset, per_cu);
+ struct type *result = dwarf2_get_die_type (die_offset, per_cu, per_objfile);
if (result == NULL)
error (_("Could not find type for DW_OP_const_type"));
if (size != 0 && TYPE_LENGTH (result) != size)
CORE_ADDR get_addr_index (unsigned int index) override
{
- return dwarf2_read_addr_index (per_cu, index);
+ return dwarf2_read_addr_index (per_cu, per_objfile, index);
}
/* Callback function for get_object_address. Return the address of the VLA
int deref_size) override
{
struct frame_info *caller_frame;
- struct dwarf2_per_cu_data *caller_per_cu;
+ dwarf2_per_cu_data *caller_per_cu;
+ dwarf2_per_objfile *caller_per_objfile;
struct call_site_parameter *parameter;
const gdb_byte *data_src;
size_t size;
caller_frame = get_prev_frame (frame);
parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
- &caller_per_cu);
+ &caller_per_cu,
+ &caller_per_objfile);
data_src = deref_size == -1 ? parameter->value : parameter->data_value;
size = deref_size == -1 ? parameter->value_size : parameter->data_value_size;
+ gdb_assert (this->per_objfile == caller_per_objfile);
+
/* DEREF_SIZE size is not verified here. */
if (data_src == NULL)
throw_error (NO_ENTRY_VALUE_ERROR,
(CORE_ADDR) 0);
scoped_restore save_arch = make_scoped_restore (&this->gdbarch);
- this->gdbarch = per_cu->objfile ()->arch ();
+ this->gdbarch = this->per_objfile->objfile->arch ();
scoped_restore save_addr_size = make_scoped_restore (&this->addr_size);
this->addr_size = per_cu->addr_size ();
caller_core_addr_type = builtin_type (caller_arch)->builtin_func_ptr;
val = dwarf2_evaluate_loc_desc (caller_core_addr_type, caller_frame,
dwarf_block->data, dwarf_block->size,
- dwarf_block->per_cu);
+ dwarf_block->per_cu,
+ dwarf_block->per_objfile);
/* DW_AT_call_target is a DWARF expression, not a DWARF location. */
if (VALUE_LVAL (val) == lval_memory)
return value_address (val);
dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
enum call_site_parameter_kind kind,
union call_site_parameter_u kind_u,
- struct dwarf2_per_cu_data **per_cu_return)
+ dwarf2_per_cu_data **per_cu_return,
+ dwarf2_per_objfile **per_objfile_return)
{
CORE_ADDR func_addr, caller_pc;
struct gdbarch *gdbarch;
}
*per_cu_return = call_site->per_cu;
+ *per_objfile_return = call_site->per_objfile;
return parameter;
}
dwarf_entry_parameter_to_value (struct call_site_parameter *parameter,
CORE_ADDR deref_size, struct type *type,
struct frame_info *caller_frame,
- struct dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile)
{
const gdb_byte *data_src;
gdb_byte *data;
memcpy (data, data_src, size);
data[size] = DW_OP_stack_value;
- return dwarf2_evaluate_loc_desc (type, caller_frame, data, size + 1, per_cu);
+ return dwarf2_evaluate_loc_desc (type, caller_frame, data, size + 1, per_cu,
+ per_objfile);
}
/* VALUE must be of type lval_computed with entry_data_value_funcs. Perform
struct frame_info *caller_frame = get_prev_frame (frame);
struct value *outer_val, *target_val, *val;
struct call_site_parameter *parameter;
- struct dwarf2_per_cu_data *caller_per_cu;
+ dwarf2_per_cu_data *caller_per_cu;
+ dwarf2_per_objfile *caller_per_objfile;
parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
- &caller_per_cu);
+ &caller_per_cu,
+ &caller_per_objfile);
outer_val = dwarf_entry_parameter_to_value (parameter, -1 /* deref_size */,
type, caller_frame,
- caller_per_cu);
+ caller_per_cu,
+ caller_per_objfile);
/* Check if DW_AT_call_data_value cannot be used. If it should be
used and it is not available do not fall back to OUTER_VAL - dereferencing
target_val = dwarf_entry_parameter_to_value (parameter,
TYPE_LENGTH (target_type),
target_type, caller_frame,
- caller_per_cu);
+ caller_per_cu,
+ caller_per_objfile);
val = allocate_computed_value (type, &entry_data_value_funcs,
release_value (target_val).release ());
PIECES. */
static struct piece_closure *
-allocate_piece_closure (struct dwarf2_per_cu_data *per_cu,
+allocate_piece_closure (dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
std::vector<dwarf_expr_piece> &&pieces,
struct frame_info *frame)
{
c->refc = 1;
/* We must capture this here due to sharing of DWARF state. */
- c->per_objfile = per_cu->dwarf2_per_objfile;
+ c->per_objfile = per_objfile;
c->per_cu = per_cu;
c->pieces = std::move (pieces);
if (frame == NULL)
break;
}
- struct objfile *objfile = c->per_cu->objfile ();
- struct gdbarch *objfile_gdbarch = objfile->arch ();
+ gdbarch *objfile_gdbarch = c->per_objfile->objfile->arch ();
ULONGEST stack_value_size_bits
= 8 * TYPE_LENGTH (value_type (p->v.value));
static struct value *
fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
- struct dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
struct type *type)
{
struct value *result = NULL;
LONGEST len;
auto_obstack temp_obstack;
- bytes = dwarf2_fetch_constant_bytes (die, per_cu, &temp_obstack, &len);
+ bytes = dwarf2_fetch_constant_bytes (die, per_cu, per_objfile,
+ &temp_obstack, &len);
if (bytes != NULL)
{
static struct value *
indirect_synthetic_pointer (sect_offset die, LONGEST byte_offset,
- struct dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
struct frame_info *frame, struct type *type,
bool resolve_abstract_p)
{
/* Fetch the location expression of the DIE we're pointing to. */
struct dwarf2_locexpr_baton baton
- = dwarf2_fetch_die_loc_sect_off (die, per_cu,
+ = dwarf2_fetch_die_loc_sect_off (die, per_cu, per_objfile,
get_frame_address_in_block_wrapper, frame,
resolve_abstract_p);
/* Get type of pointed-to DIE. */
- struct type *orig_type = dwarf2_fetch_die_type_sect_off (die, per_cu);
+ struct type *orig_type = dwarf2_fetch_die_type_sect_off (die, per_cu,
+ per_objfile);
if (orig_type == NULL)
invalid_synthetic_pointer ();
if (baton.data != NULL)
return dwarf2_evaluate_loc_desc_full (orig_type, frame, baton.data,
baton.size, baton.per_cu,
+ baton.per_objfile,
TYPE_TARGET_TYPE (type),
byte_offset);
else
return fetch_const_value_from_synthetic_pointer (die, byte_offset, per_cu,
- type);
+ per_objfile, type);
}
/* An implementation of an lval_funcs method to indirect through a
return indirect_synthetic_pointer (piece->v.ptr.die_sect_off,
byte_offset, c->per_cu,
- frame, type);
+ c->per_objfile, frame, type);
}
/* Implementation of the coerce_ref method of lval_funcs for synthetic C++
return indirect_synthetic_pointer
(closure->pieces[0].v.ptr.die_sect_off,
closure->pieces[0].v.ptr.offset,
- closure->per_cu, frame, type);
+ closure->per_cu, closure->per_objfile, frame, type);
}
else
{
static struct value *
dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
const gdb_byte *data, size_t size,
- struct dwarf2_per_cu_data *per_cu,
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
struct type *subobj_type,
LONGEST subobj_byte_offset)
{
struct value *retval;
- struct objfile *objfile = per_cu->objfile ();
if (subobj_type == NULL)
{
if (size == 0)
return allocate_optimized_out_value (subobj_type);
- dwarf2_per_objfile *per_objfile = get_dwarf2_per_objfile (objfile);
dwarf_evaluate_loc_desc ctx (per_objfile);
ctx.frame = frame;
ctx.per_cu = per_cu;
scoped_value_mark free_values;
- ctx.gdbarch = objfile->arch ();
+ ctx.gdbarch = per_objfile->objfile->arch ();
ctx.addr_size = per_cu->addr_size ();
ctx.ref_addr_size = per_cu->ref_addr_size ();
if (bit_size > 8 * TYPE_LENGTH (type))
invalid_synthetic_pointer ();
- c = allocate_piece_closure (per_cu, std::move (ctx.pieces), frame);
+ c = allocate_piece_closure (per_cu, per_objfile, std::move (ctx.pieces),
+ frame);
/* We must clean up the value chain after creating the piece
closure but before allocating the result. */
free_values.free_to_mark ();
size_t n = TYPE_LENGTH (value_type (value));
size_t len = TYPE_LENGTH (subobj_type);
size_t max = TYPE_LENGTH (type);
- struct gdbarch *objfile_gdbarch = objfile->arch ();
+ gdbarch *objfile_gdbarch = per_objfile->objfile->arch ();
if (subobj_byte_offset + len > max)
invalid_synthetic_pointer ();
struct value *
dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame,
const gdb_byte *data, size_t size,
- struct dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile)
{
return dwarf2_evaluate_loc_desc_full (type, frame, data, size, per_cu,
- NULL, 0);
+ per_objfile, NULL, 0);
}
/* A specialization of dwarf_evaluate_loc_desc that is used by
if (data != NULL)
{
val = dwarf2_evaluate_loc_desc (baton->property_type, frame, data,
- size, baton->loclist.per_cu);
+ size, baton->loclist.per_cu,
+ baton->loclist.per_objfile);
if (!value_optimized_out (val))
{
*value = value_as_address (val);
void dwarf_call (cu_offset die_offset) override
{
- per_cu_dwarf_call (this, die_offset, per_cu);
+ per_cu_dwarf_call (this, die_offset, per_cu, per_objfile);
}
/* Helper interface of sect_variable_value for
struct value *dwarf_variable_value (sect_offset sect_off) override
{
- return sect_variable_value (this, sect_off, per_cu);
+ return sect_variable_value (this, sect_off, per_cu, per_objfile);
}
/* DW_OP_entry_value accesses require a caller, therefore a
static enum symbol_needs_kind
dwarf2_loc_desc_get_symbol_read_needs (const gdb_byte *data, size_t size,
- struct dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile)
{
int in_reg;
- struct objfile *objfile = per_cu->objfile ();
scoped_value_mark free_values;
- symbol_needs_eval_context ctx (get_dwarf2_per_objfile (objfile));
+ symbol_needs_eval_context ctx (per_objfile);
ctx.needs = SYMBOL_NEEDS_NONE;
ctx.per_cu = per_cu;
- ctx.gdbarch = objfile->arch ();
+ ctx.gdbarch = per_objfile->objfile->arch ();
ctx.addr_size = per_cu->addr_size ();
ctx.ref_addr_size = per_cu->ref_addr_size ();
op_ptr += size;
cu_offset cuoffset = (cu_offset) uoffset;
- block = dwarf2_fetch_die_loc_cu_off (cuoffset, per_cu,
+ block = dwarf2_fetch_die_loc_cu_off (cuoffset, per_cu, per_objfile,
get_ax_pc, expr);
/* DW_OP_call_ref is currently not supported. */
struct value *val;
val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, dlbaton->data,
- dlbaton->size, dlbaton->per_cu);
+ dlbaton->size, dlbaton->per_cu,
+ dlbaton->per_objfile);
return val;
}
= (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol);
return dwarf2_loc_desc_get_symbol_read_needs (dlbaton->data, dlbaton->size,
- dlbaton->per_cu);
+ dlbaton->per_cu,
+ dlbaton->per_objfile);
}
/* Return true if DATA points to the end of a piece. END is one past
static const gdb_byte *
locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream,
- CORE_ADDR addr, struct objfile *objfile,
- struct dwarf2_per_cu_data *per_cu,
+ CORE_ADDR addr, dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile,
const gdb_byte *data, const gdb_byte *end,
unsigned int addr_size)
{
+ objfile *objfile = per_objfile->objfile;
struct gdbarch *gdbarch = objfile->arch ();
size_t leb128_size;
uint64_t offset;
data = safe_read_uleb128 (data + 1, end, &offset);
- offset = dwarf2_read_addr_index (per_cu, offset);
+ offset = dwarf2_read_addr_index (per_cu, per_objfile, offset);
fprintf_filtered (stream,
_("a thread-local variable at offset 0x%s "
"in the thread-local storage for `%s'"),
int offset_size, const gdb_byte *start,
const gdb_byte *data, const gdb_byte *end,
int indent, int all,
- struct dwarf2_per_cu_data *per_cu)
+ dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile)
{
while (data < end
&& (all
data = safe_read_uleb128 (data, end, &ul);
cu_offset offset = (cu_offset) ul;
- type = dwarf2_get_die_type (offset, per_cu);
+ type = dwarf2_get_die_type (offset, per_cu, per_objfile);
fprintf_filtered (stream, "<");
type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]> %d",
data = safe_read_uleb128 (data, end, &ul);
cu_offset type_die = (cu_offset) ul;
- type = dwarf2_get_die_type (type_die, per_cu);
+ type = dwarf2_get_die_type (type_die, per_cu, per_objfile);
fprintf_filtered (stream, "<");
type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]>",
data = safe_read_uleb128 (data, end, &ul);
cu_offset type_die = (cu_offset) ul;
- type = dwarf2_get_die_type (type_die, per_cu);
+ type = dwarf2_get_die_type (type_die, per_cu, per_objfile);
fprintf_filtered (stream, "<");
type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]> [$%s]",
{
struct type *type;
- type = dwarf2_get_die_type (type_die, per_cu);
+ type = dwarf2_get_die_type (type_die, per_cu, per_objfile);
fprintf_filtered (stream, "<");
type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]>",
fputc_filtered ('\n', stream);
disassemble_dwarf_expression (stream, arch, addr_size, offset_size,
start, data, data + ul, indent + 2,
- all, per_cu);
+ all, per_cu, per_objfile);
data += ul;
continue;
case DW_OP_addrx:
case DW_OP_GNU_addr_index:
data = safe_read_uleb128 (data, end, &ul);
- ul = dwarf2_read_addr_index (per_cu, ul);
+ ul = dwarf2_read_addr_index (per_cu, per_objfile, ul);
fprintf_filtered (stream, " 0x%s", phex_nz (ul, addr_size));
break;
case DW_OP_GNU_const_index:
data = safe_read_uleb128 (data, end, &ul);
- ul = dwarf2_read_addr_index (per_cu, ul);
+ ul = dwarf2_read_addr_index (per_cu, per_objfile, ul);
fprintf_filtered (stream, " %s", pulongest (ul));
break;
locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr,
struct ui_file *stream,
const gdb_byte *data, size_t size,
- struct objfile *objfile, unsigned int addr_size,
- int offset_size, struct dwarf2_per_cu_data *per_cu)
+ unsigned int addr_size,
+ int offset_size, dwarf2_per_cu_data *per_cu,
+ dwarf2_per_objfile *per_objfile)
{
const gdb_byte *end = data + size;
int first_piece = 1, bad = 0;
+ objfile *objfile = per_objfile->objfile;
while (data < end)
{
if (!dwarf_always_disassemble)
{
data = locexpr_describe_location_piece (symbol, stream,
- addr, objfile, per_cu,
+ addr, per_cu, per_objfile,
data, end, addr_size);
/* If we printed anything, or if we have an empty piece,
then don't disassemble. */
addr_size, offset_size, data,
data, end, 0,
dwarf_always_disassemble,
- per_cu);
+ per_cu, per_objfile);
}
if (data < end)
{
struct dwarf2_locexpr_baton *dlbaton
= (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol);
- dwarf2_per_objfile *per_objfile = dlbaton->per_objfile;
- struct objfile *objfile = per_objfile->objfile;
unsigned int addr_size = dlbaton->per_cu->addr_size ();
int offset_size = dlbaton->per_cu->offset_size ();
locexpr_describe_location_1 (symbol, addr, stream,
dlbaton->data, dlbaton->size,
- objfile, addr_size, offset_size,
- dlbaton->per_cu);
+ addr_size, offset_size,
+ dlbaton->per_cu, dlbaton->per_objfile);
}
/* Describe the location of SYMBOL as an agent value in VALUE, generating
data = dwarf2_find_location_expression (dlbaton, &size, pc);
val = dwarf2_evaluate_loc_desc (SYMBOL_TYPE (symbol), frame, data, size,
- dlbaton->per_cu);
+ dlbaton->per_cu, dlbaton->per_objfile);
return val;
}
if (dlbaton->per_cu->version () < 5 && dlbaton->from_dwo)
kind = decode_debug_loc_dwo_addresses (dlbaton->per_cu,
+ dlbaton->per_objfile,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order);
else if (dlbaton->per_cu->version () < 5)
signed_addr_p);
else
kind = decode_debug_loclists_addresses (dlbaton->per_cu,
+ dlbaton->per_objfile,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order,
addr_size, signed_addr_p);
/* Now describe this particular location. */
locexpr_describe_location_1 (symbol, low, stream, loc_ptr, length,
- objfile, addr_size, offset_size,
- dlbaton->per_cu);
+ addr_size, offset_size,
+ dlbaton->per_cu, dlbaton->per_objfile);
fprintf_filtered (stream, "\n");