git: 7ce58d4e8c0c - main - ddb: add _FLAGS command variants
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 05 Jul 2022 15:08:58 UTC
The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=7ce58d4e8c0cfcb42ec404aed6185b5eb7eef8a8 commit 7ce58d4e8c0cfcb42ec404aed6185b5eb7eef8a8 Author: Mitchell Horne <mhorne@FreeBSD.org> AuthorDate: 2022-06-30 15:58:22 +0000 Commit: Mitchell Horne <mhorne@FreeBSD.org> CommitDate: 2022-07-05 14:56:42 +0000 ddb: add _FLAGS command variants Provide _FLAGS variants of the various command definition macros, in anticipation of adding a new flag. This can also be used for some existing commands which require special flag values. Reviewed by: markj MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35581 --- sys/ddb/ddb.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index 1ae278965dde..4e63907a6ed0 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -164,14 +164,22 @@ _func(db_expr_t addr, bool have_addr, db_expr_t count, char *modif) #define DB_FUNC(_name, _func, list, _flag, _more) \ _DB_FUNC(_cmd, _name, _func, list, _flag, _more) +#define DB_COMMAND_FLAGS(cmd_name, func_name, flags) \ + _DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, flags, NULL) #define DB_COMMAND(cmd_name, func_name) \ - _DB_FUNC(_cmd, cmd_name, func_name, db_cmd_table, 0, NULL) + DB_COMMAND_FLAGS(cmd_name, func_name, 0) +#define DB_ALIAS_FLAGS(alias_name, func_name, flags) \ + _DB_SET(_cmd, alias_name, func_name, db_cmd_table, flags, NULL) #define DB_ALIAS(alias_name, func_name) \ - _DB_SET(_cmd, alias_name, func_name, db_cmd_table, 0, NULL) + DB_ALIAS_FLAGS(alias_name, func_name, 0) +#define DB_SHOW_COMMAND_FLAGS(cmd_name, func_name, flags) \ + _DB_FUNC(_show, cmd_name, func_name, db_show_table, flags, NULL) #define DB_SHOW_COMMAND(cmd_name, func_name) \ - _DB_FUNC(_show, cmd_name, func_name, db_show_table, 0, NULL) + DB_SHOW_COMMAND_FLAGS(cmd_name, func_name, 0) +#define DB_SHOW_ALIAS_FLAGS(alias_name, func_name, flags) \ + _DB_SET(_show, alias_name, func_name, db_show_table, flags, NULL) #define DB_SHOW_ALIAS(alias_name, func_name) \ - _DB_SET(_show, alias_name, func_name, db_show_table, 0, NULL) + DB_SHOW_ALIAS_FLAGS(alias_name, func_name, 0) #define DB_SHOW_ALL_COMMAND(cmd_name, func_name) \ _DB_FUNC(_show_all, cmd_name, func_name, db_show_all_table, 0, NULL) #define DB_SHOW_ALL_ALIAS(alias_name, func_name) \