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
This commit is contained in:
grog 2003-12-30 01:23:16 +00:00
parent dd8da6f3b3
commit 2f97cd9772

View File

@ -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