summaryrefslogtreecommitdiffstats
path: root/tools/debugscripts
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2003-12-30 01:23:16 +0000
committergrog <grog@FreeBSD.org>2003-12-30 01:23:16 +0000
commit2f97cd97724122818c872cf2319d2f3295401de9 (patch)
treed167b2bb82d1dd571df96913b314c328e073da1f /tools/debugscripts
parentdd8da6f3b336de5809dcbca650a6d79234d3a829 (diff)
downloadFreeBSD-src-2f97cd97724122818c872cf2319d2f3295401de9.zip
FreeBSD-src-2f97cd97724122818c872cf2319d2f3295401de9.tar.gz
Remove current implementation of kldstat macro.
Add new kldstat, kldstat-v and kernel macros. The kldstat macro is functionally equivalent to the previous implementation, but it looks prettier and it matches the kldstat-v macro better. kldstat-v gives output similar to userland kldstat -v (note lacking space), and kernel loads a new kernel and dump. Submitted by: des
Diffstat (limited to 'tools/debugscripts')
-rw-r--r--tools/debugscripts/gdbinit.kernel57
1 files changed, 39 insertions, 18 deletions
diff --git a/tools/debugscripts/gdbinit.kernel b/tools/debugscripts/gdbinit.kernel
index 4b18219..89541ce 100644
--- a/tools/debugscripts/gdbinit.kernel
+++ b/tools/debugscripts/gdbinit.kernel
@@ -301,24 +301,6 @@ document y
Kludge for writing macros This is a no-op except for printing a message See gdb(4) for more details.
end
-# kldstat(8) lookalike
-define kldstat
- set $file = linker_files.tqh_first
- printf "Id Refs Address Size Name\n"
- while ($file != 0)
- printf "%2d %4d 0x%8x %8x %s\n", \
- $file->id, \
- $file->refs, \
- $file->address, \
- $file->size, \
- $file->filename
- set $file = $file->link.tqe_next
- end
-end
-document kldstat
-Equivalent of the kldstat(8) command without options
-end
-
# msgbuf: print msgbuf. Can take forever.
define msgbuf
printf "%s", msgbufp->msg_ptr
@@ -349,3 +331,42 @@ end
document checkmem
Check unallocated memory for modifications This assumes that DIAGNOSTIC is set which causes free memory to be set to 0xdeadc0de.
end
+
+define kernel
+ exec-file kernel.$arg0
+ symbol-file symbols.$arg0
+ core-file vmcore.$arg0
+end
+
+define kldstat
+y
+ set $kld = linker_files.tqh_first
+ printf "Id Refs Address Size Name\n"
+ while ($kld != 0)
+ printf "%2d %4d 0x%08x %-8x %s\n", \
+ $kld->id, $kld->refs, $kld->address, $kld->size, $kld->filename
+ set $kld = $kld->link.tqe_next
+ end
+end
+
+document kldstat
+ Lists the modules that were loaded when the kernel crashed.
+end
+
+define kldstat-v
+y
+ set $kld = linker_files.tqh_first
+ printf "Id Refs Address Size Name\n"
+ while ($kld != 0)
+ printf "%2d %4d 0x%08x %-8x %s\n", \
+ $kld->id, $kld->refs, $kld->address, $kld->size, $kld->filename
+ printf " Contains modules:\n"
+ printf " Id Name\n"
+ set $module = $kld->modules.tqh_first
+ while ($module != 0)
+ printf " %2d %s\n", $module->id, $module->name
+ set $module = $module->link.tqe_next
+ end
+ set $kld = $kld->link.tqe_next
+ end
+end
OpenPOWER on IntegriCloud