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/common/agent.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/common/agent.c')
-rw-r--r-- | gdb/common/agent.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/gdb/common/agent.c b/gdb/common/agent.c index 0ac73a9..433ae2a 100644 --- a/gdb/common/agent.c +++ b/gdb/common/agent.c @@ -21,9 +21,9 @@ #include "server.h" #else #include "defs.h" -#include "objfiles.h" #endif #include "target/target.h" +#include "common/symbol.h" #include <unistd.h> #include "agent.h" #include "filestuff.h" @@ -98,18 +98,9 @@ agent_look_up_symbols (void *arg) { CORE_ADDR *addrp = (CORE_ADDR *) ((char *) &ipa_sym_addrs + symbol_list[i].offset); -#ifdef GDBSERVER - - if (look_up_one_symbol (symbol_list[i].name, addrp, 1) == 0) -#else - struct bound_minimal_symbol sym = - lookup_minimal_symbol (symbol_list[i].name, NULL, - (struct objfile *) arg); - if (sym.minsym != NULL) - *addrp = BMSYMBOL_VALUE_ADDRESS (sym); - else -#endif + if (find_minimal_symbol_address (symbol_list[i].name, addrp, + arg) != 0) { DEBUG_AGENT ("symbol `%s' not found\n", symbol_list[i].name); return -1; |