summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorwill <will@FreeBSD.org>2013-03-28 17:04:59 +0000
committerwill <will@FreeBSD.org>2013-03-28 17:04:59 +0000
commited419adb26f779327a4707bd49646df33f913ee4 (patch)
tree30ce6efbc53635c9028ea3be48b475dce109fc95 /gnu
parent536305e233b439bcedaff155748ee0ccd111688a (diff)
downloadFreeBSD-src-ed419adb26f779327a4707bd49646df33f913ee4.zip
FreeBSD-src-ed419adb26f779327a4707bd49646df33f913ee4.tar.gz
KGDB: Allow modules to be loaded from the specified kernel's directory.
When looking up the absolute path for a kld, call find_kld_path() first. This enables locating the module in a different directory than the one stored in kernel memory. With this change, kgdb can now be run on a kernel & vmcore whose associated modules are located in the same directory as the kernel. This makes independent triaging of problems much easier. This change also does not break the normal kgdb use case where no arguments are specified; in that case kgdb loads the running kernel and its modules. Reviewed by: adrian Approved by: ken (mentor) Sponsored by: Spectra Logic MFC after: 1 month
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/kgdb/kld.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/kld.c b/gnu/usr.bin/gdb/kgdb/kld.c
index d5ba20a..8b89742 100644
--- a/gnu/usr.bin/gdb/kgdb/kld.c
+++ b/gnu/usr.bin/gdb/kgdb/kld.c
@@ -382,7 +382,10 @@ kld_current_sos (void)
* Try to read the pathname (if it exists) and store
* it in so_name.
*/
- if (off_pathname != 0) {
+ if (find_kld_path(new->so_original_name, new->so_name,
+ sizeof(new->so_name))) {
+ /* we found the kld */;
+ } else if (off_pathname != 0) {
target_read_string(read_pointer(kld + off_pathname),
&path, sizeof(new->so_name), &error);
if (error != 0) {
OpenPOWER on IntegriCloud