NetBSD/sys/gdbscripts/xps

51 lines
931 B
Plaintext
Raw Normal View History

# $NetBSD: xps,v 1.5 2003/04/28 01:43:48 briggs Exp $
1997-02-13 02:35:06 +03:00
# 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)
2003-02-27 00:36:14 +03:00
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"
2003-02-27 00:36:14 +03:00
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
2003-02-27 00:36:14 +03:00
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