ccp->pst->add_psymbol (ename, true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::GLOBAL,
- 0, language_c, ccp->partial_symtabs, ccp->of);
+ unrelocated_addr (0),
+ language_c, ccp->partial_symtabs, ccp->of);
}
if (ctf_errno (ccp->fp) != ECTF_NEXT_END)
complaint (_("ctf_enum_next ctf_psymtab_add_enums failed - %s"),
pst->add_psymbol (tname, true,
tdomain, aclass, -1,
psymbol_placement::GLOBAL,
- 0, language_c, pst->context.partial_symtabs, of);
+ unrelocated_addr (0),
+ language_c, pst->context.partial_symtabs, of);
}
}
ccp->pst->add_psymbol (name, false,
domain, aclass, section,
psymbol_placement::STATIC,
- 0, language_c, ccp->partial_symtabs, ccp->of);
+ unrelocated_addr (0),
+ language_c, ccp->partial_symtabs, ccp->of);
return 0;
}
ccp->pst->add_psymbol (name, true,
VAR_DOMAIN, LOC_STATIC, -1,
psymbol_placement::GLOBAL,
- 0, language_c, ccp->partial_symtabs, ccp->of);
+ unrelocated_addr (0),
+ language_c, ccp->partial_symtabs, ccp->of);
return 0;
}
VAR_DOMAIN, LOC_STATIC,
data_sect_index,
psymbol_placement::STATIC,
- nlist.n_value, psymtab_language,
+ unrelocated_addr (nlist.n_value),
+ psymtab_language,
partial_symtabs, objfile);
else
complaint (_("static `%*s' appears to be defined "
VAR_DOMAIN, LOC_STATIC,
data_sect_index,
psymbol_placement::GLOBAL,
- nlist.n_value, psymtab_language,
+ unrelocated_addr (nlist.n_value),
+ psymtab_language,
partial_symtabs, objfile);
else
complaint (_("global `%*s' appears to be defined "
pst->add_psymbol (gdb::string_view (sym_name, sym_len),
true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
else
complaint (_("enum, struct, or union `%*s' appears "
pst->add_psymbol (gdb::string_view (sym_name, sym_len),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
else
complaint (_("typedef `%*s' appears to be defined "
pst->add_psymbol (gdb::string_view (sym_name, sym_len),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
else
complaint (_("typename `%*s' appears to be defined "
if (pst != nullptr)
pst->add_psymbol (gdb::string_view (p, q - p), true,
VAR_DOMAIN, LOC_CONST, -1,
- psymbol_placement::STATIC, 0,
+ psymbol_placement::STATIC,
+ unrelocated_addr (0),
psymtab_language,
partial_symtabs, objfile);
else
if (pst != nullptr)
pst->add_psymbol (gdb::string_view (sym_name, sym_len), true,
VAR_DOMAIN, LOC_CONST, -1,
- psymbol_placement::STATIC, 0,
+ psymbol_placement::STATIC,
+ unrelocated_addr (0),
psymtab_language,
partial_symtabs, objfile);
else
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
- nlist.n_value, psymtab_language,
+ unrelocated_addr (nlist.n_value),
+ psymtab_language,
partial_symtabs, objfile);
continue;
VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
- nlist.n_value, psymtab_language,
+ unrelocated_addr (nlist.n_value),
+ psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
- sh.value,
+ unrelocated_addr (sh.value),
psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
- sh.value,
+ unrelocated_addr (sh.value),
psymtab_language,
partial_symtabs, objfile);
continue;
pst->add_psymbol
(gdb::string_view (namestring, p - namestring),
true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::STATIC, 0, psymtab_language,
+ psymbol_placement::STATIC,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
if (p[2] == 't')
{
(gdb::string_view (namestring,
p - namestring),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::STATIC, 0,
+ psymbol_placement::STATIC,
+ unrelocated_addr (0),
psymtab_language,
partial_symtabs, objfile);
p += 1;
(gdb::string_view (namestring,
p - namestring),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
- psymbol_placement::STATIC, 0, psymtab_language,
+ psymbol_placement::STATIC,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
}
check_enum:
true, VAR_DOMAIN,
LOC_CONST, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
/* Point past the name. */
p = q;
p - namestring),
true, VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
- sh.value,
+ unrelocated_addr (sh.value),
psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
- sh.value,
+ unrelocated_addr (sh.value),
psymtab_language,
partial_symtabs, objfile);
continue;
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::GLOBAL,
- sh.value, psymtab_language,
+ unrelocated_addr (sh.value),
+ psymtab_language,
partial_symtabs, objfile);
else
pst->add_psymbol (sym_name, true,
VAR_DOMAIN, LOC_BLOCK,
section,
psymbol_placement::STATIC,
- sh.value, psymtab_language,
+ unrelocated_addr (sh.value),
+ psymtab_language,
partial_symtabs, objfile);
procaddr = unrelocated_addr (sh.value);
pst->add_psymbol (sym_name, true,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
}
handle_psymbol_enumerators (objfile, partial_symtabs,
pst->add_psymbol (sym_name, true,
VAR_DOMAIN, theclass, section,
psymbol_placement::STATIC,
- sh.value, psymtab_language,
+ unrelocated_addr (sh.value),
+ psymtab_language,
partial_symtabs, objfile);
skip:
cur_sdx++; /* Go to next file symbol. */
VAR_DOMAIN, theclass,
section,
psymbol_placement::GLOBAL,
- svalue, psymtab_language,
+ unrelocated_addr (svalue),
+ psymtab_language,
partial_symtabs, objfile);
}
}
in psymtabs, just in symtabs. */
pst->add_psymbol (name, true,
VAR_DOMAIN, LOC_CONST, -1,
- psymbol_placement::STATIC, 0,
+ psymbol_placement::STATIC,
+ unrelocated_addr (0),
psymtab_language, partial_symtabs, objfile);
ext_sym += external_sym_size;
}
}
/* Return the unrelocated address of this partial symbol. */
- CORE_ADDR unrelocated_address () const
+ unrelocated_addr unrelocated_address () const
{
- return ginfo.value_address ();
+ return ginfo.unrelocated_address ();
}
/* Return the address of this partial symbol, relocated according to
the offsets provided in OBJFILE. */
CORE_ADDR address (const struct objfile *objfile) const
{
- return (ginfo.value_address ()
+ return (CORE_ADDR (ginfo.unrelocated_address ())
+ objfile->section_offsets[ginfo.section_index ()]);
}
/* Set the address of this partial symbol. The address must be
unrelocated. */
- void set_unrelocated_address (CORE_ADDR addr)
+ void set_unrelocated_address (unrelocated_addr addr)
{
- ginfo.set_value_address (addr);
+ ginfo.set_unrelocated_address (addr);
}
/* Note that partial_symbol does not derive from general_symbol_info
enum address_class theclass,
short section,
psymbol_placement where,
- CORE_ADDR coreaddr,
+ unrelocated_addr coreaddr,
enum language language,
psymtab_storage *partial_symtabs,
struct objfile *objfile);
break;
}
gdb_puts (", ", outfile);
- gdb_puts (paddress (gdbarch, p->unrelocated_address ()), outfile);
+ gdb_puts (paddress (gdbarch, CORE_ADDR (p->unrelocated_address ())),
+ outfile);
gdb_printf (outfile, "\n");
}
}
enum address_class theclass,
short section,
psymbol_placement where,
- CORE_ADDR coreaddr,
+ unrelocated_addr coreaddr,
enum language language,
psymtab_storage *partial_symtabs,
struct objfile *objfile)
m_value.address = address;
}
+ /* Return the unrelocated address of this symbol. */
+ unrelocated_addr unrelocated_address () const
+ {
+ return m_value.unrel_addr;
+ }
+
+ /* Set the unrelocated address of this symbol. */
+ void set_unrelocated_address (unrelocated_addr addr)
+ {
+ m_value.unrel_addr = addr;
+ }
+
/* Name of the symbol. This is a required field. Storage for the
name is allocated on the objfile_obstack for the associated
objfile. For languages like C++ that make a distinction between
CORE_ADDR address;
+ /* The address, if unrelocated. An unrelocated symbol does not
+ have the runtime section offset applied. */
+ unrelocated_addr unrel_addr;
+
/* A common block. Used with LOC_COMMON_BLOCK. */
const struct common_block *common_block;
true, VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::STATIC,
- symbol.n_value,
+ unrelocated_addr (symbol.n_value),
psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_STATIC,
SECT_OFF_DATA (objfile),
psymbol_placement::GLOBAL,
- symbol.n_value,
+ unrelocated_addr (symbol.n_value),
psymtab_language,
partial_symtabs, objfile);
continue;
p - namestring),
true, STRUCT_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
if (p[2] == 't')
{
p - namestring),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
p += 1;
}
p - namestring),
true, VAR_DOMAIN, LOC_TYPEDEF, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
}
check_enum:
pst->add_psymbol (gdb::string_view (p, q - p), true,
VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
/* Point past the name. */
p = q;
p - namestring),
true, VAR_DOMAIN, LOC_CONST, -1,
psymbol_placement::STATIC,
- 0, psymtab_language,
+ unrelocated_addr (0),
+ psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::STATIC,
- symbol.n_value,
+ unrelocated_addr (symbol.n_value),
psymtab_language,
partial_symtabs, objfile);
continue;
true, VAR_DOMAIN, LOC_BLOCK,
SECT_OFF_TEXT (objfile),
psymbol_placement::GLOBAL,
- symbol.n_value,
+ unrelocated_addr (symbol.n_value),
psymtab_language,
partial_symtabs, objfile);
continue;