
$FreeBSD: ports/devel/gdb6/files/patch-target.c,v 1.5 2006/08/02 23:34:54 sobomax Exp $

--- gdb/target.c.orig
+++ gdb/target.c
@@ -1487,13 +1487,14 @@
   struct target_ops **t;
   struct target_ops *runable = NULL;
   int count;
+  extern int kernel_debugging;
 
   count = 0;
 
   for (t = target_structs; t < target_structs + target_struct_size;
        ++t)
     {
-      if ((*t)->to_stratum == core_stratum)
+      if ((*t)->to_stratum == (kernel_debugging ? kcore_stratum : core_stratum))
 	{
 	  runable = *t;
 	  ++count;
