ctf_psymtab (const char *filename,
psymtab_storage *partial_symtabs,
objfile_per_bfd_storage *objfile_per_bfd,
- CORE_ADDR addr)
+ unrelocated_addr addr)
: standard_psymtab (filename, partial_symtabs, objfile_per_bfd, addr)
{
}
add_stt_entries (ccp, 1);
}
-/* Get text segment base for OBJFILE, TSIZE contains the segment size. */
+/* Get text section base for OBJFILE, TSIZE contains the size. */
static CORE_ADDR
-get_objfile_text_range (struct objfile *of, int *tsize)
+get_objfile_text_range (struct objfile *of, size_t *tsize)
{
bfd *abfd = of->obfd.get ();
const asection *codes;
/* Start a symtab. */
CORE_ADDR offset; /* Start of text segment. */
- int tsize;
+ size_t tsize;
offset = get_objfile_text_range (objfile, &tsize);
ctf_start_compunit_symtab (this, objfile, offset);
expand_psymtab (objfile);
- set_text_low (offset);
- set_text_high (offset + tsize);
+ set_text_low (unrelocated_addr (0));
+ set_text_high (unrelocated_addr (tsize));
compunit_symtab = ctf_end_compunit_symtab (this, offset + tsize);
/* Finish up the debug error message. */
{
ctf_psymtab *pst;
- pst = new ctf_psymtab (name, partial_symtabs, objfile->per_bfd, 0);
+ pst = new ctf_psymtab (name, partial_symtabs, objfile->per_bfd,
+ unrelocated_addr (0));
pst->context.arc = arc;
pst->context.fp = cfp;
static void add_this_object_header_file (int);
static legacy_psymtab *start_psymtab (psymtab_storage *, struct objfile *,
- const char *, CORE_ADDR, int);
+ const char *, unrelocated_addr, int);
/* Free up old header file tables. */
|| (namestring[(nsl = strlen (namestring)) - 1] == 'o'
&& namestring[nsl - 2] == '.'))
{
+ unrelocated_addr unrel_val = unrelocated_addr (nlist.n_value);
+
if (past_first_source_file && pst
/* The gould NP1 uses low values for .o and -l symbols
which are not the address. */
- && nlist.n_value >= pst->raw_text_low ())
+ && unrel_val >= pst->raw_text_low ())
{
dbx_end_psymtab (objfile, partial_symtabs,
pst, psymtab_include_list,
includes_used, symnum * symbol_size,
- nlist.n_value > pst->raw_text_high ()
- ? nlist.n_value : pst->raw_text_high (),
+ unrel_val > pst->raw_text_high ()
+ ? unrel_val : pst->raw_text_high (),
dependency_list, dependencies_used,
textlow_not_set);
pst = (legacy_psymtab *) 0;
if (pst)
{
+ unrelocated_addr unrel_value = unrelocated_addr (valu);
dbx_end_psymtab (objfile, partial_symtabs,
pst, psymtab_include_list,
includes_used, symnum * symbol_size,
- (valu > pst->raw_text_high ()
- ? valu : pst->raw_text_high ()),
+ (unrel_value > pst->raw_text_high ()
+ ? unrel_value : pst->raw_text_high ()),
dependency_list, dependencies_used,
prev_textlow_not_set);
pst = (legacy_psymtab *) 0;
if (!pst)
{
pst = start_psymtab (partial_symtabs, objfile,
- namestring, valu,
+ namestring,
+ unrelocated_addr (valu),
first_so_symnum * symbol_size);
pst->dirname = dirname_nso;
dirname_nso = NULL;
/* See if this is an end of function stab. */
if (pst && nlist.n_type == N_FUN && *namestring == '\000')
{
- CORE_ADDR valu;
+ unrelocated_addr valu;
/* It's value is the size (in bytes) of the function for
function relative stabs, or the address of the function's
end for old style stabs. */
- valu = nlist.n_value + last_function_start;
- if (pst->raw_text_high () == 0 || valu > pst->raw_text_high ())
+ valu = unrelocated_addr (nlist.n_value + last_function_start);
+ if (pst->raw_text_high () == unrelocated_addr (0)
+ || valu > pst->raw_text_high ())
pst->set_text_high (valu);
break;
}
if (pst && textlow_not_set
&& gdbarch_sofun_address_maybe_missing (gdbarch))
{
- pst->set_text_low (nlist.n_value);
+ pst->set_text_low (unrelocated_addr (nlist.n_value));
textlow_not_set = 0;
}
/* End kludge. */
the partial symbol table. */
if (pst
&& (textlow_not_set
- || (nlist.n_value < pst->raw_text_low ()
+ || (unrelocated_addr (nlist.n_value)
+ < pst->raw_text_low ()
&& (nlist.n_value != 0))))
{
- pst->set_text_low (nlist.n_value);
+ pst->set_text_low (unrelocated_addr (nlist.n_value));
textlow_not_set = 0;
}
if (pst != nullptr)
if (pst && textlow_not_set
&& gdbarch_sofun_address_maybe_missing (gdbarch))
{
- pst->set_text_low (nlist.n_value);
+ pst->set_text_low (unrelocated_addr (nlist.n_value));
textlow_not_set = 0;
}
/* End kludge. */
the partial symbol table. */
if (pst
&& (textlow_not_set
- || (nlist.n_value < pst->raw_text_low ()
+ || (unrelocated_addr (nlist.n_value)
+ < pst->raw_text_low ()
&& (nlist.n_value != 0))))
{
- pst->set_text_low (nlist.n_value);
+ pst->set_text_low (unrelocated_addr (nlist.n_value));
textlow_not_set = 0;
}
if (pst != nullptr)
dbx_end_psymtab (objfile, partial_symtabs, pst,
psymtab_include_list, includes_used,
symnum * symbol_size,
- (CORE_ADDR) 0, dependency_list,
+ (unrelocated_addr) 0, dependency_list,
dependencies_used, textlow_not_set);
pst = (legacy_psymtab *) 0;
includes_used = 0;
{
/* Don't set high text address of PST lower than it already
is. */
- CORE_ADDR text_end =
- (lowest_text_address == (CORE_ADDR) -1
- ? text_addr
- : lowest_text_address)
- + text_size;
+ unrelocated_addr text_end
+ = unrelocated_addr ((lowest_text_address == (CORE_ADDR) -1
+ ? text_addr
+ : lowest_text_address)
+ + text_size);
dbx_end_psymtab (objfile, partial_symtabs,
pst, psymtab_include_list, includes_used,
static legacy_psymtab *
start_psymtab (psymtab_storage *partial_symtabs, struct objfile *objfile,
- const char *filename, CORE_ADDR textlow, int ldsymoff)
+ const char *filename, unrelocated_addr textlow, int ldsymoff)
{
legacy_psymtab *result = new legacy_psymtab (filename, partial_symtabs,
objfile->per_bfd, textlow);
dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
legacy_psymtab *pst,
const char **include_list, int num_includes,
- int capping_symbol_offset, CORE_ADDR capping_text,
+ int capping_symbol_offset, unrelocated_addr capping_text,
legacy_psymtab **dependency_list,
int number_dependencies,
int textlow_not_set)
}
if (minsym.minsym)
- pst->set_text_high (minsym.minsym->value_raw_address ()
- + minsym.minsym->size ());
+ pst->set_text_high
+ (unrelocated_addr (minsym.minsym->value_raw_address ()
+ + minsym.minsym->size ()));
last_function_name = NULL;
}
{
legacy_psymtab *save_pst;
EXTR *ext_ptr;
- CORE_ADDR textlow;
+ unrelocated_addr textlow;
cur_fdr = fh = debug_info->fdr + f_idx;
/* Determine the start address for this object file from the
file header and relocate it, except for Irix 5.2 zero fh->adr. */
if (fh->cpd)
- textlow = fh->adr;
+ textlow = unrelocated_addr (fh->adr);
else
- textlow = 0;
+ textlow = unrelocated_addr (0);
pst = new legacy_psymtab (fdr_name (fh), partial_symtabs,
objfile->per_bfd, textlow);
pst->read_symtab_private = XOBNEW (&objfile->objfile_obstack, md_symloc);
{
if (sh.st == stProc || sh.st == stStaticProc)
{
- CORE_ADDR procaddr;
+ unrelocated_addr procaddr;
long isym;
if (sh.st == stStaticProc)
mst_file_text, sh.sc,
objfile);
}
- procaddr = sh.value;
+ procaddr = unrelocated_addr (sh.value);
isym = AUX_GET_ISYM (fh->fBigendian,
(debug_info->external_aux
&sh);
if (sh.st == stEnd)
{
- CORE_ADDR high = procaddr + sh.value;
+ unrelocated_addr high
+ = unrelocated_addr (CORE_ADDR (procaddr)
+ + sh.value);
/* Kludge for Irix 5.2 zero fh->adr. */
if (!relocatable
continue;
case N_RBRAC:
- if (sh.value > save_pst->raw_text_high ())
- save_pst->set_text_high (sh.value);
+ {
+ unrelocated_addr unrel_value
+ = unrelocated_addr (sh.value);
+ if (unrel_value > save_pst->raw_text_high ())
+ save_pst->set_text_high (unrel_value);
+ }
continue;
case N_EINCL:
case N_DSLINE:
switch (sh.st)
{
- CORE_ADDR high;
- CORE_ADDR procaddr;
+ unrelocated_addr high;
+ unrelocated_addr procaddr;
int new_sdx;
case stStaticProc:
sh.value, psymtab_language,
partial_symtabs, objfile);
- procaddr = sh.value;
+ procaddr = unrelocated_addr (sh.value);
cur_sdx = new_sdx;
(*swap_sym_in) (cur_bfd,
|| procaddr < pst->raw_text_low ()))
pst->set_text_low (procaddr);
- high = procaddr + sh.value;
+ high = unrelocated_addr (CORE_ADDR (procaddr) + sh.value);
if (high > pst->raw_text_high ())
pst->set_text_high (high);
continue;
if (! last_symtab_ended)
{
- cust = end_compunit_symtab (pst->raw_text_high ());
+ cust = end_compunit_symtab (pst->text_high (objfile));
end_stabs ();
}
partial_symtab (const char *filename,
psymtab_storage *partial_symtabs,
objfile_per_bfd_storage *objfile_per_bfd,
- CORE_ADDR addr)
+ unrelocated_addr addr)
ATTRIBUTE_NONNULL (2) ATTRIBUTE_NONNULL (3);
virtual ~partial_symtab ()
virtual struct compunit_symtab *get_compunit_symtab
(struct objfile *) const = 0;
- /* Return the raw low text address of this partial_symtab. */
- CORE_ADDR raw_text_low () const
+ /* Return the unrelocated low text address of this
+ partial_symtab. */
+ unrelocated_addr raw_text_low () const
{
return m_text_low;
}
- /* Return the raw high text address of this partial_symtab. */
- CORE_ADDR raw_text_high () const
+ /* Return the unrelocated_addr high text address of this
+ partial_symtab. */
+ unrelocated_addr raw_text_high () const
{
return m_text_high;
}
/* Return the relocated low text address of this partial_symtab. */
CORE_ADDR text_low (struct objfile *objfile) const
{
- return m_text_low + objfile->text_section_offset ();
+ return CORE_ADDR (m_text_low) + objfile->text_section_offset ();
}
/* Return the relocated high text address of this partial_symtab. */
CORE_ADDR text_high (struct objfile *objfile) const
{
- return m_text_high + objfile->text_section_offset ();
+ return CORE_ADDR (m_text_high) + objfile->text_section_offset ();
}
/* Set the low text address of this partial_symtab. */
- void set_text_low (CORE_ADDR addr)
+ void set_text_low (unrelocated_addr addr)
{
m_text_low = addr;
text_low_valid = 1;
}
- /* Set the hight text address of this partial_symtab. */
- void set_text_high (CORE_ADDR addr)
+ /* Set the high text address of this partial_symtab. */
+ void set_text_high (unrelocated_addr addr)
{
m_text_high = addr;
text_high_valid = 1;
fields; these are located later in this structure for better
packing. */
- CORE_ADDR m_text_low = 0;
- CORE_ADDR m_text_high = 0;
+ unrelocated_addr m_text_low {};
+ unrelocated_addr m_text_high {};
/* If NULL, this is an ordinary partial symbol table.
standard_psymtab (const char *filename,
psymtab_storage *partial_symtabs,
objfile_per_bfd_storage *objfile_per_bfd,
- CORE_ADDR addr)
+ unrelocated_addr addr)
: partial_symtab (filename, partial_symtabs, objfile_per_bfd, addr)
{
}
legacy_psymtab (const char *filename,
psymtab_storage *partial_symtabs,
objfile_per_bfd_storage *objfile_per_bfd,
- CORE_ADDR addr)
+ unrelocated_addr addr)
: standard_psymtab (filename, partial_symtabs, objfile_per_bfd, addr)
{
}
partial_symtab::partial_symtab (const char *filename,
psymtab_storage *partial_symtabs,
objfile_per_bfd_storage *objfile_per_bfd,
- CORE_ADDR textlow)
+ unrelocated_addr textlow)
: partial_symtab (filename, partial_symtabs, objfile_per_bfd)
{
set_text_low (textlow);
gdb_printf (" psymtab\n");
}
}
- if (ps->raw_text_high () != 0
+ if (ps->raw_text_high () != unrelocated_addr (0)
&& (ps->text_low (objfile) < b->start ()
|| ps->text_high (objfile) > b->end ()))
{
(struct objfile *objfile, psymtab_storage *partial_symtabs,
legacy_psymtab *pst,
const char **include_list, int num_includes,
- int capping_symbol_offset, CORE_ADDR capping_text,
+ int capping_symbol_offset, unrelocated_addr capping_text,
legacy_psymtab **dependency_list, int number_dependencies,
int textlow_not_set);
{
/* We fill in textlow later. */
legacy_psymtab *result = new legacy_psymtab (filename, partial_symtabs,
- objfile->per_bfd, 0);
+ objfile->per_bfd,
+ unrelocated_addr (0));
result->read_symtab_private =
XOBNEW (&objfile->objfile_obstack, struct xcoff_symloc);
}
if (pst != NULL)
{
- CORE_ADDR highval =
- symbol.n_value + CSECT_LEN (&csect_aux);
+ unrelocated_addr highval
+ = unrelocated_addr (symbol.n_value
+ + CSECT_LEN (&csect_aux));
if (highval > pst->raw_text_high ())
pst->set_text_high (highval);
- if (!pst->text_low_valid
- || symbol.n_value < pst->raw_text_low ())
- pst->set_text_low (symbol.n_value);
+ unrelocated_addr loval
+ = unrelocated_addr (symbol.n_value);
+ if (!pst->text_low_valid || loval < pst->raw_text_low ())
+ pst->set_text_low (loval);
}
misc_func_recorded = 0;
break;