diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-07 17:37:45 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-11 08:47:40 -0700 |
commit | 1acc9dca423f78e44553928f0de839b618c13766 (patch) | |
tree | 2cd8e208a45241b90a42d54aba456944cb1cfd37 /gdb/dbxread.c | |
parent | 6e6ac32dde61fd3019b05adaeec372eb16c12bff (diff) | |
download | gdb-1acc9dca423f78e44553928f0de839b618c13766.zip gdb-1acc9dca423f78e44553928f0de839b618c13766.tar.gz gdb-1acc9dca423f78e44553928f0de839b618c13766.tar.bz2 |
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/dbxread.c')
-rw-r--r-- | gdb/dbxread.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 02c7e31..1e88121 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -2454,7 +2454,8 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name, CORE_ADDR addr = last_function_start + valu; record_line (get_current_subfile (), 0, - gdbarch_addr_bits_remove (gdbarch, addr)); + gdbarch_addr_bits_remove (gdbarch, addr) + - objfile->text_section_offset ()); } within_function = 0; @@ -2662,12 +2663,14 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name, last_function_start : valu; record_line (get_current_subfile (), desc, - gdbarch_addr_bits_remove (gdbarch, addr)); + gdbarch_addr_bits_remove (gdbarch, addr) + - objfile->text_section_offset ()); sline_found_in_function = 1; } else record_line (get_current_subfile (), desc, - gdbarch_addr_bits_remove (gdbarch, valu)); + gdbarch_addr_bits_remove (gdbarch, valu) + - objfile->text_section_offset ()); break; case N_BCOMM: |