函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\debug\kdb\kdb_main.c Create Date:2022-07-27 12:45:27
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kdb_parse

函数原型:int kdb_parse(const char *cmdstr)

返回类型:int

参数:

类型参数名称
const char *cmdstr
919  ignore_errors等于0, check_grep等于0
924  cp等于cmdstr
926  如果KDB_FLAG(CMD_INTERRUPT)则
929  KDB_FLAG_CLEAR(CMD_INTERRUPT)
930  KDB_STATE_SET(PAGER)
931  argc等于0
934  如果cp不等于'\n'且cp不等于'\0'则
935  argc等于0
936  cpp等于cbuf
937 cp循环
940  cp自加
941  如果cp恒等于'\0'或cp恒等于'\n'或cp恒等于'#'且非defcmd_in_progress退出
945  如果cp恒等于'|'则
946  check_grep自加
947  退出
949  如果cpp大于等于cbufkdb_printf: max printline* size == 256
950  kdb_printf("kdb_parse: command buffer overflow, command ignored\n%s\n", cmdstr)
956  kdb_printf("kdb_parse: too many arguments, command ignored\n%s\n", cmdstr)
960  argv[argc++]等于cpp
961  escaped等于0
962  quoted等于'\0'
969  如果escaped
970  escaped等于0
971  cpp自加等于cp自加
972  继续下一循环
974  如果cp恒等于'\\'则
975  escaped等于1
976  cp先自加
977  继续下一循环
979  如果cp恒等于quotedquoted等于'\0'
981  否则如果cp恒等于'\''或cp恒等于'"'则quoted等于cp
983  cpp等于cp自加
984  如果cpp恒等于'='且非quoted退出
986  cpp先自加
988  cpp自加等于'\0'
991  如果非argc则返回:0
993  如果check_grepThe "str" argument may point to something like | grep xyz
995  如果defcmd_in_progress
996  result等于kdb_defcmd2(cmdstr, argv[0])
997  如果非defcmd_in_progress
998  argc等于0
999  *argv[0]等于'\0'
1001  返回:result
1003  如果argv[0][0]恒等于'-'且argv[0][1]且argv[0][1]小于'0'或argv[0][1]大于'9'的值则
1005  ignore_errors等于1
1006  argv[0]先自加
1010  如果Command name
1018  如果字符串指定长度比较恒等于0则
1021  退出
1025  如果字符串比较恒等于0则退出
1035  如果i恒等于kdb_max_commands
1037  如果Command name
1038  如果字符串指定长度比较恒等于0则
1041  退出
1047  如果i小于kdb_max_commands
1050  如果非Check whether the flags of the current command and the permissions* of the kdb console has allow a command to be run.则返回:KDB_NOPERM
1053  KDB_STATE_SET(CMD)
1054  result = ( * Function to execute command )(argc - 1, argv)
1055  如果resultignore_errorsresult大于Kernel Debugger Command codes. Must not overlap with error codes. result等于0
1057  KDB_STATE_CLEAR(CMD)
1059  如果Command behaviour flags 按位与 Repeat the command with args 则返回:result
1062  argc等于如果Command behaviour flags 按位与 Repeat the command w/o arguments 则1否则0
1063  如果argv[argc]则*argv[argc]等于'\0'
1065  返回:result
1077  char * name = NULL
1079  nextarg等于0
1086  kdb_printf("%s = ", argv[0])
1087  kdb_symbol_print - Standard method for printing a symbol name and offset
1088  kdb_printf("\n")
1089  返回:0
调用者
名称描述
kdb_exec_defcmdForward references
kdb_localkdb_local - The main code for kdb
kdb_cmd_initExecute any commands defined in kdb_cmds.
kdb_bt
gdb_cmd_queryHandle the 'q' query packets