Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Mar 2013 17:04:59 +0000 (UTC)
From:      Will Andrews <will@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248836 - head/gnu/usr.bin/gdb/kgdb
Message-ID:  <201303281704.r2SH4x3J025620@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: will
Date: Thu Mar 28 17:04:59 2013
New Revision: 248836
URL: http://svnweb.freebsd.org/changeset/base/248836

Log:
  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

Modified:
  head/gnu/usr.bin/gdb/kgdb/kld.c

Modified: head/gnu/usr.bin/gdb/kgdb/kld.c
==============================================================================
--- head/gnu/usr.bin/gdb/kgdb/kld.c	Thu Mar 28 16:57:48 2013	(r248835)
+++ head/gnu/usr.bin/gdb/kgdb/kld.c	Thu Mar 28 17:04:59 2013	(r248836)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201303281704.r2SH4x3J025620>