Module Name: src
Committed By: mrg
Date: Mon May 6 02:41:02 UTC 2019
Modified Files:
src/sys/gdbscripts: procs
Added Files:
src/sys/gdbscripts: devs
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/gdbscripts/devs
cvs rdiff -u -r1.2 -r1.3 src/sys/gdbscripts/procs
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/gdbscripts/procs
diff -u src/sys/gdbscripts/procs:1.2 src/sys/gdbscripts/procs:1.3
--- src/sys/gdbscripts/procs:1.2 Wed Nov 18 18:05:51 2009
+++ src/sys/gdbscripts/procs Mon May 6 02:41:02 2019
@@ -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++
Added files:
Index: src/sys/gdbscripts/devs
diff -u /dev/null src/sys/gdbscripts/devs:1.1
--- /dev/null Mon May 6 02:41:02 2019
+++ src/sys/gdbscripts/devs Mon May 6 02:41:02 2019
@@ -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