summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1998-04-30 07:56:18 +0000
committerdfr <dfr@FreeBSD.org>1998-04-30 07:56:18 +0000
commit0925595f7374e80fc5ec4ce130be1d0fbf1836a0 (patch)
tree7d7dd287eb36509fdb0a3d6a53f4540dff926668 /contrib
parent42b079b4f32353f79d6705def80e02568d73fb6b (diff)
downloadFreeBSD-src-0925595f7374e80fc5ec4ce130be1d0fbf1836a0.zip
FreeBSD-src-0925595f7374e80fc5ec4ce130be1d0fbf1836a0.tar.gz
Use the dynamic symtab of the runtime linker when looking for places to set
breakpoints. It may have been installed stripped.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/gdb/gdb/solib.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/contrib/gdb/gdb/solib.c b/contrib/gdb/gdb/solib.c
index 3a20b55..61b68ad 100644
--- a/contrib/gdb/gdb/solib.c
+++ b/contrib/gdb/gdb/solib.c
@@ -37,6 +37,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <a.out.h>
#else
#include "elf/external.h"
+#include "elf/common.h"
#endif
#include <link.h>
@@ -465,6 +466,29 @@ bfd_lookup_symbol (abfd, symname)
}
do_cleanups (back_to);
}
+
+ if (symaddr) return (symaddr);
+
+ storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
+
+ if (storage_needed > 0)
+ {
+ symbol_table = (asymbol **) xmalloc (storage_needed);
+ back_to = make_cleanup (free, (PTR)symbol_table);
+ number_of_symbols = bfd_canonicalize_dynamic_symtab (abfd, symbol_table);
+
+ for (i = 0; i < number_of_symbols; i++)
+ {
+ sym = *symbol_table++;
+ if (STREQ (sym -> name, symname))
+ {
+ /* Bfd symbols are section relative. */
+ symaddr = sym -> value + sym -> section -> vma;
+ break;
+ }
+ }
+ do_cleanups (back_to);
+ }
return (symaddr);
}
OpenPOWER on IntegriCloud