Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/gdbscripts add a 'devs' script to display a list of all ...



details:   https://anonhg.NetBSD.org/src/rev/93b5b8cbff30
branches:  trunk
changeset: 451101:93b5b8cbff30
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon May 06 02:41:02 2019 +0000

description:
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:

 sys/gdbscripts/devs  |  20 ++++++++++++++++++++
 sys/gdbscripts/procs |   5 ++---
 2 files changed, 22 insertions(+), 3 deletions(-)

diffs (46 lines):

diff -r 66c9309c4971 -r 93b5b8cbff30 sys/gdbscripts/devs
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/gdbscripts/devs       Mon May 06 02:41:02 2019 +0000
@@ -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 -r 66c9309c4971 -r 93b5b8cbff30 sys/gdbscripts/procs
--- a/sys/gdbscripts/procs      Mon May 06 02:24:37 2019 +0000
+++ b/sys/gdbscripts/procs      Mon May 06 02:41:02 2019 +0000
@@ -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 @@
                        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++



Home | Main Index | Thread Index | Old Index