[RFA 6/6] Make psymbols and psymtabs independent of the program space
Keith Seitz
keiths@redhat.com
Tue Jun 5 20:34:00 GMT 2018
On 05/03/2018 03:36 PM, Tom Tromey wrote:
> This patch finally makes partial symbols and partial symtabs
> independent of the program space.
>
SHAZAM!
I've looked over this patch, and I'd say go for it (warning IANAM), but I would like to bring up one or two general questions that came to mind. [A lot of this stuff is pretty foreign to me, so please pardon my ignorance.]
> diff --git a/gdb/dbxread.c b/gdb/dbxread.c
> index da675abb68..91bc25a87d 100644
> --- a/gdb/dbxread.c
> +++ b/gdb/dbxread.c
> @@ -2296,8 +2281,8 @@ read_ofile_symtab (struct objfile *objfile, struct partial_symtab *pst)
>
> sym_offset = LDSYMOFF (pst);
> sym_size = LDSYMLEN (pst);
> - text_offset = PSYMTAB_TEXTLOW (pst);
> - text_size = PSYMTAB_TEXTHIGH (pst) - PSYMTAB_TEXTLOW (pst);
> + text_offset = PSYMTAB_TEXTLOW (objfile, pst);
> + text_size = PSYMTAB_TEXTHIGH (objfile, pst) - PSYMTAB_TEXTLOW (objfile, pst);
> section_offsets = objfile->section_offsets;
IIUC, text_offset can be computed using the RAW flavors since both macros simply add ANOFFSET (...). [Compilers are probably smart enough to optimize this, so take this with a grain of salt. Or a block of salt lick.]
> diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
> index 3cb0475b3b..f8630de47a 100644
> --- a/gdb/dwarf2read.c
> +++ b/gdb/dwarf2read.c
> @@ -3178,8 +3178,8 @@ create_addrmap_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile,
> continue;
> }
>
> - lo = gdbarch_adjust_dwarf2_addr (gdbarch, lo + baseaddr);
> - hi = gdbarch_adjust_dwarf2_addr (gdbarch, hi + baseaddr);
> + lo = gdbarch_adjust_dwarf2_addr (gdbarch, lo + baseaddr) - baseaddr;
> + hi = gdbarch_adjust_dwarf2_addr (gdbarch, hi + baseaddr) - baseaddr;
> addrmap_set_empty (mutable_map, lo, hi - 1,
> dwarf2_per_objfile->get_cu (cu_index));
> }
I have to admit... The above expressions look odd, but I am completely unfamiliar with gdbarch_adjust_dwarf2_addr. From the description of that function, it seems that this is okay, though.
Keith
More information about the Gdb-patches
mailing list