Rename "raw" to "unrelocated"

Per an earlier discussion, this patch renames the existing "raw" APIs
to use the word "unrelocated" instead.
This commit is contained in:
Tom Tromey 2023-03-20 16:03:05 -06:00
parent 9675da2535
commit 93d50cd8f0
15 changed files with 63 additions and 61 deletions

View file

@ -210,7 +210,7 @@ add_pe_forwarded_sym (minimal_symbol_reader &reader,
" \"%s\" in dll \"%s\", pointing to \"%s\"\n"),
sym_name, dll_name, forward_qualified_name.c_str ());
unrelocated_addr vma = msymbol.minsym->value_raw_address ();
unrelocated_addr vma = msymbol.minsym->unrelocated_address ();
msymtype = msymbol.minsym->type ();
section = msymbol.minsym->section_index ();

View file

@ -1131,13 +1131,13 @@ read_dbx_symtab (minimal_symbol_reader &reader,
if (past_first_source_file && pst
/* The gould NP1 uses low values for .o and -l symbols
which are not the address. */
&& unrel_val >= pst->raw_text_low ())
&& unrel_val >= pst->unrelocated_text_low ())
{
dbx_end_psymtab (objfile, partial_symtabs,
pst, psymtab_include_list,
includes_used, symnum * symbol_size,
unrel_val > pst->raw_text_high ()
? unrel_val : pst->raw_text_high (),
unrel_val > pst->unrelocated_text_high ()
? unrel_val : pst->unrelocated_text_high (),
dependency_list, dependencies_used,
textlow_not_set);
pst = (legacy_psymtab *) 0;
@ -1253,8 +1253,9 @@ read_dbx_symtab (minimal_symbol_reader &reader,
dbx_end_psymtab (objfile, partial_symtabs,
pst, psymtab_include_list,
includes_used, symnum * symbol_size,
(unrel_value > pst->raw_text_high ()
? unrel_value : pst->raw_text_high ()),
unrel_value > pst->unrelocated_text_high ()
? unrel_value
: pst->unrelocated_text_high (),
dependency_list, dependencies_used,
prev_textlow_not_set);
pst = (legacy_psymtab *) 0;
@ -1427,8 +1428,8 @@ read_dbx_symtab (minimal_symbol_reader &reader,
function relative stabs, or the address of the function's
end for old style stabs. */
valu = unrelocated_addr (nlist.n_value + last_function_start);
if (pst->raw_text_high () == unrelocated_addr (0)
|| valu > pst->raw_text_high ())
if (pst->unrelocated_text_high () == unrelocated_addr (0)
|| valu > pst->unrelocated_text_high ())
pst->set_text_high (valu);
break;
}
@ -1682,7 +1683,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
objfile);
if (minsym.minsym != NULL)
nlist.n_value
= CORE_ADDR (minsym.minsym->value_raw_address ());
= CORE_ADDR (minsym.minsym->unrelocated_address ());
}
if (pst && textlow_not_set
&& gdbarch_sofun_address_maybe_missing (gdbarch))
@ -1703,7 +1704,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
if (pst
&& (textlow_not_set
|| (unrelocated_addr (nlist.n_value)
< pst->raw_text_low ()
< pst->unrelocated_text_low ()
&& (nlist.n_value != 0))))
{
pst->set_text_low (unrelocated_addr (nlist.n_value));
@ -1741,7 +1742,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
objfile);
if (minsym.minsym != NULL)
nlist.n_value
= CORE_ADDR (minsym.minsym->value_raw_address ());
= CORE_ADDR (minsym.minsym->unrelocated_address ());
}
if (pst && textlow_not_set
&& gdbarch_sofun_address_maybe_missing (gdbarch))
@ -1762,7 +1763,7 @@ read_dbx_symtab (minimal_symbol_reader &reader,
if (pst
&& (textlow_not_set
|| (unrelocated_addr (nlist.n_value)
< pst->raw_text_low ()
< pst->unrelocated_text_low ()
&& (nlist.n_value != 0))))
{
pst->set_text_low (unrelocated_addr (nlist.n_value));
@ -1957,8 +1958,8 @@ read_dbx_symtab (minimal_symbol_reader &reader,
dbx_end_psymtab (objfile, partial_symtabs,
pst, psymtab_include_list, includes_used,
symnum * symbol_size,
(text_end > pst->raw_text_high ()
? text_end : pst->raw_text_high ()),
(text_end > pst->unrelocated_text_high ()
? text_end : pst->unrelocated_text_high ()),
dependency_list, dependencies_used, textlow_not_set);
}
}
@ -2058,7 +2059,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
if (minsym.minsym)
pst->set_text_high
(unrelocated_addr (CORE_ADDR (minsym.minsym->value_raw_address ())
(unrelocated_addr (CORE_ADDR (minsym.minsym->unrelocated_address ())
+ minsym.minsym->size ()));
last_function_name = NULL;
@ -2068,7 +2069,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
;
/* This test will be true if the last .o file is only data. */
else if (textlow_not_set)
pst->set_text_low (pst->raw_text_high ());
pst->set_text_low (pst->unrelocated_text_high ());
else
{
/* If we know our own starting text address, then walk through all other
@ -2078,7 +2079,7 @@ dbx_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs,
for (partial_symtab *p1 : partial_symtabs->range ())
if (!p1->text_high_valid && p1->text_low_valid && p1 != pst)
p1->set_text_high (pst->raw_text_low ());
p1->set_text_high (pst->unrelocated_text_low ());
}
/* End of kludge for patching Solaris textlow and texthigh. */

View file

@ -754,7 +754,7 @@ language_defn::read_var_value (struct symbol *var,
a TLS variable. */
if (obj_section == NULL
|| (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
addr = CORE_ADDR (bmsym.minsym->value_raw_address ());
addr = CORE_ADDR (bmsym.minsym->unrelocated_address ());
else
addr = bmsym.value_address ();
if (overlay_debugging)

View file

@ -2659,7 +2659,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
psymtab_language = prev_language;
PST_PRIVATE (pst)->pst_language = psymtab_language;
pst->set_text_high (pst->raw_text_low ());
pst->set_text_high (pst->unrelocated_text_low ());
/* For stabs-in-ecoff files, the second symbol must be @stab.
This symbol is emitted by mips-tfile to signal that the
@ -2726,9 +2726,9 @@ parse_partial_symbols (minimal_symbol_reader &reader,
/* Kludge for Irix 5.2 zero fh->adr. */
if (!relocatable
&& (!pst->text_low_valid
|| procaddr < pst->raw_text_low ()))
|| procaddr < pst->unrelocated_text_low ()))
pst->set_text_low (procaddr);
if (high > pst->raw_text_high ())
if (high > pst->unrelocated_text_high ())
pst->set_text_high (high);
}
}
@ -3319,7 +3319,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
{
unrelocated_addr unrel_value
= unrelocated_addr (sh.value);
if (unrel_value > save_pst->raw_text_high ())
if (unrel_value > save_pst->unrelocated_text_high ())
save_pst->set_text_high (unrel_value);
}
continue;
@ -3511,11 +3511,11 @@ parse_partial_symbols (minimal_symbol_reader &reader,
/* Kludge for Irix 5.2 zero fh->adr. */
if (!relocatable
&& (!pst->text_low_valid
|| procaddr < pst->raw_text_low ()))
|| procaddr < pst->unrelocated_text_low ()))
pst->set_text_low (procaddr);
high = unrelocated_addr (CORE_ADDR (procaddr) + sh.value);
if (high > pst->raw_text_high ())
if (high > pst->unrelocated_text_high ())
pst->set_text_high (high);
continue;
@ -3696,7 +3696,7 @@ parse_partial_symbols (minimal_symbol_reader &reader,
fdr_to_pst[f_idx].pst
= dbx_end_psymtab (objfile, partial_symtabs, save_pst,
psymtab_include_list, includes_used,
-1, save_pst->raw_text_high (),
-1, save_pst->unrelocated_text_high (),
dependency_list, dependencies_used,
textlow_not_set);
includes_used = 0;

View file

@ -796,14 +796,14 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
unrelocated_addr unrel_pc;
if (frob_address (objfile, pc, &unrel_pc)
&& unrel_pc >= msymbol[lo].value_raw_address ())
&& unrel_pc >= msymbol[lo].unrelocated_address ())
{
while (msymbol[hi].value_raw_address () > unrel_pc)
while (msymbol[hi].unrelocated_address () > unrel_pc)
{
/* pc is still strictly less than highest address. */
/* Note "new" will always be >= lo. */
newobj = (lo + hi) / 2;
if ((msymbol[newobj].value_raw_address () >= unrel_pc)
if ((msymbol[newobj].unrelocated_address () >= unrel_pc)
|| (lo == newobj))
{
hi = newobj;
@ -818,8 +818,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
hi to point to the last one. That way we can find the
right symbol if it has an index greater than hi. */
while (hi < objfile->per_bfd->minimal_symbol_count - 1
&& (msymbol[hi].value_raw_address ()
== msymbol[hi + 1].value_raw_address ()))
&& (msymbol[hi].unrelocated_address ()
== msymbol[hi + 1].unrelocated_address ()))
hi++;
/* Skip various undesirable symbols. */
@ -866,8 +866,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
&& msymbol[hi].type () != want_type
&& msymbol[hi - 1].type () == want_type
&& (msymbol[hi].size () == msymbol[hi - 1].size ())
&& (msymbol[hi].value_raw_address ()
== msymbol[hi - 1].value_raw_address ())
&& (msymbol[hi].unrelocated_address ()
== msymbol[hi - 1].unrelocated_address ())
&& (msymbol[hi].obj_section (objfile)
== msymbol[hi - 1].obj_section (objfile)))
{
@ -896,8 +896,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
the cancellable variants, but both have sizes. */
if (hi > 0
&& msymbol[hi].size () != 0
&& unrel_pc >= msymbol[hi].value_raw_end_address ()
&& unrel_pc < msymbol[hi - 1].value_raw_end_address ())
&& unrel_pc >= msymbol[hi].unrelocated_end_address ()
&& unrel_pc < msymbol[hi - 1].unrelocated_end_address ())
{
hi--;
continue;
@ -926,7 +926,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
if (hi >= 0
&& msymbol[hi].size () != 0
&& unrel_pc >= msymbol[hi].value_raw_end_address ())
&& unrel_pc >= msymbol[hi].unrelocated_end_address ())
{
if (best_zero_sized != -1)
hi = best_zero_sized;
@ -937,8 +937,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
if (previous != nullptr)
{
if (previous->minsym == nullptr
|| (msymbol[hi].value_raw_address ()
> previous->minsym->value_raw_address ()))
|| (msymbol[hi].unrelocated_address ()
> previous->minsym->unrelocated_address ()))
{
previous->minsym = &msymbol[hi];
previous->objfile = objfile;
@ -955,8 +955,8 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio
if (hi >= 0
&& ((best_symbol == NULL) ||
(best_symbol->value_raw_address () <
msymbol[hi].value_raw_address ())))
(best_symbol->unrelocated_address () <
msymbol[hi].unrelocated_address ())))
{
best_symbol = &msymbol[hi];
best_objfile = objfile;
@ -1222,11 +1222,11 @@ static inline bool
minimal_symbol_is_less_than (const minimal_symbol &fn1,
const minimal_symbol &fn2)
{
if ((&fn1)->value_raw_address () < (&fn2)->value_raw_address ())
if ((&fn1)->unrelocated_address () < (&fn2)->unrelocated_address ())
{
return true; /* addr 1 is less than addr 2. */
}
else if ((&fn1)->value_raw_address () > (&fn2)->value_raw_address ())
else if ((&fn1)->unrelocated_address () > (&fn2)->unrelocated_address ())
{
return false; /* addr 1 is greater than addr 2. */
}
@ -1286,8 +1286,8 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
copyfrom = copyto = msymbol;
while (copyfrom < msymbol + mcount - 1)
{
if (copyfrom->value_raw_address ()
== (copyfrom + 1)->value_raw_address ()
if (copyfrom->unrelocated_address ()
== (copyfrom + 1)->unrelocated_address ()
&& (copyfrom->section_index ()
== (copyfrom + 1)->section_index ())
&& strcmp (copyfrom->linkage_name (),
@ -1593,8 +1593,8 @@ minimal_symbol_upper_bound (struct bound_minimal_symbol minsym)
section = msymbol->section_index ();
for (iter = msymbol + 1; iter != past_the_end; ++iter)
{
if ((iter->value_raw_address ()
!= msymbol->value_raw_address ())
if ((iter->unrelocated_address ()
!= msymbol->unrelocated_address ())
&& iter->section_index () == section)
break;
}

View file

@ -436,13 +436,13 @@ mips_elf_make_msymbol_special (asymbol * sym, struct minimal_symbol *msym)
if (ELF_ST_IS_MICROMIPS (st_other))
{
SET_MSYMBOL_TARGET_FLAG_MICROMIPS (msym);
CORE_ADDR fixed = CORE_ADDR (msym->value_raw_address ()) | 1;
CORE_ADDR fixed = CORE_ADDR (msym->unrelocated_address ()) | 1;
msym->set_unrelocated_address (unrelocated_addr (fixed));
}
else if (ELF_ST_IS_MIPS16 (st_other))
{
SET_MSYMBOL_TARGET_FLAG_MIPS16 (msym);
CORE_ADDR fixed = CORE_ADDR (msym->value_raw_address ()) | 1;
CORE_ADDR fixed = CORE_ADDR (msym->unrelocated_address ()) | 1;
msym->set_unrelocated_address (unrelocated_addr (fixed));
}
}

View file

@ -115,7 +115,7 @@ find_minsym_type_and_address (minimal_symbol *msymbol,
{
/* Addresses of TLS symbols are really offsets into a
per-objfile/per-thread storage block. */
addr = CORE_ADDR (bound_msym.minsym->value_raw_address ());
addr = CORE_ADDR (bound_msym.minsym->unrelocated_address ());
}
else if (msymbol_is_function (objfile, msymbol, &addr))
{

View file

@ -1824,7 +1824,7 @@ info_address_command (const char *exp, int from_tty)
if (section
&& (section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
{
load_addr = CORE_ADDR (msym.minsym->value_raw_address ());
load_addr = CORE_ADDR (msym.minsym->unrelocated_address ());
gdb_printf (_("a thread-local variable at offset %s "
"in the thread-local storage for `%s'"),
paddress (gdbarch, load_addr),

View file

@ -173,14 +173,14 @@ struct partial_symtab
/* Return the unrelocated low text address of this
partial_symtab. */
unrelocated_addr raw_text_low () const
unrelocated_addr unrelocated_text_low () const
{
return m_text_low;
}
/* Return the unrelocated_addr high text address of this
partial_symtab. */
unrelocated_addr raw_text_high () const
unrelocated_addr unrelocated_text_high () const
{
return m_text_high;
}

View file

@ -1115,7 +1115,7 @@ partial_symtab::partial_symtab (const char *filename,
: partial_symtab (filename, partial_symtabs, objfile_per_bfd)
{
set_text_low (textlow);
set_text_high (raw_text_low ()); /* default */
set_text_high (unrelocated_text_low ()); /* default */
}
/* Perform "finishing up" operations of a partial symtab. */
@ -1654,7 +1654,7 @@ maintenance_check_psymtabs (const char *ignore, int from_tty)
gdb_printf (" psymtab\n");
}
}
if (ps->raw_text_high () != unrelocated_addr (0)
if (ps->unrelocated_text_high () != unrelocated_addr (0)
&& (ps->text_low (objfile) < b->start ()
|| ps->text_high (objfile) > b->end ()))
{

View file

@ -1515,7 +1515,7 @@ gdb_bfd_lookup_symbol_from_symtab
msym.set_value_address (symaddr);
gdbarch_elf_make_msymbol_special (gdbarch, sym, &msym);
symaddr = CORE_ADDR (msym.value_raw_address ());
symaddr = CORE_ADDR (msym.unrelocated_address ());
}
/* BFD symbols are section relative. */

View file

@ -201,7 +201,7 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile)
/* Use the relocated address as shown in the symbol here -- do
not try to respect copy relocations. */
CORE_ADDR addr = (CORE_ADDR (msymbol->value_raw_address ())
CORE_ADDR addr = (CORE_ADDR (msymbol->unrelocated_address ())
+ objfile->section_offsets[msymbol->section_index ()]);
gdb_puts (paddress (gdbarch, addr), outfile);
gdb_printf (outfile, " %s", msymbol->linkage_name ());

View file

@ -424,7 +424,7 @@ minimal_symbol::value_address (objfile *objfile) const
if (this->maybe_copied)
return get_msymbol_address (objfile, this);
else
return (CORE_ADDR (this->value_raw_address ())
return (CORE_ADDR (this->unrelocated_address ())
+ objfile->section_offsets[this->section_index ()]);
}

View file

@ -759,16 +759,16 @@ struct minimal_symbol : public general_symbol_info
CORE_ADDR value_address () const = delete;
/* The unrelocated address of the minimal symbol. */
unrelocated_addr value_raw_address () const
unrelocated_addr unrelocated_address () const
{
return m_value.unrel_addr;
}
/* The unrelocated address just after the end of the the minimal
symbol. */
unrelocated_addr value_raw_end_address () const
unrelocated_addr unrelocated_end_address () const
{
return unrelocated_addr (CORE_ADDR (value_raw_address ()) + size ());
return unrelocated_addr (CORE_ADDR (unrelocated_address ()) + size ());
}
/* Return this minimal symbol's type. */

View file

@ -2177,11 +2177,12 @@ scan_xcoff_symtab (minimal_symbol_reader &reader,
= unrelocated_addr (symbol.n_value
+ CSECT_LEN (&csect_aux));
if (highval > pst->raw_text_high ())
if (highval > pst->unrelocated_text_high ())
pst->set_text_high (highval);
unrelocated_addr loval
= unrelocated_addr (symbol.n_value);
if (!pst->text_low_valid || loval < pst->raw_text_low ())
if (!pst->text_low_valid
|| loval < pst->unrelocated_text_low ())
pst->set_text_low (loval);
}
misc_func_recorded = 0;