for (function_count = 0, ii = 0; ii < oldLineTb->nitems; ++ii)
{
+ if (oldLineTb->item[ii].is_stmt == 0)
+ continue;
+
if (oldLineTb->item[ii].line == 0)
{ /* Function entry found. */
if (function_count >= fentry_size)
fentry_size * sizeof (struct linetable_entry));
}
fentry[function_count].line = ii;
+ fentry[function_count].is_stmt = 1;
fentry[function_count].pc = oldLineTb->item[ii].pc;
++function_count;
CORE_ADDR endaddr, unsigned *firstLine)
{
struct objfile *objfile = this_symtab_objfile;
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct gdbarch *gdbarch = objfile->arch ();
unsigned int curoffset;
CORE_ADDR addr;
void *ext_lnno;
}
}
-#define SYMBOL_DUP(SYMBOL1, SYMBOL2) \
- (SYMBOL2) = new (&objfile->objfile_obstack) symbol (); \
- *(SYMBOL2) = *(SYMBOL1);
-
-
#define SYMNAME_ALLOC(NAME, ALLOCED) \
((ALLOCED) ? (NAME) : obstack_strdup (&objfile->objfile_obstack, \
(NAME)))
if (name[0] == '.')
++name;
- initialize_objfile_symbol (sym);
-
/* default assumptions */
SET_SYMBOL_VALUE_ADDRESS (sym, cs->c_value + off);
SYMBOL_DOMAIN (sym) = VAR_DOMAIN;
SYMBOL_TYPE (sym) = objfile_type (objfile)->nodebug_text_symbol;
SYMBOL_ACLASS_INDEX (sym) = LOC_BLOCK;
- SYMBOL_DUP (sym, sym2);
+ sym2 = new (&objfile->objfile_obstack) symbol (*sym);
if (cs->c_sclass == C_EXT || C_WEAKEXT)
add_symbol_to_list (sym2, get_global_symbols ());
}
\f
static void
-xcoff_psymtab_to_symtab_1 (struct objfile *objfile, legacy_psymtab *pst)
+xcoff_expand_psymtab (legacy_psymtab *pst, struct objfile *objfile)
{
- int i;
-
- if (!pst)
- return;
-
- if (pst->readin)
- {
- fprintf_unfiltered
- (gdb_stderr, "Psymtab for %s already read in. Shouldn't happen.\n",
- pst->filename);
- return;
- }
+ gdb_assert (!pst->readin);
/* Read in all partial symtabs on which this one is dependent. */
- for (i = 0; i < pst->number_of_dependencies; i++)
- if (!pst->dependencies[i]->readin)
- {
- /* Inform about additional files that need to be read in. */
- if (info_verbose)
- {
- fputs_filtered (" ", gdb_stdout);
- wrap_here ("");
- fputs_filtered ("and ", gdb_stdout);
- wrap_here ("");
- printf_filtered ("%s...", pst->dependencies[i]->filename);
- wrap_here (""); /* Flush output */
- gdb_flush (gdb_stdout);
- }
- xcoff_psymtab_to_symtab_1 (objfile,
- (legacy_psymtab *) pst->dependencies[i]);
- }
+ pst->expand_dependencies (objfile);
if (((struct symloc *) pst->read_symtab_private)->numsyms != 0)
{
{
next_symbol_text_func = xcoff_next_symbol_text;
- xcoff_psymtab_to_symtab_1 (objfile, self);
+ self->expand_psymtab (objfile);
/* Match with global symbols. This only needs to be done once,
after all of the symtabs and dependencies have been read in. */
XOBNEW (&objfile->objfile_obstack, struct symloc);
((struct symloc *) result->read_symtab_private)->first_symnum = first_symnum;
result->legacy_read_symtab = xcoff_read_symtab;
+ result->legacy_expand_psymtab = xcoff_expand_psymtab;
/* Deduce the source language from the filename for this psymtab. */
psymtab_language = deduce_language_from_filename (filename);
subpst->number_of_dependencies = 1;
subpst->legacy_read_symtab = pst->legacy_read_symtab;
+ subpst->legacy_expand_psymtab = pst->legacy_expand_psymtab;
}
if (num_includes == 0
/* Empty psymtabs happen as a result of header files which don't have
any symbols in them. There can be a lot of them. */
- discard_psymtab (objfile, pst);
+ objfile->partial_symtabs->discard_psymtab (pst);
/* Indicate that psymtab was thrown away. */
pst = NULL;
scan_xcoff_symtab (minimal_symbol_reader &reader,
struct objfile *objfile)
{
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ struct gdbarch *gdbarch = objfile->arch ();
CORE_ADDR toc_offset = 0; /* toc offset value in data section. */
const char *filestring = NULL;