Add support for DW_OP_push_object_address.

gdb/ChangeLog:

        * dwarf2expr.h (struct dwarf_expr_context_funcs): Uncomment
        field "get_object_address".
        * dwarf2expr.c (execute_stack_op): Add handling for
        DW_OP_push_object_address.
        * dwarf2loc.h (dwarf2_evaluate_property): Add "address" field.
        * dwarf2loc.c (struct dwarf_expr_baton): Add field "obj_address".
        (dwarf_expr_push_dwarf_reg_entry_value): Set baton_local.obj_address.
        (dwarf_expr_get_obj_addr): New function.
        (dwarf_expr_ctx_funcs): Add get_object_address field.
        (dwarf2_evaluate_loc_desc_full): Set baton.obj_address.
        (dwarf2_locexpr_baton_eval): Add parameter "addr".  Use it.
        (dwarf2_evaluate_property): Add parameter "address".  Use it.
        (needs_get_obj_addr): New function.
        (needs_frame_ctx_funcs): Add get_object_address field.
        (dwarf2_compile_expr_to_ax): Add DW_OP_push_object_address handling.
        * gdbtypes.c (resolve_dynamic_range): Add "addr" field.  Use it.
        (resolve_dynamic_array): Likewise.
This commit is contained in:
Joel Brobecker
2014-08-11 16:36:04 -07:00
parent 84754697d2
commit 08412b0722
6 changed files with 79 additions and 18 deletions

View File

@@ -1477,6 +1477,12 @@ execute_stack_op (struct dwarf_expr_context *ctx,
}
break;
case DW_OP_push_object_address:
/* Return the address of the object we are currently observing. */
result = (ctx->funcs->get_object_address) (ctx->baton);
result_val = value_from_ulongest (address_type, result);
break;
default:
error (_("Unhandled dwarf expression opcode 0x%x"), op);
}