Revert r298938: Change x/a to work similar to gdb.

This badly breaks x/ia: ddb and gdb syntax are quite different and it is
unclear if they can be reconciled.
This commit is contained in:
Pedro F. Giffuni 2016-05-06 20:28:28 +00:00
parent bec488d17d
commit 8c6a0d07a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=299194

View File

@ -89,6 +89,15 @@ db_examine(db_addr_t addr, char *fmt, int count)
case 'g':
size = 8;
break;
case 'a': /* address */
size = sizeof(void *);
/* always forces a new line */
if (db_print_position() != 0)
db_printf("\n");
db_prev = addr;
db_printsym(addr, DB_STGY_ANY);
db_printf(":\t");
break;
default:
if (db_print_position() == 0) {
/* Print the address. */
@ -99,18 +108,6 @@ db_examine(db_addr_t addr, char *fmt, int count)
width = size * 4;
switch (c) {
case 'a': /* address */
size = sizeof(void *);
value = db_get_value(addr, size, TRUE);
addr += size;
db_printsym(value, DB_STGY_ANY);
break;
case 'p':
size = sizeof(void *);
value = db_get_value(addr, size, TRUE);
addr += size;
db_printf("%p", (void *)value);
break;
case 'r': /* signed, current radix */
value = db_get_value(addr, size, true);
addr += size;
@ -176,7 +173,7 @@ db_examine(db_addr_t addr, char *fmt, int count)
default:
break;
}
if (db_print_position() != 0 || c == 'a' || c == 'p')
if (db_print_position() != 0)
db_end_line(1);
break;
}