diff options
Diffstat (limited to 'kernel/debug/debug_core.c')
| -rw-r--r-- | kernel/debug/debug_core.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/kernel/debug/debug_core.c b/kernel/debug/debug_core.c index 17e073c309e6..9a61738cefc8 100644 --- a/kernel/debug/debug_core.c +++ b/kernel/debug/debug_core.c | |||
| @@ -696,6 +696,22 @@ out: | |||
| 696 | return ret; | 696 | return ret; |
| 697 | } | 697 | } |
| 698 | 698 | ||
| 699 | /* | ||
| 700 | * GDB places a breakpoint at this function to know dynamically | ||
| 701 | * loaded objects. It's not defined static so that only one instance with this | ||
| 702 | * name exists in the kernel. | ||
| 703 | */ | ||
| 704 | |||
| 705 | static int module_event(struct notifier_block *self, unsigned long val, | ||
| 706 | void *data) | ||
| 707 | { | ||
| 708 | return 0; | ||
| 709 | } | ||
| 710 | |||
| 711 | static struct notifier_block dbg_module_load_nb = { | ||
| 712 | .notifier_call = module_event, | ||
| 713 | }; | ||
| 714 | |||
| 699 | int kgdb_nmicallback(int cpu, void *regs) | 715 | int kgdb_nmicallback(int cpu, void *regs) |
| 700 | { | 716 | { |
| 701 | #ifdef CONFIG_SMP | 717 | #ifdef CONFIG_SMP |
| @@ -824,6 +840,7 @@ static void kgdb_register_callbacks(void) | |||
| 824 | kgdb_arch_init(); | 840 | kgdb_arch_init(); |
| 825 | if (!dbg_is_early) | 841 | if (!dbg_is_early) |
| 826 | kgdb_arch_late(); | 842 | kgdb_arch_late(); |
| 843 | register_module_notifier(&dbg_module_load_nb); | ||
| 827 | register_reboot_notifier(&dbg_reboot_notifier); | 844 | register_reboot_notifier(&dbg_reboot_notifier); |
| 828 | atomic_notifier_chain_register(&panic_notifier_list, | 845 | atomic_notifier_chain_register(&panic_notifier_list, |
| 829 | &kgdb_panic_event_nb); | 846 | &kgdb_panic_event_nb); |
| @@ -847,6 +864,7 @@ static void kgdb_unregister_callbacks(void) | |||
| 847 | if (kgdb_io_module_registered) { | 864 | if (kgdb_io_module_registered) { |
| 848 | kgdb_io_module_registered = 0; | 865 | kgdb_io_module_registered = 0; |
| 849 | unregister_reboot_notifier(&dbg_reboot_notifier); | 866 | unregister_reboot_notifier(&dbg_reboot_notifier); |
| 867 | unregister_module_notifier(&dbg_module_load_nb); | ||
| 850 | atomic_notifier_chain_unregister(&panic_notifier_list, | 868 | atomic_notifier_chain_unregister(&panic_notifier_list, |
| 851 | &kgdb_panic_event_nb); | 869 | &kgdb_panic_event_nb); |
| 852 | kgdb_arch_exit(); | 870 | kgdb_arch_exit(); |
