diff options
author | Tom Tromey <tromey@redhat.com> | 2010-11-29 21:18:16 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2010-11-29 21:18:16 +0000 |
commit | 8cf6f0b103e62f41f7cebe50f959a8c15986bd8e (patch) | |
tree | b1eb46a9debe1fb20a6a9dd47d7873edc0f8b68d /gdb/dwarf2expr.c | |
parent | 531ff9fd96ea76a508d7351f5bd9130cdb7a4f13 (diff) | |
download | gdb-8cf6f0b103e62f41f7cebe50f959a8c15986bd8e.zip gdb-8cf6f0b103e62f41f7cebe50f959a8c15986bd8e.tar.gz gdb-8cf6f0b103e62f41f7cebe50f959a8c15986bd8e.tar.bz2 |
gdb
* opencl-lang.c (lval_func_check_synthetic_pointer): New
function.
* value.h (struct lval_funcs) <indirect, check_synthetic_pointer>:
New fields.
(value_bits_synthetic_pointer): Declare.
* value.c (value_bits_synthetic_pointer): New function.
* valprint.c (valprint_check_validity): Handle synthetic
pointers.
* valops.c (value_ind): Use new 'indirect' lval_funcs method.
* valarith.c (value_ptradd): Use set_value_component_location.
* p-valprint.c (pascal_object_print_value_fields): Handle
synthetic pointers.
* jv-valprint.c (java_print_value_fields): Handle synthetic
pointers.
* dwarf2read.c (dwarf_stack_op_name): Add
DW_OP_GNU_implicit_pointer.
(dwarf2_fetch_die_location_block): Add get_frame_pc, baton
arguments. Handle location lists.
(fill_in_loclist_baton): New function.
(dwarf2_symbol_mark_computed): Use it.
* dwarf2loc.h (dwarf2_find_location_expression): Declare.
(dwarf2_fetch_die_location_block): Add get_frame_pc, baton
arguments.
* dwarf2loc.c (dwarf2_find_location_expression): Rename from
find_location_expression. No longer static. Update all callers.
(dwarf_expr_frame_pc): New function.
(per_cu_dwarf_call): Add get_frame_pc, baton arguments. Update
all callers.
(struct piece_closure) <per_cu>: New field.
(allocate_piece_closure): Add per_cu argument.
(read_pieced_value): Handle DWARF_VALUE_IMPLICIT_POINTER.
(check_pieced_value_bits): Remove validity argument, add check_for
argument. Handle DWARF_VALUE_IMPLICIT_POINTER.
(check_pieced_value_validity, check_pieced_value_invalid):
Update.
(check_pieced_synthetic_pointer): New function.
(get_frame_address_in_block_wrapper): New function.
(indirect_pieced_value): New function.
(pieced_value_funcs): Update.
(invalid_synthetic_pointer): New function.
(dwarf2_evaluate_loc_desc_full): Rename from
dwarf2_evaluate_loc_desc. Add byte_offset argument.
(dwarf2_evaluate_loc_desc): Rewrite.
(dwarf2_loc_desc_needs_frame): Set new field on context.
(get_ax_pc): New function.
(disassemble_dwarf_expression): Handle
DW_OP_GNU_implicit_pointer.
* dwarf2expr.h (enum dwarf_value_location)
<DWARF_VALUE_IMPLICIT_POINTER>: New constant.
(struct dwarf_expr_context) <get_frame_pc>: New field.
(struct dwarf_expr_piece) <v.ptr>: New field.
* dwarf2expr.c (add_piece): Handle DWARF_VALUE_IMPLICIT_POINTER.
(execute_stack_op): Handle DW_OP_GNU_implicit_pointer.
* dwarf2-frame.c (no_get_frame_pc): New function.
(execute_stack_op): Set new field on context.
* cp-valprint.c (cp_print_value_fields): Handle synthetic
pointers.
gdb/testsuite
* gdb.dwarf2/implptr.exp: New file.
* gdb.dwarf2/implptr.c: New file.
* gdb.dwarf2/implptr.S: New file.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r-- | gdb/dwarf2expr.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c index b9ae108..29bfcf4 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c @@ -233,6 +233,11 @@ add_piece (struct dwarf_expr_context *ctx, ULONGEST size, ULONGEST offset) p->v.mem.addr = dwarf_expr_fetch_address (ctx, 0); p->v.mem.in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); } + else if (p->location == DWARF_VALUE_IMPLICIT_POINTER) + { + p->v.ptr.die = ctx->len; + p->v.ptr.offset = (LONGEST) dwarf_expr_fetch (ctx, 0); + } else { p->v.value = dwarf_expr_fetch (ctx, 0); @@ -527,6 +532,26 @@ execute_stack_op (struct dwarf_expr_context *ctx, dwarf_expr_require_composition (op_ptr, op_end, "DW_OP_stack_value"); goto no_push; + case DW_OP_GNU_implicit_pointer: + { + ULONGEST die; + LONGEST len; + + /* The referred-to DIE. */ + ctx->len = extract_unsigned_integer (op_ptr, ctx->addr_size, + byte_order); + op_ptr += ctx->addr_size; + + /* The byte offset into the data. */ + op_ptr = read_sleb128 (op_ptr, op_end, &len); + result = (ULONGEST) len; + + ctx->location = DWARF_VALUE_IMPLICIT_POINTER; + dwarf_expr_require_composition (op_ptr, op_end, + "DW_OP_GNU_implicit_pointer"); + } + break; + case DW_OP_breg0: case DW_OP_breg1: case DW_OP_breg2: @@ -884,6 +909,12 @@ execute_stack_op (struct dwarf_expr_context *ctx, no_push:; } + /* To simplify our main caller, if the result is an implicit + pointer, then make a pieced value. This is ok because we can't + have implicit pointers in contexts where pieces are invalid. */ + if (ctx->location == DWARF_VALUE_IMPLICIT_POINTER) + add_piece (ctx, 8 * ctx->addr_size, 0); + ctx->recursion_depth--; gdb_assert (ctx->recursion_depth >= 0); #undef sign_ext |