aboutsummaryrefslogtreecommitdiff
path: root/gdb/mdebugread.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2008-03-26 14:53:28 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2008-03-26 14:53:28 +0000
commit5e2b427df30d4c07ffe08dca54c26f2569b1630f (patch)
treec5290f5540b73971c48ba9171a6dcc030e8032cd /gdb/mdebugread.c
parent5a413362ba31657af57ca223df47809344d2532e (diff)
downloadgdb-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/mdebugread.c')
-rw-r--r--gdb/mdebugread.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 4f8b123..771f5fd 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -559,6 +559,7 @@ static int
parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
struct section_offsets *section_offsets, struct objfile *objfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
void (*const swap_sym_in) (bfd *, void *, SYMR *) = debug_swap->swap_sym_in;
char *name;
@@ -653,7 +654,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
/* Type could be missing if file is compiled without debugging info. */
if (SC_IS_UNDEF (sh->sc)
|| sh->sc == scNil || sh->index == indexNil)
- SYMBOL_TYPE (s) = builtin_type (current_gdbarch)->nodebug_data_symbol;
+ SYMBOL_TYPE (s) = builtin_type (gdbarch)->nodebug_data_symbol;
else
SYMBOL_TYPE (s) = parse_type (cur_fd, ax, sh->index, 0, bigend, name);
/* Value of a data symbol is its memory address */
@@ -1039,8 +1040,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
that too. */
if (TYPE_LENGTH (t) == TYPE_NFIELDS (t)
|| TYPE_LENGTH (t) == 0)
- TYPE_LENGTH (t) =
- gdbarch_int_bit (current_gdbarch) / HOST_CHAR_BIT;
+ TYPE_LENGTH (t) = gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT;
for (ext_tsym = ext_sh + external_sym_size;
;
ext_tsym += external_sym_size)
@@ -1825,6 +1825,7 @@ static void
parse_procedure (PDR *pr, struct symtab *search_symtab,
struct partial_symtab *pst)
{
+ struct gdbarch *gdbarch = get_objfile_arch (pst->objfile);
struct symbol *s, *i;
struct block *b;
struct mdebug_extra_func_info *e;
@@ -1962,7 +1963,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
if (processing_gcc_compilation == 0
&& found_ecoff_debugging_info == 0
&& TYPE_CODE (TYPE_TARGET_TYPE (SYMBOL_TYPE (s))) == TYPE_CODE_VOID)
- SYMBOL_TYPE (s) = builtin_type (current_gdbarch)->nodebug_text_symbol;
+ SYMBOL_TYPE (s) = builtin_type (gdbarch)->nodebug_text_symbol;
}
/* Parse the external symbol ES. Just call parse_symbol() after
@@ -2226,6 +2227,7 @@ record_minimal_symbol (const char *name, const CORE_ADDR address,
static void
parse_partial_symbols (struct objfile *objfile)
{
+ struct gdbarch *gdbarch = get_objfile_arch (objfile);
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
const bfd_size_type external_rfd_size = debug_swap->external_rfd_size;
const bfd_size_type external_ext_size = debug_swap->external_ext_size;
@@ -2849,8 +2851,7 @@ parse_partial_symbols (struct objfile *objfile)
don't relocate it. */
if (sh.value == 0
- && gdbarch_sofun_address_maybe_missing
- (current_gdbarch))
+ && gdbarch_sofun_address_maybe_missing (gdbarch))
{
textlow_not_set = 1;
valu = 0;
@@ -2999,9 +3000,9 @@ parse_partial_symbols (struct objfile *objfile)
case 'S':
sh.value += ANOFFSET (objfile->section_offsets, SECT_OFF_DATA (objfile));
- if (gdbarch_static_transform_name_p (current_gdbarch))
+ if (gdbarch_static_transform_name_p (gdbarch))
namestring = gdbarch_static_transform_name
- (current_gdbarch, namestring);
+ (gdbarch, namestring);
add_psymbol_to_list (namestring, p - namestring,
VAR_DOMAIN, LOC_STATIC,
@@ -3230,8 +3231,7 @@ parse_partial_symbols (struct objfile *objfile)
necessary if a module compiled without
debugging info follows this module. */
if (pst
- && gdbarch_sofun_address_maybe_missing
- (current_gdbarch))
+ && gdbarch_sofun_address_maybe_missing (gdbarch))
{
pst = (struct partial_symtab *) 0;
includes_used = 0;