mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
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
This commit is contained in:
parent
64432b473b
commit
c89d0ca50b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=248836
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue