ks->linux_regs          = regs;
  
        if (kgdb_reenter_check(ks))
 -              return 0; /* Ouch, double exception ! */
 +              goto out; /* Ouch, double exception ! */
        if (kgdb_info[ks->cpu].enter_kgdb != 0)
 -              return 0;
 +              goto out;
  
 -      return kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
 +      ret = kgdb_cpu_enter(ks, regs, DCPU_WANT_MASTER);
 +out:
 +      if (arch_kgdb_ops.enable_nmi)
 +              arch_kgdb_ops.enable_nmi(1);
 +      return ret;
  }
  
+ /*
+  * GDB places a breakpoint at this function to know dynamically
+  * loaded objects. It's not defined static so that only one instance with this
+  * name exists in the kernel.
+  */
+ 
+ static int module_event(struct notifier_block *self, unsigned long val,
+       void *data)
+ {
+       return 0;
+ }
+ 
+ static struct notifier_block dbg_module_load_nb = {
+       .notifier_call  = module_event,
+ };
+ 
  int kgdb_nmicallback(int cpu, void *regs)
  {
  #ifdef CONFIG_SMP