#include <set>
#include "gdbsupport/buildargv.h"
-static struct partial_symbol *lookup_partial_symbol (struct objfile *,
- struct partial_symtab *,
- const lookup_name_info &,
- int,
- domain_search_flags);
+static const struct partial_symbol *lookup_partial_symbol
+ (struct objfile *, struct partial_symtab *, const lookup_name_info &,
+ int, domain_search_flags);
static const char *psymtab_to_fullname (struct partial_symtab *ps);
-static struct partial_symbol *find_pc_sect_psymbol (struct objfile *,
- struct partial_symtab *,
- CORE_ADDR,
- struct obj_section *);
+static const struct partial_symbol *find_pc_sect_psymbol
+ (struct objfile *, struct partial_symtab *, CORE_ADDR,
+ struct obj_section *);
static struct compunit_symtab *psymtab_to_symtab (struct objfile *objfile,
struct partial_symtab *pst);
{
if (pc >= tpst->text_low (objfile) && pc < tpst->text_high (objfile))
{
- struct partial_symbol *p;
+ const struct partial_symbol *p;
CORE_ADDR this_addr;
/* NOTE: This assumes that every psymbol has a
/* Find which partial symbol within a psymtab matches PC and SECTION.
Return NULL if none. */
-static struct partial_symbol *
+static const struct partial_symbol *
find_pc_sect_psymbol (struct objfile *objfile,
struct partial_symtab *psymtab, CORE_ADDR pc,
struct obj_section *section)
{
- struct partial_symbol *best = NULL;
+ const struct partial_symbol *best = NULL;
CORE_ADDR best_pc;
const CORE_ADDR textlow = psymtab->text_low (objfile);
/* Search the global symbols as well as the static symbols, so that
find_pc_partial_function doesn't use a minimal symbol and thus
cache a bad endaddr. */
- for (partial_symbol *p : psymtab->global_psymbols)
+ for (const partial_symbol *p : psymtab->global_psymbols)
{
if (p->domain == VAR_DOMAIN
&& p->aclass == LOC_BLOCK
}
}
- for (partial_symbol *p : psymtab->static_psymbols)
+ for (const partial_symbol *p : psymtab->static_psymbols)
{
if (p->domain == VAR_DOMAIN
&& p->aclass == LOC_BLOCK
for (partial_symtab *ps : partial_symbols (objfile))
{
- struct partial_symbol *psym;
+ const struct partial_symbol *psym;
if (ps->readin_p (objfile))
continue;
/* Returns true if PSYM matches LOOKUP_NAME. */
static bool
-psymbol_name_matches (partial_symbol *psym,
+psymbol_name_matches (const partial_symbol *psym,
const lookup_name_info &lookup_name)
{
const language_defn *lang = language_def (psym->ginfo.language ());
LOOKUP_NAME. Check the global symbols if GLOBAL, the static
symbols if not. */
-static struct partial_symbol *
+static const struct partial_symbol *
lookup_partial_symbol (struct objfile *objfile,
struct partial_symtab *pst,
const lookup_name_info &lookup_name,
int global, domain_search_flags domain)
{
- struct partial_symbol **start, **psym;
- struct partial_symbol **top, **real_top, **bottom, **center;
+ const struct partial_symbol **start, **psym;
+ const struct partial_symbol **top, **real_top, **bottom, **center;
int length = (global
? pst->global_psymbols.size ()
: pst->static_psymbols.size ());
static void
print_partial_symbols (struct gdbarch *gdbarch, struct objfile *objfile,
- const std::vector<partial_symbol *> &symbols,
+ const std::vector<const partial_symbol *> &symbols,
const char *what, struct ui_file *outfile)
{
gdb_printf (outfile, " %s partial symbols:\n", what);
- for (partial_symbol *p : symbols)
+ for (const partial_symbol *p : symbols)
{
QUIT;
gdb_printf (outfile, " `%s'", p->ginfo.linkage_name ());
}
}
- partial_symbol **gbound = (ps->global_psymbols.data ()
- + ps->global_psymbols.size ());
- partial_symbol **sbound = (ps->static_psymbols.data ()
- + ps->static_psymbols.size ());
- partial_symbol **bound = gbound;
+ const partial_symbol **gbound = (ps->global_psymbols.data ()
+ + ps->global_psymbols.size ());
+ const partial_symbol **sbound = (ps->static_psymbols.data ()
+ + ps->static_psymbols.size ());
+ const partial_symbol **bound = gbound;
/* Go through all of the symbols stored in a partial
symtab in one loop. */
- partial_symbol **psym = ps->global_psymbols.data ();
+ const partial_symbol **psym = ps->global_psymbols.data ();
if ((search_flags & SEARCH_GLOBAL_BLOCK) == 0)
{
/* Sort the global list; don't sort the static list. */
std::sort (global_psymbols.begin (),
global_psymbols.end (),
- [] (partial_symbol *s1, partial_symbol *s2)
+ [] (const partial_symbol *s1, const partial_symbol *s2)
{
return strcmp_iw_ordered (s1->ginfo.search_name (),
s2->ginfo.search_name ()) < 0;
return;
/* Save pointer to partial symbol in psymtab, growing symtab if needed. */
- std::vector<partial_symbol *> &list
+ std::vector<const partial_symbol *> &list
= (where == psymbol_placement::STATIC
? static_psymbols
: global_psymbols);
continue;
bv = cust->blockvector ();
b = bv->static_block ();
- for (partial_symbol *psym : ps->static_psymbols)
+ for (const partial_symbol *psym : ps->static_psymbols)
{
/* Skip symbols for inlined functions without address. These may
or may not have a match in the full symtab. */
}
}
b = bv->global_block ();
- for (partial_symbol *psym : ps->global_psymbols)
+ for (const partial_symbol *psym : ps->global_psymbols)
{
lookup_name_info lookup_name
(psym->ginfo.search_name (), symbol_name_match_type::SEARCH_NAME);