summaryrefslogtreecommitdiffstats
path: root/sys/ddb
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-03-07 18:09:07 +0000
committerrwatson <rwatson@FreeBSD.org>2008-03-07 18:09:07 +0000
commitec7f28cdc2eacd5be82e2f3fc32c30510f4147af (patch)
treef2e2642155c3004e8006d5b13c617ba0b55a1df0 /sys/ddb
parent6fa0a5ca57560e5b65215d4d3449608cf5c19c5a (diff)
downloadFreeBSD-src-ec7f28cdc2eacd5be82e2f3fc32c30510f4147af.zip
FreeBSD-src-ec7f28cdc2eacd5be82e2f3fc32c30510f4147af.tar.gz
Add a /S mode to DDB "ex" command, which interprets and prints the
value at the requested address as a symbol. For example, "ex /S aio_swake" prints the name of the function currently registered in via aio_swake hook. The change as committed differs slightly from the patch in the PR, as I force the size of the retrieved value (and the automatic address increment) to be sizeof(void *). This seems to provide the most useful auto-increment behavior, and defaults using the default size (4), which is not sizeof(void *) on 64-bit platforms. MFC after: 3 days PR: 57976 Submitted by: Dan Strick <strick at covad.net>
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_examine.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c
index eba6151..fc4f472 100644
--- a/sys/ddb/db_examine.c
+++ b/sys/ddb/db_examine.c
@@ -166,6 +166,12 @@ db_examine(addr, fmt, count)
db_printf("\\%03o", (int)value);
}
break;
+ case 'S': /* symbol */
+ value = db_get_value(addr, sizeof(void *),
+ FALSE);
+ addr += sizeof(void *);
+ db_printsym(value, DB_STGY_ANY);
+ break;
case 'i': /* instruction */
addr = db_disasm(addr, FALSE);
break;
OpenPOWER on IntegriCloud