}
}
- /* Now, search for a matching tail (only if name doesn't have any dirs) */
+ /* Now, search for a matching tail (only if name doesn't have any dirs). */
if (lbasename (name) == name)
ALL_OBJFILE_PSYMTABS (objfile, pst)
we want the partial symbol table that contains the
function containing the PC. */
if (!(objfile->flags & OBJF_REORDERED) &&
- section == 0) /* can't validate section this way */
+ section == 0) /* Can't validate section this way. */
return pst;
if (msymbol == NULL)
/* The code range of partial symtabs sometimes overlap, so, in
the loop below, we need to check all partial symtabs and
- find the one that fits better for the given PC address. We
+ find the one that fits better for the given PC address. We
select the partial symtab that contains a symbol whose
address is closest to the PC address. By closest we mean
that find_pc_sect_symbol returns the symbol with address
necessarily lower or equal to PC, the symbol closer
to PC is the symbol which address is the highest.
This way we return the psymtab which contains such
- best match symbol. This can help in cases where the
+ best match symbol. This can help in cases where the
symbol information/debuginfo is not complete, like
for instance on IRIX6 with gcc, where no debug info
- is emitted for statics. (See also the nodebug.exp
- testcase.) */
+ is emitted for statics. (See also the nodebug.exp
+ testcase.) */
if (this_addr > best_addr)
{
best_addr = this_addr;
gdb_assert (psymtab != NULL);
- /* Cope with programs that start at address 0 */
+ /* Cope with programs that start at address 0. */
best_pc = (psymtab->textlow != 0) ? psymtab->textlow - 1 : 0;
/* Search the global symbols as well as the static symbols, so that
|| (psymtab->textlow == 0
&& best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
{
- if (section) /* match on a specific section */
+ if (section) /* Match on a specific section. */
{
fixup_psymbol_section (p, psymtab->objfile);
if (!matching_obj_sections (SYMBOL_OBJ_SECTION (p), section))
|| (psymtab->textlow == 0
&& best_pc == 0 && SYMBOL_VALUE_ADDRESS (p) == 0)))
{
- if (section) /* match on a specific section */
+ if (section) /* Match on a specific section. */
{
fixup_psymbol_section (p, psymtab->objfile);
if (!matching_obj_sections (SYMBOL_OBJ_SECTION (p), section))
pst->objfile->global_psymbols.list + pst->globals_offset :
pst->objfile->static_psymbols.list + pst->statics_offset);
- if (global) /* This means we can use a binary search. */
+ if (global) /* This means we can use a binary search. */
{
do_linear_search = 0;
static struct symtab *
psymtab_to_symtab (struct partial_symtab *pst)
{
- /* If it's been looked up before, return it. */
+ /* If it's been looked up before, return it. */
if (pst->symtab)
return pst->symtab;
fputs_filtered ("undefined domain, ", outfile);
break;
case VAR_DOMAIN:
- /* This is the usual thing -- don't print it */
+ /* This is the usual thing -- don't print it. */
break;
case STRUCT_DOMAIN:
fputs_filtered ("struct domain, ", outfile);
}
/* Look through the partial symtabs for all symbols which begin
- by matching FUNC_NAME. Make sure we read that symbol table in. */
+ by matching FUNC_NAME. Make sure we read that symbol table in. */
static void
read_symtabs_for_function (struct objfile *objfile, const char *func_name)
+ ps->n_global_syms);
psym++)
{
- /* If interrupted, then quit. */
+ /* If interrupted, then quit. */
QUIT;
(*fun) (SYMBOL_NATURAL_NAME (*psym), data);
}
return NULL;
/* Don't check ps->fullname here, the file could have been
- deleted/moved/..., look for it again */
+ deleted/moved/..., look for it again. */
r = find_and_open_source (ps->filename, ps->dirname, &ps->fullname);
if (r >= 0)
bound = gbound;
/* Go through all of the symbols stored in a partial
- symtab in one loop. */
+ symtab in one loop. */
psym = objfile->global_psymbols.list + ps->globals_offset;
while (keep_going)
{
void
sort_pst_symbols (struct partial_symtab *pst)
{
- /* Sort the global list; don't sort the static list */
+ /* Sort the global list; don't sort the static list. */
qsort (pst->objfile->global_psymbols.list + pst->globals_offset,
pst->n_global_syms, sizeof (struct partial_symbol *),
/* Allocate and partially fill a partial symtab. It will be
completely filled at the end of the symbol list.
- FILENAME is the name of the symbol-file we are reading from. */
+ FILENAME is the name of the symbol-file we are reading from. */
struct partial_symtab *
start_psymtab_common (struct objfile *objfile,
/* Calculate a hash code for the given partial symbol. The hash is
calculated using the symbol's value, language, domain, class
- and name. These are the values which are set by
+ and name. These are the values which are set by
add_psymbol_to_bcache. */
static unsigned long
xfree (bcache);
}
-/* Return the internal bcache of the psymbol_bcache BCACHE*/
+/* Return the internal bcache of the psymbol_bcache BCACHE. */
struct bcache *
psymbol_bcache_get_bcache (struct psymbol_bcache *bcache)
entire field. */
memset (&psymbol.ginfo.value, 0, sizeof (psymbol.ginfo.value));
- /* val and coreaddr are mutually exclusive, one of them *will* be zero */
+ /* val and coreaddr are mutually exclusive, one of them *will* be zero. */
if (val != 0)
{
SYMBOL_VALUE (&psymbol) = val;
SYMBOL_SET_NAMES (&psymbol, name, namelength, copy_name, objfile);
- /* Stash the partial symbol away in the cache */
+ /* Stash the partial symbol away in the cache. */
return psymbol_bcache_full (&psymbol,
objfile->psymbol_cache,
added);
}
/* Increase the space allocated for LISTP, which is probably
- global_psymbols or static_psymbols. This space will eventually
+ global_psymbols or static_psymbols. This space will eventually
be freed in free_objfile(). */
static void
new_size * sizeof (struct partial_symbol *));
}
/* Next assumes we only went one over. Should be good if
- program works correctly */
+ program works correctly. */
listp->next = listp->list + listp->size;
listp->size = new_size;
}
int added;
- /* Stash the partial symbol away in the cache */
+ /* Stash the partial symbol away in the cache. */
psym = add_psymbol_to_bcache (name, namelength, copy_name, domain, class,
val, coreaddr, language, objfile, &added);
&& !added)
return psym;
- /* Save pointer to partial symbol in psymtab, growing symtab if needed. */
+ /* Save pointer to partial symbol in psymtab, growing symtab if needed. */
append_psymbol_to_list (list, psym, objfile);
return psym;
}
/* Current best guess is that approximately a twentieth
of the total symbols (in a debugging file) are global or static
- oriented symbols */
+ oriented symbols. */
objfile->global_psymbols.size = total_symbols / 10;
objfile->static_psymbols.size = total_symbols / 10;
/* Prepend it to the psymtab list for the objfile it belongs to.
Psymtabs are searched in most recent inserted -> least recent
- inserted order. */
+ inserted order. */
psymtab->objfile = objfile;
psymtab->next = objfile->psymtabs;
nothing else is not empty, but we don't realize that. Fixing
that without slowing things down might be tricky. */
- /* First, snip it out of the psymtab chain */
+ /* First, snip it out of the psymtab chain. */
prev_pst = &(pst->objfile->psymtabs);
while ((*prev_pst) != pst)
prev_pst = &((*prev_pst)->next);
(*prev_pst) = pst->next;
- /* Next, put it on a free list for recycling */
+ /* Next, put it on a free list for recycling. */
pst->next = pst->objfile->free_psymtabs;
pst->objfile->free_psymtabs = pst;
if (argv[0] != NULL)
{
filename = argv[0];
- /* If a second arg is supplied, it is a source file name to match on */
+ /* If a second arg is supplied, it is a source file name to match on. */
if (argv[1] != NULL)
{
symname = argv[1];