Fri Dec 6 01:01:02 2019 UTC ()
it's mountlist not mount_list.  now 'mountdump' works again.


(mrg)
diff -r1.9 -r1.10 src/sys/gdbscripts/vchain

cvs diff -r1.9 -r1.10 src/sys/gdbscripts/vchain (switch to unified diff)

--- src/sys/gdbscripts/vchain 2017/04/13 09:52:18 1.9
+++ src/sys/gdbscripts/vchain 2019/12/06 01:01:02 1.10
@@ -1,70 +1,70 @@ @@ -1,70 +1,70 @@
1# $NetBSD: vchain,v 1.9 2017/04/13 09:52:18 hannken Exp $ 1# $NetBSD: vchain,v 1.10 2019/12/06 01:01:02 mrg Exp $
2 2
3# @(#)vchain 8.1 (Berkeley) 6/10/93 3# @(#)vchain 8.1 (Berkeley) 6/10/93
4# 4#
5 5
6define vchain 6define vchain
7 set $num = 0 7 set $num = 0
8 8
9 set $vp=(struct vnode *)$arg0 9 set $vp=(struct vnode *)$arg0
10 set $vi=(struct vnode_impl *)$arg0 10 set $vi=(struct vnode_impl *)$arg0
11 while ($vp) 11 while ($vp)
12 printf "vp: 0x%lx lrulist_next: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\ 12 printf "vp: 0x%lx lrulist_next: 0x%lx usecount: %d flags: i:0x%x v:0x%x u:0x%x\n",\
13 $vp, $vi->vi_lrulist.tqe_next, $vp->v_uobj.uo_refs, \ 13 $vp, $vi->vi_lrulist.tqe_next, $vp->v_uobj.uo_refs, \
14 $vp->v_iflag, $vp->v_vflag, $vp->v_uflag 14 $vp->v_iflag, $vp->v_vflag, $vp->v_uflag
15 set $num++ 15 set $num++
16 set $vp = $vp->v_mntvnodes.tqe_next 16 set $vp = $vp->v_mntvnodes.tqe_next
17 end 17 end
18 printf "Number of vnodes: %d\n", $num 18 printf "Number of vnodes: %d\n", $num
19end 19end
20 20
21document vchain 21document vchain
22Given a vnode, follow its mount pointers 22Given a vnode, follow its mount pointers
23end 23end
24 24
25define vprint 25define vprint
26 set $vp=(struct vnode *)$arg0 26 set $vp=(struct vnode *)$arg0
27 set $ip=(struct inode *)$vp->v_data 27 set $ip=(struct inode *)$vp->v_data
28end 28end
29 29
30define mp_vchain 30define mp_vchain
31 set $mp = (struct mount *)$arg0 31 set $mp = (struct mount *)$arg0
32 vchain $mp->mnt_vnodelist.tqh_first 32 vchain $mp->mnt_vnodelist.tqh_first
33end 33end
34document mp_vchain 34document mp_vchain
35print the vnode chain for a given mount point 35print the vnode chain for a given mount point
36end 36end
37 37
38define vall 38define vall
39 set $mp=mountlist.tqh_first 39 set $mp=mountlist.tqh_first
40 while ($mp) 40 while ($mp)
41 printf "\tmount point at 0x%x\n", $mp 41 printf "\tmount point at 0x%x\n", $mp
42 mp_vchain $mp 42 mp_vchain $mp
43 set $mp=$mp->mnt_list.tqe_next 43 set $mp=$mp->mnt_list.tqe_next
44 44
45 # "break" 45 # "break"
46 if ((const void *)$mp == (const void *)&mountlist) 46 if ((const void *)$mp == (const void *)&mountlist)
47 set $mp = 0 47 set $mp = 0
48 end 48 end
49 end 49 end
50end 50end
51document vall 51document vall
52print vnode chains for all mount points 52print vnode chains for all mount points
53end 53end
54 54
55define mountdump 55define mountdump
56 set $me=mount_list.tqh_first 56 set $me=mountlist.tqh_first
57 while ($me) 57 while ($me)
58 if ($me->me_type == ME_MOUNT) 58 if ($me->me_type == ME_MOUNT)
59 set $mp = $me->me_mount 59 set $mp = $me->me_mount
60 printf "%s on %s type %s, (mp 0x%x, privdata 0x%x)\n", \ 60 printf "%s on %s type %s, (mp 0x%x, privdata 0x%x)\n", \
61 $mp->mnt_stat->f_mntfromname, \ 61 $mp->mnt_stat->f_mntfromname, \
62 $mp->mnt_stat->f_mntonname, \ 62 $mp->mnt_stat->f_mntonname, \
63 $mp->mnt_op->vfs_name, $mp, $mp->mnt_data 63 $mp->mnt_op->vfs_name, $mp, $mp->mnt_data
64 end 64 end
65 set $me=$me->me_list.tqe_next 65 set $me=$me->me_list.tqe_next
66 if ((const void *)$me == (const void *)&mount_list) 66 if ((const void *)$me == (const void *)&mountlist)
67 set $me = 0 67 set $me = 0
68 end 68 end
69 end 69 end
70end 70end