it indicates the start of data for one original source file. */
static void
-coff_start_symtab (struct objfile *objfile, const char *name)
+coff_start_compunit_symtab (struct objfile *objfile, const char *name)
{
within_function = 0;
- start_symtab (objfile,
- name,
+ start_compunit_symtab (objfile,
+ name,
/* We never know the directory name for COFF. */
- NULL,
+ NULL,
/* The start address is irrelevant, since we call
- set_last_source_start_addr in coff_end_symtab. */
- 0,
+ set_last_source_start_addr in coff_end_compunit_symtab. */
+ 0,
/* Let buildsym.c deduce the language for this symtab. */
- language_unknown);
+ language_unknown);
record_debugformat ("COFF");
}
list of all such. */
static void
-coff_end_symtab (struct objfile *objfile)
+coff_end_compunit_symtab (struct objfile *objfile)
{
set_last_source_start_addr (current_source_start_addr);
- end_symtab (current_source_end_addr, SECT_OFF_TEXT (objfile));
+ end_compunit_symtab (current_source_end_addr, SECT_OFF_TEXT (objfile));
/* Reinitialize for beginning of new file. */
set_last_source_file (NULL);
or "_imp_", get rid of the prefix, and search the minimal
symbol in OBJFILE. Note that 'maintenance print msymbols'
shows that type of these "_imp_XXXX" symbols is mst_data. */
- if (MSYMBOL_TYPE (msym) == mst_data)
+ if (msym->type () == mst_data)
{
const char *name1 = NULL;
respectively in OBJFILE. Set the type of symbol "foo"
as 'mst_solib_trampoline'. */
if (found.minsym != NULL
- && MSYMBOL_TYPE (found.minsym) == mst_text)
- MSYMBOL_TYPE (found.minsym) = mst_solib_trampoline;
+ && found.minsym->type () == mst_text)
+ found.minsym->set_type (mst_solib_trampoline);
}
}
}
if (dwarf2_has_info (objfile, NULL))
{
/* DWARF2 sections. */
- dwarf2_build_psymtabs (objfile);
+ dwarf2_initialize_objfile (objfile);
}
- dwarf2_build_frame_info (objfile);
-
/* Try to add separate debug file if no symbols table found. */
if (!objfile->has_partial_symbols ())
{
type_vector_length = INITIAL_TYPE_VECTOR_LENGTH;
type_vector = XCNEWVEC (struct type *, type_vector_length);
- coff_start_symtab (objfile, "");
+ coff_start_compunit_symtab (objfile, "");
symnum = 0;
while (symnum < nsyms)
if (cs->c_symnum == next_file_symnum && cs->c_sclass != C_FILE)
{
if (get_last_source_file ())
- coff_end_symtab (objfile);
+ coff_end_compunit_symtab (objfile);
- coff_start_symtab (objfile, "_globals_");
- /* coff_start_symtab will set the language of this symtab to
+ coff_start_compunit_symtab (objfile, "_globals_");
+ /* coff_start_compunit_symtab will set the language of this symtab to
language_unknown, since such a ``file name'' is not
recognized. Override that with the minimal language to
allow printing values in this symtab. */
containing debugging information. */
if (get_last_source_file ())
{
- coff_end_symtab (objfile);
- coff_start_symtab (objfile, filestring);
+ coff_end_compunit_symtab (objfile);
+ coff_start_compunit_symtab (objfile, filestring);
}
in_source_file = 1;
break;
sym = process_coff_symbol
(cs, &main_aux, objfile);
- SYMBOL_VALUE (sym) = tmpaddr + offset;
+ sym->set_value_longest (tmpaddr + offset);
sym->set_section_index (sec);
}
}
}
if (get_last_source_file ())
- coff_end_symtab (objfile);
+ coff_end_compunit_symtab (objfile);
/* Patch up any opaque types (references to types that are not defined
in the file where they are referenced, e.g. "struct foo *bar"). */
static void
patch_opaque_types (struct symtab *s)
{
- const struct block *b;
struct block_iterator iter;
struct symbol *real_sym;
/* Go through the per-file symbols only. */
- b = BLOCKVECTOR_BLOCK (s->blockvector (), STATIC_BLOCK);
+ const struct block *b = s->compunit ()->blockvector ()->static_block ();
ALL_BLOCK_SYMBOLS (b, iter, real_sym)
{
/* Find completed typedefs to use to fix opaque ones.
from different files with the same name. */
if (real_sym->aclass () == LOC_TYPEDEF
&& real_sym->domain () == VAR_DOMAIN
- && SYMBOL_TYPE (real_sym)->code () == TYPE_CODE_PTR
- && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (real_sym))) != 0)
+ && real_sym->type ()->code () == TYPE_CODE_PTR
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (real_sym->type ())) != 0)
{
const char *name = real_sym->linkage_name ();
int hash = hashname (name);
&& strcmp (name + 1, sym->linkage_name () + 1) == 0)
{
if (prev)
- {
- SYMBOL_VALUE_CHAIN (prev) = SYMBOL_VALUE_CHAIN (sym);
- }
+ prev->set_value_chain (sym->value_chain ());
else
- {
- opaque_type_chain[hash] = SYMBOL_VALUE_CHAIN (sym);
- }
+ opaque_type_chain[hash] = sym->value_chain ();
- patch_type (SYMBOL_TYPE (sym), SYMBOL_TYPE (real_sym));
+ patch_type (sym->type (), real_sym->type ());
if (prev)
- {
- sym = SYMBOL_VALUE_CHAIN (prev);
- }
+ sym = prev->value_chain ();
else
- {
- sym = opaque_type_chain[hash];
- }
+ sym = opaque_type_chain[hash];
}
else
{
prev = sym;
- sym = SYMBOL_VALUE_CHAIN (sym);
+ sym->set_value_chain (sym);
}
}
}
static int
coff_reg_to_regnum (struct symbol *sym, struct gdbarch *gdbarch)
{
- return gdbarch_sdb_reg_to_regnum (gdbarch, SYMBOL_VALUE (sym));
+ return gdbarch_sdb_reg_to_regnum (gdbarch, sym->value_longest ());
}
static const struct symbol_register_ops coff_register_funcs = {
sym->compute_and_set_names (name, true, objfile->per_bfd);
/* default assumptions */
- SYMBOL_VALUE (sym) = cs->c_value;
+ sym->set_value_longest (cs->c_value);
sym->set_domain (VAR_DOMAIN);
sym->set_section_index (cs_to_section (cs, objfile));
if (ISFCN (cs->c_type))
{
- SYMBOL_VALUE (sym) += objfile->text_section_offset ();
- SYMBOL_TYPE (sym) =
- lookup_function_type (decode_function_type (cs, cs->c_type,
- aux, objfile));
+ sym->set_value_longest
+ (sym->value_longest () + objfile->text_section_offset ());
+ sym->set_type
+ (lookup_function_type (decode_function_type (cs, cs->c_type,
+ aux, objfile)));
sym->set_aclass_index (LOC_BLOCK);
if (cs->c_sclass == C_STAT || cs->c_sclass == C_THUMBSTAT
}
else
{
- SYMBOL_TYPE (sym) = decode_type (cs, cs->c_type, aux, objfile);
+ sym->set_type (decode_type (cs, cs->c_type, aux, objfile));
switch (cs->c_sclass)
{
case C_NULL:
case C_THUMBEXTFUNC:
case C_EXT:
sym->set_aclass_index (LOC_STATIC);
- SET_SYMBOL_VALUE_ADDRESS (sym,
- (CORE_ADDR) cs->c_value
- + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
+ sym->set_value_address ((CORE_ADDR) cs->c_value
+ + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
add_symbol_to_list (sym, get_global_symbols ());
break;
case C_THUMBSTATFUNC:
case C_STAT:
sym->set_aclass_index (LOC_STATIC);
- SET_SYMBOL_VALUE_ADDRESS (sym,
- (CORE_ADDR) cs->c_value
- + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
+ sym->set_value_address ((CORE_ADDR) cs->c_value
+ + objfile->section_offsets[SECT_OFF_TEXT (objfile)]);
if (within_function)
{
/* Static symbol of local scope. */
#endif
case C_REG:
sym->set_aclass_index (coff_register_index);
- SYMBOL_VALUE (sym) = cs->c_value;
+ sym->set_value_longest (cs->c_value);
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_ARG:
sym->set_aclass_index (LOC_ARG);
- SYMBOL_IS_ARGUMENT (sym) = 1;
+ sym->set_is_argument (1);
add_symbol_to_list (sym, get_local_symbols ());
break;
case C_REGPARM:
sym->set_aclass_index (coff_register_index);
- SYMBOL_IS_ARGUMENT (sym) = 1;
- SYMBOL_VALUE (sym) = cs->c_value;
+ sym->set_is_argument (1);
+ sym->set_value_longest (cs->c_value);
add_symbol_to_list (sym, get_local_symbols ());
break;
sym->set_domain (VAR_DOMAIN);
/* If type has no name, give it one. */
- if (SYMBOL_TYPE (sym)->name () == 0)
+ if (sym->type ()->name () == 0)
{
- if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
- || SYMBOL_TYPE (sym)->code () == TYPE_CODE_FUNC)
+ if (sym->type ()->code () == TYPE_CODE_PTR
+ || sym->type ()->code () == TYPE_CODE_FUNC)
{
/* If we are giving a name to a type such as
"pointer to foo" or "function returning foo", we
;
}
else
- SYMBOL_TYPE (sym)->set_name (xstrdup (sym->linkage_name ()));
+ sym->type ()->set_name (xstrdup (sym->linkage_name ()));
}
/* Keep track of any type which points to empty structured
not an empty structured type, though; the forward
references work themselves out via the magic of
coff_lookup_type. */
- if (SYMBOL_TYPE (sym)->code () == TYPE_CODE_PTR
- && TYPE_LENGTH (TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))) == 0
- && TYPE_TARGET_TYPE (SYMBOL_TYPE (sym))->code ()
+ if (sym->type ()->code () == TYPE_CODE_PTR
+ && TYPE_LENGTH (TYPE_TARGET_TYPE (sym->type ())) == 0
+ && TYPE_TARGET_TYPE (sym->type ())->code ()
!= TYPE_CODE_UNDEF)
{
int i = hashname (sym->linkage_name ());
- SYMBOL_VALUE_CHAIN (sym) = opaque_type_chain[i];
+ sym->set_value_chain (opaque_type_chain[i]);
opaque_type_chain[i] = sym;
}
add_symbol_to_list (sym, get_file_symbols ());
/* Some compilers try to be helpful by inventing "fake"
names for anonymous enums, structures, and unions, like
"~0fake" or ".0fake". Thanks, but no thanks... */
- if (SYMBOL_TYPE (sym)->name () == 0)
+ if (sym->type ()->name () == 0)
if (sym->linkage_name () != NULL
&& *sym->linkage_name () != '~'
&& *sym->linkage_name () != '.')
- SYMBOL_TYPE (sym)->set_name (xstrdup (sym->linkage_name ()));
+ sym->type ()->set_name (xstrdup (sym->linkage_name ()));
add_symbol_to_list (sym, get_file_symbols ());
break;
sym->set_linkage_name (name);
sym->set_aclass_index (LOC_CONST);
sym->set_domain (VAR_DOMAIN);
- SYMBOL_VALUE (sym) = ms->c_value;
+ sym->set_value_longest (ms->c_value);
add_symbol_to_list (sym, symlist);
nsyms++;
break;
{
struct symbol *xsym = syms->symbol[j];
- SYMBOL_TYPE (xsym) = type;
+ xsym->set_type (type);
type->field (n).set_name (xsym->linkage_name ());
- type->field (n).set_loc_enumval (SYMBOL_VALUE (xsym));
- if (SYMBOL_VALUE (xsym) < 0)
+ type->field (n).set_loc_enumval (xsym->value_longest ());
+ if (xsym->value_longest () < 0)
unsigned_enum = 0;
TYPE_FIELD_BITSIZE (type, n) = 0;
}