modload revision 1.2 1 # $NetBSD: modload,v 1.2 2020/05/01 17:00:42 christos Exp $
2 # Load the symbol files for all active modules
3 # Note that you need to re-run add-symbol-file netbsd.gdb after you
4 # load the modules.
5 define modload
6 set $h = module_list
7 set $e = $h.tqh_first
8 while ($e != 0)
9 if ($e->mod_kobj != 0)
10 set $ko = $e->mod_kobj
11 set $n = $e->mod_info.mi_name
12 eval "add-symbol-file %s/%s/%s.kmod -s .text 0x%lx -s .data 0x%lx -s .rodata 0x%lx\n", module_base, $n, $n, $ko->ko_text_address, $ko->ko_data_address, $ko->ko_rodata_address
13 end
14 set $e = $e->mod_chain.tqe_next
15 end
16 end
17