Source-Changes-HG archive

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

[src/trunk]: src Add support for 'p' qualifier for pointer values on examine.



details:   https://anonhg.NetBSD.org/src/rev/a952feff8d74
branches:  trunk
changeset: 454217:a952feff8d74
user:      ryo <ryo%NetBSD.org@localhost>
date:      Tue Sep 10 08:16:04 2019 +0000

description:
Add support for 'p' qualifier for pointer values on examine.
this shows as a pointer with symbol if possible. (e.g. "x/p $sp,10")

diffstat:

 share/man/man4/ddb.4 |   6 ++++--
 sys/ddb/db_examine.c |  12 ++++++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r 43550048ce7b -r a952feff8d74 share/man/man4/ddb.4
--- a/share/man/man4/ddb.4      Mon Sep 09 22:01:23 2019 +0000
+++ b/share/man/man4/ddb.4      Tue Sep 10 08:16:04 2019 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: ddb.4,v 1.185 2019/07/21 15:51:58 rin Exp $
+.\"    $NetBSD: ddb.4,v 1.186 2019/09/10 08:16:04 ryo Exp $
 .\"
 .\" Copyright (c) 1997 - 2009 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -56,7 +56,7 @@
 .\" any improvements or extensions that they make and grant Carnegie Mellon
 .\" the rights to redistribute these changes.
 .\"
-.Dd July 21, 2019
+.Dd September 10, 2019
 .Dt DDB 4
 .Os
 .Sh NAME
@@ -441,6 +441,8 @@
 .It Cm m
 display in unsigned hex with a character dump at the end of each line.
 The location is displayed as hex at the beginning of each line.
+.It Cm p
+display as a pointer and it's symbol if possible.
 .It Cm i
 display as a machine instruction.
 .It Cm I
diff -r 43550048ce7b -r a952feff8d74 sys/ddb/db_examine.c
--- a/sys/ddb/db_examine.c      Mon Sep 09 22:01:23 2019 +0000
+++ b/sys/ddb/db_examine.c      Tue Sep 10 08:16:04 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_examine.c,v 1.37 2019/02/03 03:19:26 mrg Exp $      */
+/*     $NetBSD: db_examine.c,v 1.38 2019/09/10 08:16:05 ryo Exp $      */
 
 /*
  * Mach Operating System
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_examine.c,v 1.37 2019/02/03 03:19:26 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_examine.c,v 1.38 2019/09/10 08:16:05 ryo Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -115,6 +115,14 @@
                        case 'a':       /* address */
                                db_printf("= 0x%lx\n", (long)addr);
                                break;
+                       case 'p':
+                               size = sizeof(void *);
+                               value = db_get_value(addr, size, true);
+                               addr += size;
+                               db_printf("= 0x%lx ", (long)value);
+                               db_printsym((db_addr_t)value, DB_STGY_ANY, db_printf);
+                               db_printf("\n");
+                               break;
                        case 'r':       /* signed, current radix */
                                value = db_get_value(addr, size, true);
                                addr += size;



Home | Main Index | Thread Index | Old Index