Skip to content

Instantly share code, notes, and snippets.

@Low-power
Created October 29, 2019 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Low-power/12c2656a5d5933dfe79c7981ed434a9f to your computer and use it in GitHub Desktop.
Save Low-power/12c2656a5d5933dfe79c7981ed434a9f to your computer and use it in GitHub Desktop.
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
end
set $v = $v->v_nmntvnodes.tqe_next
end
set $p = $p->mnt_list.tqe_next
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment