]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb/python: preserve identity for gdb.Symbol objects
authorJan Vrany <jan.vrany@labware.com>
Wed, 19 Mar 2025 21:12:53 +0000 (21:12 +0000)
committerJan Vrany <jan.vrany@labware.com>
Wed, 19 Mar 2025 21:12:53 +0000 (21:12 +0000)
commitd518cb9be11af64951af8eb6f998751097f58a1c
tree557343234fd910c6b07c363293036bb9b76ff1e2
parent14b8ef758c634e0c1460010f2125799d0588a194
gdb/python: preserve identity for gdb.Symbol objects

This commit changes symbol_to_symbol_object() so that each it is called
with a particular struct symbol * it returns the very same gdb.Symbol
object.

This is done in the same way as for gdb.Symtab objects in earlier commit
("gdb/python: preserve identity for gdb.Symtab objects") except that
symbols may be either objfile-owned or arch-owned.

Prior this commit, arch-owned objects we not put into any list (like
objfile-owned ones) so they could not be easily looked up. This commit
changes the code so arch-owned list are put into per-architecture list
which is then used (solely) for looking up arch-owned gdb.Symbol.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/python/py-symbol.c