aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2loc.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2017-08-17 13:58:01 -0700
committerKeith Seitz <keiths@redhat.com>2017-08-17 13:58:01 -0700
commitb5f28d7abc02ca509e389fa932d725cf111e4b40 (patch)
tree57a0dc0feaff890630a6ba2c9fab811d56b1f9cf /gdb/dwarf2loc.c
parent2a95a158fae932f758d75a1178a40d4cc4804ff0 (diff)
parent1a457753cfad05989574c671a221ffce2d5df703 (diff)
downloadbinutils-users/pmuldoon/c++compile.zip
binutils-users/pmuldoon/c++compile.tar.gz
binutils-users/pmuldoon/c++compile.tar.bz2
Problems: gdb/compile/compile.c gdb/cp-support.c gdb/cp-support.h gdb/gdbtypes.h gdb/language.c gdb/linespec.c
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r--gdb/dwarf2loc.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 08b0aa2..927d950 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -2121,13 +2121,10 @@ fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
struct type *type)
{
struct value *result = NULL;
- struct obstack temp_obstack;
- struct cleanup *cleanup;
const gdb_byte *bytes;
LONGEST len;
- obstack_init (&temp_obstack);
- cleanup = make_cleanup_obstack_free (&temp_obstack);
+ auto_obstack temp_obstack;
bytes = dwarf2_fetch_constant_bytes (die, per_cu, &temp_obstack, &len);
if (bytes != NULL)
@@ -2144,8 +2141,6 @@ fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
else
result = allocate_optimized_out_value (TYPE_TARGET_TYPE (type));
- do_cleanups (cleanup);
-
return result;
}
@@ -2403,7 +2398,9 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
for (i = 0; i < ctx.num_pieces; ++i)
bit_size += ctx.pieces[i].size;
- if (8 * (subobj_byte_offset + TYPE_LENGTH (subobj_type)) > bit_size)
+ /* Complain if the expression is larger than the size of the
+ outer type. */
+ if (bit_size > 8 * TYPE_LENGTH (type))
invalid_synthetic_pointer ();
c = allocate_piece_closure (per_cu, ctx.num_pieces, ctx.pieces,
@@ -3021,10 +3018,11 @@ get_ax_pc (void *baton)
void
dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
- struct gdbarch *arch, unsigned int addr_size,
- const gdb_byte *op_ptr, const gdb_byte *op_end,
+ unsigned int addr_size, const gdb_byte *op_ptr,
+ const gdb_byte *op_end,
struct dwarf2_per_cu_data *per_cu)
{
+ gdbarch *arch = expr->gdbarch;
int i;
std::vector<int> dw_labels, patches;
const gdb_byte * const base = op_ptr;
@@ -3300,7 +3298,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
&datastart, &datalen);
op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset);
- dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size, datastart,
+ dwarf2_compile_expr_to_ax (expr, loc, addr_size, datastart,
datastart + datalen, per_cu);
if (loc->kind == axs_lvalue_register)
require_rvalue (expr, loc);
@@ -3526,8 +3524,8 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
{
/* Another expression. */
ax_const_l (expr, text_offset);
- dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size,
- cfa_start, cfa_end, per_cu);
+ dwarf2_compile_expr_to_ax (expr, loc, addr_size, cfa_start,
+ cfa_end, per_cu);
}
loc->kind = axs_lvalue_memory;
@@ -3651,9 +3649,8 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
/* DW_OP_call_ref is currently not supported. */
gdb_assert (block.per_cu == per_cu);
- dwarf2_compile_expr_to_ax (expr, loc, arch, addr_size,
- block.data, block.data + block.size,
- per_cu);
+ dwarf2_compile_expr_to_ax (expr, loc, addr_size, block.data,
+ block.data + block.size, per_cu);
}
break;
@@ -4410,8 +4407,8 @@ locexpr_describe_location (struct symbol *symbol, CORE_ADDR addr,
any necessary bytecode in AX. */
static void
-locexpr_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
- struct agent_expr *ax, struct axs_value *value)
+locexpr_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
+ struct axs_value *value)
{
struct dwarf2_locexpr_baton *dlbaton
= (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol);
@@ -4420,9 +4417,8 @@ locexpr_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
if (dlbaton->size == 0)
value->optimized_out = 1;
else
- dwarf2_compile_expr_to_ax (ax, value, gdbarch, addr_size,
- dlbaton->data, dlbaton->data + dlbaton->size,
- dlbaton->per_cu);
+ dwarf2_compile_expr_to_ax (ax, value, addr_size, dlbaton->data,
+ dlbaton->data + dlbaton->size, dlbaton->per_cu);
}
/* symbol_computed_ops 'generate_c_location' method. */
@@ -4618,8 +4614,8 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
/* Describe the location of SYMBOL as an agent value in VALUE, generating
any necessary bytecode in AX. */
static void
-loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
- struct agent_expr *ax, struct axs_value *value)
+loclist_tracepoint_var_ref (struct symbol *symbol, struct agent_expr *ax,
+ struct axs_value *value)
{
struct dwarf2_loclist_baton *dlbaton
= (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol);
@@ -4631,7 +4627,7 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch,
if (size == 0)
value->optimized_out = 1;
else
- dwarf2_compile_expr_to_ax (ax, value, gdbarch, addr_size, data, data + size,
+ dwarf2_compile_expr_to_ax (ax, value, addr_size, data, data + size,
dlbaton->per_cu);
}