summaryrefslogtreecommitdiff
path: root/sys/gdbscripts
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2019-05-06 02:41:02 +0000
committermrg <mrg@NetBSD.org>2019-05-06 02:41:02 +0000
commit2f65a252f50af4a8c2c10f9be57fdef116a21056 (patch)
treed5a7c21fbc61f3d3ab96103971fb2e7870f038f7 /sys/gdbscripts
parent4f91c68756a1a94adf0b3d179c643d399133f2a0 (diff)
add a 'devs' script to display a list of all devices by device_t,
name, parent, private data. for procs, put the printf \n into the same line. non trivial speed up with large process table.
Diffstat (limited to 'sys/gdbscripts')
-rw-r--r--sys/gdbscripts/devs20
-rw-r--r--sys/gdbscripts/procs5
2 files changed, 22 insertions, 3 deletions
diff --git a/sys/gdbscripts/devs b/sys/gdbscripts/devs
new file mode 100644
index 00000000000..e818f074e0c
--- /dev/null
+++ b/sys/gdbscripts/devs
@@ -0,0 +1,20 @@
+# $NetBSD: devs,v 1.1 2019/05/06 02:41:02 mrg Exp $
+
+define devs
+ set $i = 0
+
+ while ($i < 2)
+ if ($i == 0)
+ set $d = alldevs.tqh_first
+ end
+ if ($d)
+ printf " device_t parent private dv_xname\n"
+ end
+ while ($d)
+ printf "%16lx %16lx %16lx %s\n", \
+ $d, $d->dv_parent, $d->dv_private, $d->dv_xname
+ set $d = $d->dv_list.tqe_next
+ end
+ set $i++
+ end
+end
diff --git a/sys/gdbscripts/procs b/sys/gdbscripts/procs
index 3db8303d515..8b3050a941c 100644
--- a/sys/gdbscripts/procs
+++ b/sys/gdbscripts/procs
@@ -1,4 +1,4 @@
-# $NetBSD: procs,v 1.2 2009/11/18 18:05:51 eeh Exp $
+# $NetBSD: procs,v 1.3 2019/05/06 02:41:02 mrg Exp $
define procs
set $i = 0
@@ -11,11 +11,10 @@ define procs
printf " proc pid flag stat nlwps lwp comm\n"
end
while ($p)
- printf "%16lx %5d %8x %4x %5d %16lx %s", \
+ printf "%16lx %5d %8x %4x %5d %16lx %s\n", \
$p, $p->p_pid, \
$p->p_flag, $p->p_stat, $p->p_nlwps, $p->p_lwps.lh_first, \
(char *) $p->p_comm
- printf "\n"
set $p = $p->p_list.le_next
end
set $i++