]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - gdb/symtab.c
Change linetables to be objfile-independent
authorTom Tromey <tom@tromey.com>
Wed, 8 Mar 2023 00:37:45 +0000 (17:37 -0700)
committerTom Tromey <tom@tromey.com>
Sat, 11 Mar 2023 15:47:40 +0000 (08:47 -0700)
commit1acc9dca423f78e44553928f0de839b618c13766
tree2cd8e208a45241b90a42d54aba456944cb1cfd37
parent6e6ac32dde61fd3019b05adaeec372eb16c12bff
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>
15 files changed:
gdb/buildsym.c
gdb/coffread.c
gdb/dbxread.c
gdb/disasm.c
gdb/dwarf2/read.c
gdb/jit.c
gdb/mdebugread.c
gdb/mi/mi-symbol-cmds.c
gdb/objfiles.c
gdb/python/py-linetable.c
gdb/record-btrace.c
gdb/symmisc.c
gdb/symtab.c
gdb/symtab.h
gdb/xcoffread.c