Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/gdbscripts a macro to dump kernel modules



details:   https://anonhg.NetBSD.org/src/rev/49187c062e54
branches:  trunk
changeset: 770813:49187c062e54
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Nov 02 16:51:21 2011 +0000

description:
a macro to dump kernel modules

diffstat:

 sys/gdbscripts/Makefile.inc |   4 ++--
 sys/gdbscripts/module       |  16 ++++++++++++++++
 2 files changed, 18 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 7cb4f86bf279 -r 49187c062e54 sys/gdbscripts/Makefile.inc
--- a/sys/gdbscripts/Makefile.inc       Wed Nov 02 16:49:12 2011 +0000
+++ b/sys/gdbscripts/Makefile.inc       Wed Nov 02 16:51:21 2011 +0000
@@ -1,3 +1,3 @@
-#      $NetBSD: Makefile.inc,v 1.4 2008/02/20 21:01:23 ad Exp $
+#      $NetBSD: Makefile.inc,v 1.5 2011/11/02 16:51:21 yamt Exp $
 
-SYS_GDBINIT=   bdump cpus kdump lwps msgbuf pgrpdump procs vchain vdump
+SYS_GDBINIT=   bdump cpus kdump lwps module msgbuf pgrpdump procs vchain vdump
diff -r 7cb4f86bf279 -r 49187c062e54 sys/gdbscripts/module
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/gdbscripts/module     Wed Nov 02 16:51:21 2011 +0000
@@ -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



Home | Main Index | Thread Index | Old Index