diff options
author | Tom Tromey <tom@tromey.com> | 2018-05-03 16:36:18 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-07-26 09:18:30 -0600 |
commit | 02e9e7f7e2bed3b82cb6541f566caf07256b9b2f (patch) | |
tree | e3d593639dbffe803aab7e2fb141a14e20bb80b8 /gdb/psympriv.h | |
parent | 8a6d4234503bfe1c656d8cd335cac828507df9a3 (diff) | |
download | fsf-binutils-gdb-02e9e7f7e2bed3b82cb6541f566caf07256b9b2f.zip fsf-binutils-gdb-02e9e7f7e2bed3b82cb6541f566caf07256b9b2f.tar.gz fsf-binutils-gdb-02e9e7f7e2bed3b82cb6541f566caf07256b9b2f.tar.bz2 |
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 <tromey@redhat.com>
* psympriv.h (struct partial_symbol) <unrelocated_address,
address, set_address>: 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.
Diffstat (limited to 'gdb/psympriv.h')
-rw-r--r-- | gdb/psympriv.h | 20 |
1 files changed, 20 insertions, 0 deletions
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; |