From 02e9e7f7e2bed3b82cb6541f566caf07256b9b2f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 3 May 2018 16:36:18 -0600 Subject: Introduce partial_symbol::address This introduces a partial_symbol::address method. This method takes an objfile argument. This is necessary so that we can later relocate a partial symbol at its point of use. It also adds an accessor to compute the unrelocated value; and a method to be used for setting the field. Note that the new method doesn't actually perform any relocation yet. That will come in a subsequent patch. However, the comments are written to reflect the intended, rather than the temporary, semantics. gdb/ChangeLog 2018-07-26 Tom Tromey * psympriv.h (struct partial_symbol) : New methods. * psymtab.c (find_pc_sect_psymtab_closer, find_pc_sect_psymbol) (fixup_psymbol_section, relocate_psymtabs): Update. (print_partial_symbols): Add 'objfile' parameter. Update. (dump_psymtab, add_psymbol_to_bcache, psym_fill_psymbol_map): Update. --- gdb/psympriv.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gdb/psympriv.h') diff --git a/gdb/psympriv.h b/gdb/psympriv.h index f3cb0a6..be574bf 100644 --- a/gdb/psympriv.h +++ b/gdb/psympriv.h @@ -44,6 +44,26 @@ struct partial_symbol : public general_symbol_info return nullptr; } + /* Return the unrelocated address of this partial symbol. */ + CORE_ADDR unrelocated_address () const + { + return value.address; + } + + /* Return the address of this partial symbol, relocated according to + the offsets provided in OBJFILE. */ + CORE_ADDR address (const struct objfile *objfile) const + { + return value.address; + } + + /* Set the address of this partial symbol. The address must be + unrelocated. */ + void set_address (CORE_ADDR addr) + { + value.address = addr; + } + /* Name space code. */ ENUM_BITFIELD(domain_enum_tag) domain : SYMBOL_DOMAIN_BITS; -- cgit v1.1