Module Name:    src
Committed By:   mrg
Date:           Fri Dec  6 02:37:53 UTC 2019

Modified Files:
        src/sys/gdbscripts: vchain

Log Message:
more updates for the vnode and mount list iterator changes
that happened a while back.  also, port to 64 bit properly.
now these all appear to work again.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/gdbscripts/vchain

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/gdbscripts/vchain
diff -u src/sys/gdbscripts/vchain:1.10 src/sys/gdbscripts/vchain:1.11
--- src/sys/gdbscripts/vchain:1.10	Fri Dec  6 01:01:02 2019
+++ src/sys/gdbscripts/vchain	Fri Dec  6 02:37:53 2019
@@ -1,4 +1,4 @@
-#	$NetBSD: vchain,v 1.10 2019/12/06 01:01:02 mrg Exp $
+#	$NetBSD: vchain,v 1.11 2019/12/06 02:37:53 mrg Exp $
 
 #	@(#)vchain	8.1 (Berkeley) 6/10/93
 #
@@ -6,14 +6,15 @@
 define vchain
 	set $num = 0
 
-	set $vp=(struct vnode *)$arg0
-	set $vi=(struct vnode_impl *)$arg0
-	while ($vp)
-		printf "vp: 0x%lx lrulist_next: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
-		       $vp, $vi->vi_lrulist.tqe_next, $vp->v_uobj.uo_refs, \
+	set $vi = (struct vnode_impl *)$arg0
+	printf "lrulist_next: 0x%lx\n", $vi->vi_lrulist.tqe_next
+	while ($vi)
+		set $vp = &$vi->vi_vnode
+		printf "vp: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
+		       $vp, $vp->v_uobj.uo_refs, \
 		       $vp->v_iflag, $vp->v_vflag, $vp->v_uflag
 		set $num++
-		set $vp = $vp->v_mntvnodes.tqe_next
+		set $vi = $vi->vi_mntvnodes.tqe_next
 	end
 	printf "Number of vnodes: %d\n", $num
 end
@@ -28,23 +29,26 @@ define vprint
 end
 
 define mp_vchain
-	set $mp = (struct mount *)$arg0
-	vchain $mp->mnt_vnodelist.tqh_first
+	set $mp = $arg0->me_mount
+	set $first = $mp->mnt_vnodelist.tqh_first
+	if ($first)
+		vchain $mp->mnt_vnodelist.tqh_first
+	end
 end
 document mp_vchain
 print the vnode chain for a given mount point
 end
 
 define vall
-	set $mp=mountlist.tqh_first
-	while ($mp)
-		printf "\tmount point at 0x%x\n", $mp
-		mp_vchain $mp
-		set $mp=$mp->mnt_list.tqe_next
+	set $mpe=mountlist.tqh_first
+	while ($mpe)
+		printf "\tmount point at 0x%lx\n", $mpe
+		mp_vchain $mpe
+		set $mpe = $mpe->me_list.tqe_next
 
 		# "break"
-		if ((const void *)$mp == (const void *)&mountlist)
-			set $mp = 0
+		if ((const void *)$mpe == (const void *)&mountlist)
+			set $mpe = 0
 		end
 	end
 end
@@ -57,7 +61,7 @@ define mountdump
 	while ($me)
 		if ($me->me_type == ME_MOUNT)
 			set $mp = $me->me_mount
-			printf "%s on %s type %s, (mp 0x%x, privdata 0x%x)\n", \
+			printf "%s on %s type %s, (mp 0x%lx, privdata 0x%lx)\n", \
 			    $mp->mnt_stat->f_mntfromname, \
 			    $mp->mnt_stat->f_mntonname, \
 			    $mp->mnt_op->vfs_name, $mp, $mp->mnt_data

Reply via email to