Add Objfile.lookup_{global,static}_symbol functions
authorChristian Biesinger <cbiesinger@google.com>
Tue, 25 Jun 2019 20:45:41 +0000 (15:45 -0500)
committerChristian Biesinger <cbiesinger@google.com>
Tue, 30 Jul 2019 01:44:08 +0000 (20:44 -0500)
commitc620ed8866cc90ccfa363daf98ce7061d076d598
treeb66b50a551c9a7b2ef9b8e14469000b858ca5783
parente48de49be52cb6e0fe3edbcdc3e63bbc2465d930
Add Objfile.lookup_{global,static}_symbol functions

This is essentially the inverse of Symbol.objfile. This allows
handling different symbols with the same name (but from different
objfiles) and can also be faster if the objfile is known.

gdb/ChangeLog:

2019-07-29  Christian Biesinger  <cbiesinger@google.com>

* NEWS: Mention new functions Objfile.lookup_{global,static}_symbol.
* python/py-objfile.c (objfpy_lookup_global_symbol): New function.
(objfpy_lookup_static_symbol): New function.
(objfile_object_methods): Add new functions.

gdb/doc/ChangeLog:

2019-07-29  Christian Biesinger  <cbiesinger@google.com>

* python.texi (Objfiles In Python): Document new functions
  Objfile.lookup_{global,static}_symbol.

gdb/testsuite/ChangeLog:

2019-07-29  Christian Biesinger  <cbiesinger@google.com>

* gdb.python/py-objfile.c: Add global and static vars.
* gdb.python/py-objfile.exp: Test new functions Objfile.
  lookup_global_symbol and lookup_static_symbol.
gdb/ChangeLog
gdb/NEWS
gdb/doc/ChangeLog
gdb/doc/python.texi
gdb/python/py-objfile.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.python/py-objfile.c
gdb/testsuite/gdb.python/py-objfile.exp