summaryrefslogtreecommitdiff
path: root/sys/gdbscripts
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2006-09-29 15:43:06 +0000
committerpooka <pooka@NetBSD.org>2006-09-29 15:43:06 +0000
commit751537fe38310eea5f506f934818bee8a418be10 (patch)
tree7c2c66252bce682f44a58ec86ff9c0b1f3f92b48 /sys/gdbscripts
parent897b34d36dc3e0cbe4b31f2d4a1a8d00b2fab107 (diff)
Make these work again. I know, I'm a bit impatient, since they've
only been broken for 12 years, but some things are better done sooner than later. While meddling here, introduce mp_vchain, which prints the vnode chain given a mount point.
Diffstat (limited to 'sys/gdbscripts')
-rw-r--r--sys/gdbscripts/vchain26
-rw-r--r--sys/gdbscripts/vdump6
2 files changed, 22 insertions, 10 deletions
diff --git a/sys/gdbscripts/vchain b/sys/gdbscripts/vchain
index e22c259631f..403f00a3161 100644
--- a/sys/gdbscripts/vchain
+++ b/sys/gdbscripts/vchain
@@ -1,17 +1,16 @@
-# $NetBSD: vchain,v 1.2 1997/02/12 23:35:10 gwr Exp $
+# $NetBSD: vchain,v 1.3 2006/09/29 15:43:06 pooka Exp $
# @(#)vchain 8.1 (Berkeley) 6/10/93
#
# Given a vnode, follow its mount pointers
define vchain
-
set $num = 0
set $vp=(struct vnode *)$arg0
while ($vp)
- printf "vp: 0x%x freef: 0x%x usecount: %d flags: 0x%x\n", $vp, $vp->v_freef, $vp->v_usecount, $vp->v_flag
+ printf "vp: 0x%x freelist_next: 0x%x usecount: %d flags: 0x%x\n", $vp, $vp->v_freelist.tqe_next, $vp->v_uobj.uo_refs, $vp->v_flag
set $num++
- set $vp = $vp->v_mountf
+ set $vp = $vp->v_mntvnodes.le_next
end
printf "Number of vnodes: %d\n", $num
end
@@ -21,10 +20,23 @@ define vprint
set $ip=(struct inode *)$vp->v_data
end
+# print the vnode chain for a given mount point
+define mp_vchain
+ set $mp = (struct mount *)$arg0
+ vchain $mp->mnt_vnodelist.lh_first
+end
+
+# print vnode chains for all mount points
define vall
- set $mp=rootfs
+ set $mp=mountlist.cqh_first
while ($mp)
- vchain $mp->mnt_mounth
- set $mp=$mp->mnt_next
+ printf "\tmount point at 0x%x\n", $mp
+ mp_vchain $mp
+ set $mp=$mp->mnt_list.cqe_next
+
+ # "break"
+ if ((const void *)$mp == (const void *)&mountlist)
+ set $mp = 0
+ end
end
end
diff --git a/sys/gdbscripts/vdump b/sys/gdbscripts/vdump
index 3605060b6b1..d2f063e64b6 100644
--- a/sys/gdbscripts/vdump
+++ b/sys/gdbscripts/vdump
@@ -1,4 +1,4 @@
-# $NetBSD: vdump,v 1.2 1997/02/12 23:35:11 gwr Exp $
+# $NetBSD: vdump,v 1.3 2006/09/29 15:43:06 pooka Exp $
# @(#)vdump 8.1 (Berkeley) 6/10/93
#
@@ -8,7 +8,7 @@ define dumpvnodes
set $vp = (struct vnode *)$arg0
while ($vp)
- printf "vnode=0x%x freef=0x%x mountf=0x%x usecount=%d\n", $vp, $vp->v_freef, $vp->v_mountf, $vp->v_usecount
- set $vp = (struct vnode *)$vp->v_freef
+ printf "vnode=0x%x freef=0x%x mountf=0x%x usecount=%d\n", $vp, $vp->v_freelist.tqe_next, $vp->v_mntvnodes.le_next, $vp->v_uobj.uo_refs
+ set $vp = (struct vnode *)$vp->v_freelist.tqe_next
end
end