aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-07 17:37:45 -0700
committerTom Tromey <tom@tromey.com>2023-03-11 08:47:40 -0700
commit1acc9dca423f78e44553928f0de839b618c13766 (patch)
tree2cd8e208a45241b90a42d54aba456944cb1cfd37 /gdb/objfiles.c
parentAdd operator< and operator== to linetable_entry (diff)
downloadbinutils-gdb-1acc9dca423f78e44553928f0de839b618c13766.tar.gz
binutils-gdb-1acc9dca423f78e44553928f0de839b618c13766.tar.bz2
binutils-gdb-1acc9dca423f78e44553928f0de839b618c13766.zip
Change linetables to be objfile-independent
This changes linetables to not add the text offset to the addresses they contain. I did this in a few steps, necessarily combined together in one patch: I renamed the 'pc' member to 'm_pc', added the appropriate accessors, and then recompiled. Then I fixed all the errors. Where possible I generally chose to use the raw_pc accessor, as it is less expensive. Note that this patch discounts the possibility that the text section offset might cause wraparound in the addresses in the line table. However, this was already discounted -- in particular, objfile_relocate1 did not re-sort the table in this scenario. (There was a bug open about this, but as far as I can tell this has never happened, it's not even clear what inspired that bug.) Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/objfiles.c')
-rw-r--r--gdb/objfiles.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 8e7be8e2e25..2c8f5d14444 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -618,22 +618,6 @@ objfile_relocate1 (struct objfile *objfile,
{
for (compunit_symtab *cust : objfile->compunits ())
{
- for (symtab *s : cust->filetabs ())
- {
- struct linetable *l;
-
- /* First the line table. */
- l = s->linetable ();
- if (l)
- {
- for (int i = 0; i < l->nitems; ++i)
- l->item[i].pc += delta[SECT_OFF_TEXT (objfile)];
- }
- }
- }
-
- for (compunit_symtab *cust : objfile->compunits ())
- {
struct blockvector *bv = cust->blockvector ();
int block_line_section = SECT_OFF_TEXT (objfile);