From ed419adb26f779327a4707bd49646df33f913ee4 Mon Sep 17 00:00:00 2001 From: will Date: Thu, 28 Mar 2013 17:04:59 +0000 Subject: 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 --- gnu/usr.bin/gdb/kgdb/kld.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gnu/usr.bin/gdb') 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) { -- cgit v1.1