diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2008-03-26 14:53:28 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2008-03-26 14:53:28 +0000 |
commit | 5e2b427df30d4c07ffe08dca54c26f2569b1630f (patch) | |
tree | c5290f5540b73971c48ba9171a6dcc030e8032cd /gdb/dwarf2loc.c | |
parent | 5a413362ba31657af57ca223df47809344d2532e (diff) | |
download | gdb-5e2b427df30d4c07ffe08dca54c26f2569b1630f.zip gdb-5e2b427df30d4c07ffe08dca54c26f2569b1630f.tar.gz gdb-5e2b427df30d4c07ffe08dca54c26f2569b1630f.tar.bz2 |
* objfiles.h (struct objfile): New GDBARCH member.
(get_objfile_arch): Add prototype.
* objfiles.c: Include "arch-utils.h".
(allocate_objfile): Look up gdbarch associated with bfd.
(get_objfile_arch): New function.
* Makefile (objfiles.o): Update dependencies.
* dwarf2-frame.c (decode_frame_entry_1): Replace current_gdbarch
by objfile arch.
* dwarf2loc.c (dwarf_expr_read_reg): Replace current_gdbarch
by frame arch.
(locexpr_describe_location): Replace current_gdbarch by
objfile arch.
* dwarf2read.c (die_type): Replace current_gdbarch by objfile arch.
(dwarf2_add_field): Likewise.
(read_tag_pointer_type): Likewise.
(read_base_type): Likewise.
(new_symbol): Likewise.
* coffread.c (decode_type): Add OBJFILE argument. Update callers.
(decode_base_type, decode_function_type): Likewise.
(coff_read_struct_type, coff_read_enum_type): Likewise.
(coff_symtab_read): Replace current_gdbarch by objfile arch.
(decode_base_type): Likewise.
(coff_read_enum_type): Likewise.
(coff_read_struct_type): Replace current_objfile by OBJFILE argument.
(coff_read_enum_type): Likewise.
* dbxread.c (read_dbx_symtab): Replace current_gdbarch by objfile arch.
(end_psymtab): Likewise.
(process_one_symbol): Likewise.
* mdebugread.c (parse_symbol): Replace current_gdbarch by objfile arch.
(parse_procedure): Likewise.
(parse_partial_symbols): Likewise.
* somread.c (som_symtab_read): Replace current_gdbarch by objfile arch.
* stabsread.c (define_symbol): Replace current_gdbarch by objfile arch.
Replace static pcc_promotion_type and pcc_unsigned_promotion_type by
built-in types.
(read_range_type): Replace current_gdbarch by objfile arch. Replace
static range_index_type by built-in type.
(read_one_struct_field): Replace current_gdbarch by objfile arch.
(read_enum_type): Likewise.
* xcoffread.c (read_xcoff_symtab): Replace current_gdbarch by
objfile arch.
Diffstat (limited to 'gdb/dwarf2loc.c')
-rw-r--r-- | gdb/dwarf2loc.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 4f4c0ca..4f3612e 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -116,11 +116,12 @@ static CORE_ADDR dwarf_expr_read_reg (void *baton, int dwarf_regnum) { struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; + struct gdbarch *gdbarch = get_frame_arch (debaton->frame); CORE_ADDR result; int regnum; - regnum = gdbarch_dwarf2_reg_to_regnum (current_gdbarch, dwarf_regnum); - result = address_from_register (builtin_type_void_data_ptr, + regnum = gdbarch_dwarf2_reg_to_regnum (gdbarch, dwarf_regnum); + result = address_from_register (builtin_type (gdbarch)->builtin_data_ptr, regnum, debaton->frame); return result; } @@ -459,11 +460,13 @@ locexpr_describe_location (struct symbol *symbol, struct ui_file *stream) && dlbaton->data[0] >= DW_OP_reg0 && dlbaton->data[0] <= DW_OP_reg31) { - int regno = gdbarch_dwarf2_reg_to_regnum - (current_gdbarch, dlbaton->data[0] - DW_OP_reg0); + struct objfile *objfile = dwarf2_per_cu_objfile (dlbaton->per_cu); + struct gdbarch *gdbarch = get_objfile_arch (objfile); + int regno = gdbarch_dwarf2_reg_to_regnum (gdbarch, + dlbaton->data[0] - DW_OP_reg0); fprintf_filtered (stream, "a variable in register %s", - gdbarch_register_name (current_gdbarch, regno)); + gdbarch_register_name (gdbarch, regno)); return 1; } |