diff options
author | Gary Benson <gbenson@redhat.com> | 2014-09-11 11:43:04 +0100 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2014-09-11 11:43:21 +0100 |
commit | bd9269f70c70b1218b0eb73a6f487d6ca481e5ac (patch) | |
tree | 87a113269227ef0da65e91772516f107efdaac2b /gdb/minsyms.c | |
parent | f8c1d06b82ab0fd56bcffc9030cb44b5a946113e (diff) | |
download | gdb-bd9269f70c70b1218b0eb73a6f487d6ca481e5ac.zip gdb-bd9269f70c70b1218b0eb73a6f487d6ca481e5ac.tar.gz gdb-bd9269f70c70b1218b0eb73a6f487d6ca481e5ac.tar.bz2 |
Introduce common/symbol.h
This introduces common/symbol.h. This file declares a function that
the shared code can use and that the clients must implement. It also
changes some shared code to use these functions.
gdb/ChangeLog:
* common/symbol.h: New file.
* Makefile.in (HFILES_NO_SRCDIR): Add common/symbol.h.
* minsyms.c (find_minimal_symbol_address): New function.
* common/agent.c: Include common/symbol.h.
[!GDBSERVER]: Don't include objfiles.h.
(agent_look_up_symbols): Use find_minimal_symbol_address.
gdb/gdbserver/ChangeLog:
* symbol.c: New file.
* Makefile.in (SFILES): Add symbol.c.
(OBS): Add symbol.o.
Diffstat (limited to 'gdb/minsyms.c')
-rw-r--r-- | gdb/minsyms.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/minsyms.c b/gdb/minsyms.c index fd7fcd9..8eb7c85 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -50,6 +50,7 @@ #include "cp-support.h" #include "language.h" #include "cli/cli-utils.h" +#include "symbol.h" /* Accumulate the minimal symbols for each objfile in bunches of BUNCH_SIZE. At the end, copy them all into one newly allocated location on an objfile's @@ -299,6 +300,21 @@ lookup_bound_minimal_symbol (const char *name) return lookup_minimal_symbol (name, NULL, NULL); } +/* See common/symbol.h. */ + +int +find_minimal_symbol_address (const char *name, CORE_ADDR *addr, + struct objfile *objfile) +{ + struct bound_minimal_symbol sym + = lookup_minimal_symbol (name, NULL, objfile); + + if (sym.minsym != NULL) + *addr = BMSYMBOL_VALUE_ADDRESS (sym); + + return sym.minsym == NULL; +} + /* See minsyms.h. */ void |