diff options
author | marcel <marcel@FreeBSD.org> | 2013-12-28 23:31:22 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2013-12-28 23:31:22 +0000 |
commit | 06fa4314815cff92b6c276f4e82fc40eed3b5362 (patch) | |
tree | 146a08f682e9b153111393e066f9ab0b88d10f10 /gnu | |
parent | 7dde977c7d40793c4636581c8d0f26e3b8da8e9a (diff) | |
download | FreeBSD-src-06fa4314815cff92b6c276f4e82fc40eed3b5362.zip FreeBSD-src-06fa4314815cff92b6c276f4e82fc40eed3b5362.tar.gz |
When building a cross kgdb, link against the appropriate cross libkvm.
Provide an implementation of ps_pglobal_lookup() for use by the cross
libkvm.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/Makefile | 10 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/main.c | 21 |
2 files changed, 29 insertions, 2 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/Makefile b/gnu/usr.bin/gdb/kgdb/Makefile index 1372f17..30cbf3c 100644 --- a/gnu/usr.bin/gdb/kgdb/Makefile +++ b/gnu/usr.bin/gdb/kgdb/Makefile @@ -8,7 +8,13 @@ BULIBS= ${OBJ_BU}/libbfd/libbfd.a ${OBJ_BU}/libopcodes/libopcodes.a \ ${OBJ_BU}/libiberty/libiberty.a GDBLIBS= ${OBJ_GDB}/libgdb/libgdb.a -DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} ${LIBGNUREGEX} -LDADD= ${GDBLIBS} ${BULIBS} -lkvm -lm -lreadline -ltermcap -lgnuregex +DPADD= ${GDBLIBS} ${BULIBS} ${LIBKVM} ${LIBM} ${LIBREADLINE} ${LIBTERMCAP} \ + ${LIBGNUREGEX} +LDADD= ${GDBLIBS} ${BULIBS} -lkvm${GDB_SUFFIX} -lm -lreadline -ltermcap \ + -lgnuregex + +.if defined(GDB_CROSS_DEBUGGER) +CFLAGS+= -Wl,-export-dynamic +.endif .include <bsd.prog.mk> diff --git a/gnu/usr.bin/gdb/kgdb/main.c b/gnu/usr.bin/gdb/kgdb/main.c index aa062a2..19246c0 100644 --- a/gnu/usr.bin/gdb/kgdb/main.c +++ b/gnu/usr.bin/gdb/kgdb/main.c @@ -41,6 +41,9 @@ __FBSDID("$FreeBSD$"); #include <kvm.h> #include <limits.h> #include <paths.h> +#ifdef CROSS_DEBUGGER +#include <proc_service.h> +#endif #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -78,6 +81,24 @@ static struct ui_file *parse_gdberr; static void (*kgdb_new_objfile_chain)(struct objfile * objfile); +#ifdef CROSS_DEBUGGER +ps_err_e +ps_pglobal_lookup(struct ps_prochandle *ph, const char *obj, const char *name, + psaddr_t *sym_addr) +{ + struct minimal_symbol *ms; + CORE_ADDR addr; + + ms = lookup_minimal_symbol (name, NULL, NULL); + if (ms == NULL) + return PS_NOSYM; + + addr = SYMBOL_VALUE_ADDRESS (ms); + store_typed_address(sym_addr, builtin_type_void_data_ptr, addr); + return PS_OK; +} +#endif + static void usage(void) { |