Module Name: src
Committed By: ryo
Date: Tue Sep 10 08:16:05 UTC 2019
Modified Files:
src/share/man/man4: ddb.4
src/sys/ddb: db_examine.c
Log Message:
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")
To generate a diff of this commit:
cvs rdiff -u -r1.185 -r1.186 src/share/man/man4/ddb.4
cvs rdiff -u -r1.37 -r1.38 src/sys/ddb/db_examine.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/share/man/man4/ddb.4
diff -u src/share/man/man4/ddb.4:1.185 src/share/man/man4/ddb.4:1.186
--- src/share/man/man4/ddb.4:1.185 Sun Jul 21 15:51:58 2019
+++ src/share/man/man4/ddb.4 Tue Sep 10 08:16:04 2019
@@ -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 @@ Non-printing characters are displayed as
.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
Index: src/sys/ddb/db_examine.c
diff -u src/sys/ddb/db_examine.c:1.37 src/sys/ddb/db_examine.c:1.38
--- src/sys/ddb/db_examine.c:1.37 Sun Feb 3 03:19:26 2019
+++ src/sys/ddb/db_examine.c Tue Sep 10 08:16:05 2019
@@ -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 @@ db_examine(db_addr_t addr, char *fmt, in
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;