Index: sys/ddb/db_command.c =================================================================== --- sys/ddb/db_command.c +++ sys/ddb/db_command.c @@ -481,11 +481,13 @@ db_disable_pager(); db_lex_wspace = ((cmd->flag & CS_LEX_SPACE) != 0); + db_lex_hex = ((cmd->flag & CS_LEX_HEX) != 0); db_cmd_radix = -1; (*cmd->fcn)(addr, have_addr, count, modif); db_lex_wspace = false; + db_lex_hex = false; db_cmd_radix = -1; if (dopager) Index: sys/ddb/db_lex.h =================================================================== --- sys/ddb/db_lex.h +++ sys/ddb/db_lex.h @@ -45,6 +45,7 @@ int db_read_token(void); void db_unread_token(int t); +extern bool db_lex_hex; extern bool db_lex_wspace; extern db_expr_t db_tok_number; #define TOK_STRING_SIZE 120 @@ -86,5 +87,7 @@ #define tQUESTION 33 #define tBIT_NOT 34 #define tWSPACE 35 +#define tCOLON 36 +#define tCOLONCOLON 37 #endif /* !_DDB_DB_LEX_H_ */ Index: sys/ddb/db_lex.c =================================================================== --- sys/ddb/db_lex.c +++ sys/ddb/db_lex.c @@ -42,6 +42,7 @@ #include #include +bool db_lex_hex; bool db_lex_wspace; static char db_line[DB_MAXLINE]; @@ -183,13 +184,16 @@ return (tWSPACE); } - if (c >= '0' && c <= '9') { + if ((c >= '0' && c <= '9') || + (db_lex_hex && + ((c >= 'a' && c <= 'f') || + (c >= 'A' && c <= 'F')))) { /* number */ int r, digit = 0; if (db_cmd_radix != -1) r = db_cmd_radix; - else if (c > '0') + else if (c != '0') r = db_radix; else { c = db_read_char(); @@ -318,6 +322,12 @@ } db_unread_char(c); return (tEXCL); + case ':': + c = db_read_char(); + if (c == ':') + return (tCOLONCOLON); + db_unread_char(c); + return (tCOLON); case ';': return (tSEMI); case '&': Index: sys/ddb/ddb.h =================================================================== --- sys/ddb/ddb.h +++ sys/ddb/ddb.h @@ -122,6 +122,7 @@ * at end */ #define CS_LEX_SPACE 0x4 /* Switch the lexer to explicitly yield whitespace (tWSPACE) during cmd. */ +#define CS_LEX_HEX 0x8 /* Allow numbers starting with a-f */ #define CS_SET_DOT 0x100 /* set dot after command */ struct command_table *more; /* another level of command */ LIST_ENTRY(command) next; /* next entry in the command table */