aboutsummaryrefslogtreecommitdiff
path: root/gdb/mdebugread.c
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2009-06-29 13:18:37 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2009-06-29 13:18:37 +0000
commit46bf50512ce837bbc53e8704dd5117db3273099b (patch)
tree46832d44f1d266f8be7f9786c64080e6f85e410f /gdb/mdebugread.c
parentb08f1e8d6d0c824023e04fa0f379026fd4d56c72 (diff)
downloadgdb-46bf50512ce837bbc53e8704dd5117db3273099b.zip
gdb-46bf50512ce837bbc53e8704dd5117db3273099b.tar.gz
gdb-46bf50512ce837bbc53e8704dd5117db3273099b.tar.bz2
* gdbtypes.h (struct builtin_type): Remove builtin_core_addr,
nodebug_text_symbol, nodebug_data_symbol, nodebug_unknown_symbol, and nodebug_tls_symbol members. (struct objfile_type): New data structure. (objfile_type): Add prototype. * gdbtypes.c (gdbtypes_post_init): Remove initialization code for types no longer in struct builtin_type. (objfile_type_data): New static variable. (_initialize_gdbtypes): Initialize it. (objfile_type): New function. * gdbtypes.h (builtin_type_error): Remove. * gdbtypes.c (build_complex): Do not use builtin_type_error. * symtab.c (builtin_type_error): Remove. (_initialize_symtab): Remove initialization. * stabsread.c (dbx_lookup_type, define_symbol, error_type, rs6000_builtin_type, read_range_type): Use per-objfile types instead of global or per-architecture builtin types. * coffread.c (decode_type): Likewise. * dwarf2read.c (read_array_type, read_tag_string_type, new_symbol, die_type): Likewise. * mdebugread.c (parse_symbol, basic_type, upgrade_type, parse_procedure, psymtab_to_symtab_1): Likewise. * xcoffread.c (process_xcoff_symbol): Likewise. * parse.c (write_exp_msymbol): Likewise. * stabsread.c (rs6000_builtin_type_data): New static variable. (_initialize_stabsread): Initialize it. (rs6000_builtin_type): Add OBJFILE argument. Allocate builtin types per-objfile instead of globally. * stabsread.c (dbx_lookup_type): Add OBJFILE argument. Use it instead of current_objfile; pass it to rs6000_builtin_type. (dbx_alloc_type, read_type, read_range_type): Update calls. (cleanup_undefined_types_noname): Add OBJFILE argument and pass it to dbx_lookup_type. (cleanup_undefined_types): Add OBJFILE argument and pass it to cleanup_undefined_types_noname. * stabsread.h (cleanup_undefined_types): Add OBJFILE argument. * buildsym.c (end_symtab): Update call.
Diffstat (limited to 'gdb/mdebugread.c')
-rw-r--r--gdb/mdebugread.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 65d6d0b..aac82e9 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -636,7 +636,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 (gdbarch)->nodebug_data_symbol;
+ SYMBOL_TYPE (s) = objfile_type (objfile)->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 */
@@ -685,7 +685,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_DOMAIN (s) = VAR_DOMAIN; /* so that it can be used */
SYMBOL_CLASS (s) = LOC_LABEL; /* but not misused */
SYMBOL_VALUE_ADDRESS (s) = (CORE_ADDR) sh->value;
- SYMBOL_TYPE (s) = builtin_type (gdbarch)->builtin_int;
+ SYMBOL_TYPE (s) = objfile_type (objfile)->builtin_int;
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
break;
@@ -728,7 +728,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
SYMBOL_CLASS (s) = LOC_BLOCK;
/* Type of the return value */
if (SC_IS_UNDEF (sh->sc) || sh->sc == scNil)
- t = builtin_type (gdbarch)->builtin_int;
+ t = objfile_type (objfile)->builtin_int;
else
{
t = parse_type (cur_fd, ax, sh->index + 1, 0, bigend, name);
@@ -1138,7 +1138,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
s = new_symbol (MDEBUG_EFI_SYMBOL_NAME);
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_CLASS (s) = LOC_CONST;
- SYMBOL_TYPE (s) = builtin_type_void;
+ SYMBOL_TYPE (s) = objfile_type (current_objfile)->builtin_void;
e = ((struct mdebug_extra_func_info *)
obstack_alloc (&current_objfile->objfile_obstack,
sizeof (struct mdebug_extra_func_info)));
@@ -1359,13 +1359,13 @@ basic_type (int bt, struct objfile *objfile)
switch (bt)
{
case btNil:
- tp = builtin_type_void;
+ tp = objfile_type (objfile)->builtin_void;
break;
case btAdr:
tp = init_type (TYPE_CODE_PTR, 4, TYPE_FLAG_UNSIGNED,
"adr_32", objfile);
- TYPE_TARGET_TYPE (tp) = builtin_type_void;
+ TYPE_TARGET_TYPE (tp) = objfile_type (objfile)->builtin_void;
break;
case btChar:
@@ -1457,7 +1457,7 @@ basic_type (int bt, struct objfile *objfile)
break;
case btVoid:
- tp = builtin_type_void;
+ tp = objfile_type (objfile)->builtin_void;
break;
case btLong64:
@@ -1483,7 +1483,7 @@ basic_type (int bt, struct objfile *objfile)
case btAdr64:
tp = init_type (TYPE_CODE_PTR, 8, TYPE_FLAG_UNSIGNED,
"adr_64", objfile);
- TYPE_TARGET_TYPE (tp) = builtin_type_void;
+ TYPE_TARGET_TYPE (tp) = objfile_type (objfile)->builtin_void;
break;
case btInt64:
@@ -1849,7 +1849,7 @@ upgrade_type (int fd, struct type **tpp, int tq, union aux_ext *ax, int bigend,
{
complaint (&symfile_complaints,
_("illegal array index type for %s, assuming int"), sym_name);
- indx = builtin_type_int32;
+ indx = objfile_type (current_objfile)->builtin_int;
}
/* Get the bounds, and create the array type. */
@@ -1918,7 +1918,6 @@ 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;
char *sh_name;
@@ -2002,7 +2001,7 @@ parse_procedure (PDR *pr, struct symtab *search_symtab,
SYMBOL_CLASS (s) = LOC_BLOCK;
/* Donno its type, hope int is ok */
SYMBOL_TYPE (s)
- = lookup_function_type (builtin_type (gdbarch)->builtin_int);
+ = lookup_function_type (objfile_type (pst->objfile)->builtin_int);
add_symbol (s, top_stack->cur_st, top_stack->cur_block);
/* Wont have symbols for this one */
b = new_block (2);
@@ -2057,7 +2056,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 (gdbarch)->nodebug_text_symbol;
+ SYMBOL_TYPE (s) = objfile_type (pst->objfile)->nodebug_text_symbol;
}
/* Parse the external symbol ES. Just call parse_symbol() after
@@ -4043,7 +4042,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst, char *filename)
memset (e, 0, sizeof (struct mdebug_extra_func_info));
SYMBOL_DOMAIN (s) = LABEL_DOMAIN;
SYMBOL_CLASS (s) = LOC_CONST;
- SYMBOL_TYPE (s) = builtin_type_void;
+ SYMBOL_TYPE (s) = objfile_type (pst->objfile)->builtin_void;
SYMBOL_VALUE_BYTES (s) = (gdb_byte *) e;
e->pdr.framereg = -1;
add_symbol_to_list (s, &local_symbols);