Use "unrelocated" terminology in linetable_entry

I forgot to convert struct linetable_entry to use the "unrelocated"
(as opposed to "raw") terminology.  This patch corrects the oversight.
This commit is contained in:
Tom Tromey
2023-04-21 09:36:54 -06:00
parent d8175bcb7e
commit 0434c3ef8d
9 changed files with 29 additions and 22 deletions

View File

@@ -653,7 +653,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
linetable_entry *last = &subfile->line_vector_entries.back ();
last_line = last->line;
if (last->raw_pc () != pc)
if (last->unrelocated_pc () != pc)
break;
subfile->line_vector_entries.pop_back ();
@@ -668,7 +668,7 @@ buildsym_compunit::record_line (struct subfile *subfile, int line,
linetable_entry &e = subfile->line_vector_entries.back ();
e.line = line;
e.is_stmt = (flags & LEF_IS_STMT) != 0;
e.set_raw_pc (pc);
e.set_unrelocated_pc (pc);
e.prologue_end = (flags & LEF_PROLOGUE_END) != 0;
}

View File

@@ -606,11 +606,11 @@ do_mixed_source_and_assembly_deprecated
/* First, skip all the preceding functions. */
for (i = 0; i < nlines - 1 && le[i].raw_pc () < unrel_low; i++);
for (i = 0; i < nlines - 1 && le[i].unrelocated_pc () < unrel_low; i++);
/* Now, copy all entries before the end of this function. */
for (; i < nlines - 1 && le[i].raw_pc () < unrel_high; i++)
for (; i < nlines - 1 && le[i].unrelocated_pc () < unrel_high; i++)
{
if (le[i] == le[i + 1])
continue; /* Ignore duplicates. */
@@ -630,7 +630,7 @@ do_mixed_source_and_assembly_deprecated
/* If we're on the last line, and it's part of the function,
then we need to get the end pc in a special way. */
if (i == nlines - 1 && le[i].raw_pc () < unrel_high)
if (i == nlines - 1 && le[i].unrelocated_pc () < unrel_high)
{
mle[newlines].line = le[i].line;
mle[newlines].start_pc = le[i].pc (objfile);
@@ -761,10 +761,10 @@ do_mixed_source_and_assembly (struct gdbarch *gdbarch,
first_le = NULL;
/* Skip all the preceding functions. */
for (i = 0; i < nlines && le[i].raw_pc () < unrel_low; i++)
for (i = 0; i < nlines && le[i].unrelocated_pc () < unrel_low; i++)
continue;
if (i < nlines && le[i].raw_pc () < unrel_high)
if (i < nlines && le[i].unrelocated_pc () < unrel_high)
first_le = &le[i];
/* Add lines for every pc value. */

View File

@@ -491,7 +491,8 @@ jit_symtab_line_mapping_add_impl (struct gdb_symbol_callbacks *cb,
stab->linetable->nitems = nlines;
for (i = 0; i < nlines; i++)
{
stab->linetable->item[i].set_raw_pc (unrelocated_addr (map[i].pc));
stab->linetable->item[i].set_unrelocated_pc
(unrelocated_addr (map[i].pc));
stab->linetable->item[i].line = map[i].line;
stab->linetable->item[i].is_stmt = true;
}

View File

@@ -4546,7 +4546,7 @@ add_line (struct linetable *lt, int lineno, CORE_ADDR adr, int last)
return lineno;
lt->item[lt->nitems].line = lineno;
lt->item[lt->nitems++].set_raw_pc (unrelocated_addr (adr << 2));
lt->item[lt->nitems++].set_unrelocated_pc (unrelocated_addr (adr << 2));
return lineno;
}

View File

@@ -739,7 +739,7 @@ btrace_find_line_range (CORE_ADDR pc)
possibly adding more line numbers to the range. At the time this
change was made I was unsure how to test this so chose to go with
maintaining the existing experience. */
if (lines[i].raw_pc () == unrel_pc && lines[i].line != 0
if (lines[i].unrelocated_pc () == unrel_pc && lines[i].line != 0
&& lines[i].is_stmt)
range = btrace_line_range_add (range, lines[i].line);
}

View File

@@ -996,7 +996,7 @@ maintenance_print_one_line_table (struct symtab *symtab, void *data)
uiout->field_core_addr ("rel-address", objfile->arch (),
item->pc (objfile));
uiout->field_core_addr ("unrel-address", objfile->arch (),
CORE_ADDR (item->raw_pc ()));
CORE_ADDR (item->unrelocated_pc ()));
uiout->field_string ("is-stmt", item->is_stmt ? "Y" : "");
uiout->field_string ("prologue-end", item->prologue_end ? "Y" : "");
uiout->text ("\n");

View File

@@ -3164,13 +3164,13 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
/* Is this file's first line closer than the first lines of other files?
If so, record this file, and its first line, as best alternate. */
if (item->pc (objfile) > pc
&& (!alt || item->raw_pc () < alt->raw_pc ()))
&& (!alt || item->unrelocated_pc () < alt->unrelocated_pc ()))
alt = item;
auto pc_compare = [] (const unrelocated_addr &comp_pc,
const struct linetable_entry & lhs)
{
return comp_pc < lhs.raw_pc ();
return comp_pc < lhs.unrelocated_pc ();
};
const linetable_entry *first = item;
@@ -3192,7 +3192,8 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
save prev if it represents the end of a function (i.e. line number
0) instead of a real line. */
if (prev && prev->line && (!best || prev->raw_pc () > best->raw_pc ()))
if (prev && prev->line
&& (!best || prev->unrelocated_pc () > best->unrelocated_pc ()))
{
best = prev;
best_symtab = iter_s;
@@ -3207,7 +3208,8 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
if (!best->is_stmt)
{
const linetable_entry *tmp = best;
while (tmp > first && (tmp - 1)->raw_pc () == tmp->raw_pc ()
while (tmp > first
&& (tmp - 1)->unrelocated_pc () == tmp->unrelocated_pc ()
&& (tmp - 1)->line != 0 && !tmp->is_stmt)
--tmp;
if (tmp->is_stmt)
@@ -3222,7 +3224,8 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent)
/* If another line (denoted by ITEM) is in the linetable and its
PC is after BEST's PC, but before the current BEST_END, then
use ITEM's PC as the new best_end. */
if (best && item < last && item->raw_pc () > best->raw_pc ()
if (best && item < last
&& item->unrelocated_pc () > best->unrelocated_pc ()
&& (best_end == 0 || best_end > item->pc (objfile)))
best_end = item->pc (objfile);
}
@@ -3709,12 +3712,12 @@ skip_prologue_using_linetable (CORE_ADDR func_addr)
(linetable->item, linetable->item + linetable->nitems, unrel_start,
[] (const linetable_entry &lte, unrelocated_addr pc)
{
return lte.raw_pc () < pc;
return lte.unrelocated_pc () < pc;
});
for (;
(it < linetable->item + linetable->nitems
&& it->raw_pc () < unrel_end);
&& it->unrelocated_pc () < unrel_end);
it++)
if (it->prologue_end)
return {it->pc (objfile)};

View File

@@ -1583,11 +1583,11 @@ struct rust_vtable_symbol : public symbol
struct linetable_entry
{
/* Set the (unrelocated) PC for this entry. */
void set_raw_pc (unrelocated_addr pc)
void set_unrelocated_pc (unrelocated_addr pc)
{ m_pc = pc; }
/* Return the unrelocated PC for this entry. */
unrelocated_addr raw_pc () const
unrelocated_addr unrelocated_pc () const
{ return m_pc; }
/* Return the relocated PC for this entry. */
@@ -1616,6 +1616,8 @@ struct linetable_entry
function prologue. */
bool prologue_end : 1;
private:
/* The address for this entry. */
unrelocated_addr m_pc;
};

View File

@@ -432,7 +432,7 @@ arrange_linetable (std::vector<linetable_entry> &old_linetable)
linetable_entry &e = fentries.back ();
e.line = ii;
e.is_stmt = true;
e.set_raw_pc (old_linetable[ii].raw_pc ());
e.set_unrelocated_pc (old_linetable[ii].unrelocated_pc ());
}
}
@@ -457,7 +457,8 @@ arrange_linetable (std::vector<linetable_entry> &old_linetable)
extra line to cover the function prologue. */
int jj = entry.line;
if (jj + 1 < old_linetable.size ()
&& old_linetable[jj].raw_pc () != old_linetable[jj + 1].raw_pc ())
&& (old_linetable[jj].unrelocated_pc ()
!= old_linetable[jj + 1].unrelocated_pc ()))
{
new_linetable.push_back (old_linetable[jj]);
new_linetable.back ().line = old_linetable[jj + 1].line;