+2013-11-17 Joel Brobecker <brobecker@adacore.com>
+
+ * dwarf2expr.h (struct dwarf_expr_context_funcs)
+ <read_addr_from_reg>: Renames "read_reg".
+ * dwarf2-frame.c (read_addr_from_reg): Renames "read_reg".
+ Adjust comment.
+ (dwarf2_frame_ctx_funcs, execute_stack_op, dwarf2_frame_cache):
+ Use read_addr_from_reg in place of read_reg.
+ * dwarf2expr.c (execute_stack_op): Use read_addr_from_reg
+ in place of read_reg.
+ * dwarf2loc.c (dwarf_expr_read_addr_from_reg): Renames
+ dwarf_expr_read_reg.
+ (dwarf_expr_ctx_funcs): Replace dwarf_expr_read_reg
+ with dwarf_expr_read_addr_from_reg.
+ (needs_frame_read_addr_from_reg): Renames needs_frame_read_reg.
+ (needs_frame_ctx_funcs): Replace needs_frame_read_reg with
+ needs_frame_read_addr_from_reg.
+
2013-11-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (Changes in GDB 7.5) (New commands) (explore): Fix typo.
/* Helper functions for execute_stack_op. */
static CORE_ADDR
-read_reg (void *baton, int reg)
+read_addr_from_reg (void *baton, int reg)
{
struct frame_info *this_frame = (struct frame_info *) baton;
struct gdbarch *gdbarch = get_frame_arch (this_frame);
/* Convert the register to an integer. This returns a LONGEST
rather than a CORE_ADDR, but unpack_pointer does the same thing
under the covers, and this makes more sense for non-pointer
- registers. Maybe read_reg and the associated interfaces should
- deal with "struct value" instead of CORE_ADDR. */
+ registers. Maybe read_addr_from_reg and the associated interfaces
+ should deal with "struct value" instead of CORE_ADDR. */
return unpack_long (register_type (gdbarch, regnum), buf);
}
static const struct dwarf_expr_context_funcs dwarf2_frame_ctx_funcs =
{
- read_reg,
+ read_addr_from_reg,
get_reg_value,
read_mem,
ctx_no_get_frame_base,
if (ctx->location == DWARF_VALUE_MEMORY)
result = dwarf_expr_fetch_address (ctx, 0);
else if (ctx->location == DWARF_VALUE_REGISTER)
- result = read_reg (this_frame, value_as_long (dwarf_expr_fetch (ctx, 0)));
+ result = read_addr_from_reg (this_frame,
+ value_as_long (dwarf_expr_fetch (ctx, 0)));
else
{
/* This is actually invalid DWARF, but if we ever do run across
switch (fs->regs.cfa_how)
{
case CFA_REG_OFFSET:
- cache->cfa = read_reg (this_frame, fs->regs.cfa_reg);
+ cache->cfa = read_addr_from_reg (this_frame, fs->regs.cfa_reg);
if (fs->armcc_cfa_offsets_reversed)
cache->cfa -= fs->regs.cfa_offset;
else
case DW_OP_breg31:
{
op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset);
- result = (ctx->funcs->read_reg) (ctx->baton, op - DW_OP_breg0);
+ result = (ctx->funcs->read_addr_from_reg) (ctx->baton,
+ op - DW_OP_breg0);
result += offset;
result_val = value_from_ulongest (address_type, result);
}
{
op_ptr = safe_read_uleb128 (op_ptr, op_end, ®);
op_ptr = safe_read_sleb128 (op_ptr, op_end, &offset);
- result = (ctx->funcs->read_reg) (ctx->baton, reg);
+ result = (ctx->funcs->read_addr_from_reg) (ctx->baton, reg);
result += offset;
result_val = value_from_ulongest (address_type, result);
}
if (ctx->location == DWARF_VALUE_MEMORY)
result = dwarf_expr_fetch_address (ctx, 0);
else if (ctx->location == DWARF_VALUE_REGISTER)
- result = (ctx->funcs->read_reg) (ctx->baton,
- value_as_long (dwarf_expr_fetch (ctx, 0)));
+ result = (ctx->funcs->read_addr_from_reg)
+ (ctx->baton,
+ value_as_long (dwarf_expr_fetch (ctx, 0)));
else
error (_("Not implemented: computing frame "
"base using explicit value operator"));
{
/* Return the value of register number REGNUM (a DWARF register number),
read as an address. */
- CORE_ADDR (*read_reg) (void *baton, int regnum);
+ CORE_ADDR (*read_addr_from_reg) (void *baton, int regnum);
/* Return a value of type TYPE, stored in register number REGNUM
of the frame associated to the given BATON.
/* Using the frame specified in BATON, return the value of register
REGNUM, treated as a pointer. */
static CORE_ADDR
-dwarf_expr_read_reg (void *baton, int dwarf_regnum)
+dwarf_expr_read_addr_from_reg (void *baton, int dwarf_regnum)
{
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
struct gdbarch *gdbarch = get_frame_arch (debaton->frame);
static const struct dwarf_expr_context_funcs dwarf_expr_ctx_funcs =
{
- dwarf_expr_read_reg,
+ dwarf_expr_read_addr_from_reg,
dwarf_expr_get_reg_value,
dwarf_expr_read_mem,
dwarf_expr_frame_base,
/* Reads from registers do require a frame. */
static CORE_ADDR
-needs_frame_read_reg (void *baton, int regnum)
+needs_frame_read_addr_from_reg (void *baton, int regnum)
{
struct needs_frame_baton *nf_baton = baton;
static const struct dwarf_expr_context_funcs needs_frame_ctx_funcs =
{
- needs_frame_read_reg,
+ needs_frame_read_addr_from_reg,
needs_frame_get_reg_value,
needs_frame_read_mem,
needs_frame_frame_base,