From 7c7b7f8e1bc300d13801758a74b8ab931906a928 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Fri, 7 Mar 2008 18:09:07 +0000 Subject: [PATCH] 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 --- sys/ddb/db_examine.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sys/ddb/db_examine.c b/sys/ddb/db_examine.c index eba6151926d7..fc4f47285f00 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;