Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
kgdb(1) script for clearing VV_TEXT flag from every vnode in kFreeBSD
# This file has no copyright assigned and is placed in the Public Domain.
# No warranty is given.
# Usage: kgdb -w < clear-all-vnodes-text-flag.gdb
set $p = mountlist.tqh_first
while $p != 0
set $v = $p->mnt_nvnodelist.tqh_first
while $v != 0
if $v->v_type == VREG
#set $v->v_vflag &= ~VV_TEXT
set $v->v_vflag &= ~0x20
set $v = $v->v_nmntvnodes.tqe_next
set $p = $p->mnt_list.tqe_next
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment