diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-09-05 11:40:53 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2008-09-05 11:40:53 +0000 |
commit | f7fd47281bfa87d64a095880d752b16cd5ed4510 (patch) | |
tree | a82668c3f3a848ead311b17fa6c800b2c428adf3 /gdb/dwarf2loc.c | |
parent | 714835d5a63b86bb0e82c13d2a4840d8b5e633d3 (diff) | |
download | gdb-f7fd47281bfa87d64a095880d752b16cd5ed4510.zip gdb-f7fd47281bfa87d64a095880d752b16cd5ed4510.tar.gz gdb-f7fd47281bfa87d64a095880d752b16cd5ed4510.tar.bz2 |
* dwarf2expr.h (dwarf2_read_address): Add gdbarch argument.
* dwarf2expr.c (dwarf2_read_address): Add gdbarch argument.
Call gdbarch_integer_to_address directly instead of converting
to value and back. Update comment.
(execute_stack_op): Update call site.
* dwarf2loc.c (find_location_expression): Likewise.
(locexpr_describe_location): Update
* dwarf2expr.h (struct dwarf_expr_context): Add gdbarch member.
* dwarf2-frame.c (execute_stack_op): Initialize ctx->gdbarch.
* dwarf2loc. (dwarf2_evaluate_loc_desc): Likewise.
(dwarf2_loc_desc_needs_frame): Likewise.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index f6ef04f..080cd06 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -55,6 +55,7 @@ find_location_expression (struct dwarf2_loclist_baton *baton, gdb_byte *loc_ptr, *buf_end; int length; struct objfile *objfile = dwarf2_per_cu_objfile (baton->per_cu); + struct gdbarch *gdbarch = get_objfile_arch (objfile); unsigned int addr_size = dwarf2_per_cu_addr_size (baton->per_cu); CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1)); /* Adjust base_address for relocatable objects. */ @@ -67,9 +68,9 @@ find_location_expression (struct dwarf2_loclist_baton *baton, while (1) { - low = dwarf2_read_address (loc_ptr, buf_end, addr_size); + low = dwarf2_read_address (gdbarch, loc_ptr, buf_end, addr_size); loc_ptr += addr_size; - high = dwarf2_read_address (loc_ptr, buf_end, addr_size); + high = dwarf2_read_address (gdbarch, loc_ptr, buf_end, addr_size); loc_ptr += addr_size; /* An end-of-list entry. */ @@ -215,6 +216,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, baton.objfile = dwarf2_per_cu_objfile (per_cu); ctx = new_dwarf_expr_context (); + ctx->gdbarch = get_objfile_arch (baton.objfile); ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); ctx->baton = &baton; ctx->read_reg = dwarf_expr_read_reg; @@ -336,6 +338,7 @@ dwarf2_loc_desc_needs_frame (gdb_byte *data, unsigned short size, baton.needs_frame = 0; ctx = new_dwarf_expr_context (); + ctx->gdbarch = get_objfile_arch (dwarf2_per_cu_objfile (per_cu)); ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); ctx->baton = &baton; ctx->read_reg = needs_frame_read_reg; @@ -492,7 +495,9 @@ locexpr_describe_location (struct symbol *symbol, struct ui_file *stream) if (dlbaton->data[0] == DW_OP_addr) { struct objfile *objfile = dwarf2_per_cu_objfile (dlbaton->per_cu); - CORE_ADDR offset = dwarf2_read_address (&dlbaton->data[1], + struct gdbarch *gdbarch = get_objfile_arch (objfile); + CORE_ADDR offset = dwarf2_read_address (gdbarch, + &dlbaton->data[1], &dlbaton->data[dlbaton->size - 1], addr_size); fprintf_filtered (stream, |