NetBSD/sys/gdbscripts/xps

51 lines
931 B
Plaintext

# $NetBSD: xps,v 1.5 2003/04/28 01:43:48 briggs Exp $
# xps
# kernel ps
#
# @(#)xps 8.3 (Berkeley) 8/22/94
define xps
set $i = 0
while ($i < 2)
if ($i == 0)
set $p = allproc.lh_first
end
if ($i == 1)
set $p = zombproc.lh_first
if ($p != 0)
printf "Zombies:\n"
end
end
if ($p)
printf " proc pid flag nlwps comm\n"
printf "\t\t lwp flag wchan\n"
end
while ($p)
printf "%#18lx %5d %8x %2x %d %s", \
$p, $p->p_pid, \
$p->p_flag, $p->p_stat, $p->p_nlwps, \
(char *) $p->p_comm
printf "\n"
set $l = $p->p_lwps.lh_first
set $j = 0
while ($j < $p->p_nlwps)
printf "\t\t%#08lx %3x %#18lx", \
$l, $l->l_flag, $l->l_wchan
if ($l->l_wmesg)
printf " (%s)", (char *)$l->l_wmesg
end
set $l = $l->l_list.le_next
printf "\n"
set $j++
end
set $p = $p->p_list.le_next
end
set $i++
end
end