From: Tom Tromey Date: Mon, 20 Mar 2023 22:03:05 +0000 (-0600) Subject: Rename "raw" to "unrelocated" X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93d50cd8f0b59aed37a3a0e69155dd34d5a3c1f1;p=binutils-gdb.git Rename "raw" to "unrelocated" Per an earlier discussion, this patch renames the existing "raw" APIs to use the word "unrelocated" instead. --- diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c index 07cd216b4b2..fdd062f1b2e 100644 --- a/gdb/coff-pe-read.c +++ b/gdb/coff-pe-read.c @@ -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 (); diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 9df9320bc7b..f7c44c14ae2 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -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. */ diff --git a/gdb/findvar.c b/gdb/findvar.c index 97cc9ba7660..1b7aa22888c 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -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) diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 8faf482b09c..697ce0b5b1a 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -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; diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 67bd4903a3e..3fa07f47b9f 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -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; } diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index b86bf61f4d1..7092b266db3 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -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)); } } diff --git a/gdb/parse.c b/gdb/parse.c index 4bce63c58f7..c0c9fa0a448 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -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)) { diff --git a/gdb/printcmd.c b/gdb/printcmd.c index d4b3cce696f..dd92e31d31b 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -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), diff --git a/gdb/psympriv.h b/gdb/psympriv.h index 8f059dc5975..17c45e9220a 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -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; } diff --git a/gdb/psymtab.c b/gdb/psymtab.c index c74280761dd..64b67078641 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -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 ())) { diff --git a/gdb/solib.c b/gdb/solib.c index b6af8a15582..09bee497fd6 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -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. */ diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 2483d317f32..3d7fd560956 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -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 ()); diff --git a/gdb/symtab.c b/gdb/symtab.c index ac6535fe983..42e7f5cd908 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -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 ()]); } diff --git a/gdb/symtab.h b/gdb/symtab.h index 826489c9cbc..404d0ab30a8 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -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. */ diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 2a27bc3e804..d71127b40f6 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -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;