summaryrefslogtreecommitdiff
path: root/sys/gdbscripts/module
diff options
context:
space:
mode:
authoryamt <yamt@NetBSD.org>2011-11-02 16:51:21 +0000
committeryamt <yamt@NetBSD.org>2011-11-02 16:51:21 +0000
commitc53082a102a498019e8a386aaf211d624814a129 (patch)
tree644de6079bfc0b07cad955836c9502778a6d7857 /sys/gdbscripts/module
parentbc6f4a2ffdc45b08ce378331d8a521004ec4ef1d (diff)
a macro to dump kernel modules
Diffstat (limited to 'sys/gdbscripts/module')
-rw-r--r--sys/gdbscripts/module16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/gdbscripts/module b/sys/gdbscripts/module
new file mode 100644
index 00000000000..a0e1df6bcd1
--- /dev/null
+++ b/sys/gdbscripts/module
@@ -0,0 +1,16 @@
+define modules
+ set $h = module_list
+ set $e = $h->tqh_first
+ while ($e != 0)
+ if ($e->mod_kobj != 0)
+ printf "module %s\t0x%016x-0x%016x\n", \
+ $e->mod_info.mi_name, \
+ $e->mod_kobj->ko_address, \
+ $e->mod_kobj->ko_address + $e->mod_kobj->ko_size
+ else
+ printf "module %s\n", \
+ $e->mod_info.mi_name
+ end
+ set $e = $e->mod_chain.tqe_next
+ end
+end