函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kdb_local - The main code for kdb

函数原型:static int kdb_local(kdb_reason_t reason, int error, struct pt_regs *regs, kdb_dbtrap_t db_result)

返回类型:int

参数:

类型参数名称
kdb_reason_treason
interror
struct pt_regs *regs
kdb_dbtrap_tdb_result
1187  kdb_current等于kdb_curr_task(These macros fold the SMP functionality into a single CPU system())
1191  kdb_go_count等于0
1192  如果reason恒等于Debug Fault - regs valid 则否则
1195  kdb_printf("\nEntering kdb (current=0x%px, pid %d) ", kdb_current, kdb_current ? 进程ID : 0)
1210  :db_result恒等于 Breakpoint
1211  kdb_printf("\nEntering kdb (0x%px, pid %d) ", kdb_current, 进程ID)
1216  kdb_printf("due to Debug @ "kdb_machreg_fmt"\n", instruction_pointer(regs))
1218  退出
1220  退出
1223  返回:1
1224  默认
1225  kdb_printf("kdb: Bad result from kdba_db_trap: %d\n", db_result)
1227  退出
1231  退出
1232  :reason恒等于KDB_ENTER() trap/fault - regs valid
1233  如果KDB_STATE(KEYBOARD)则kdb_printf("due to Keyboard Entry\n")
1235  否则kdb_printf("due to KDB_ENTER()\n")
1237  退出
1238  :reason恒等于Keyboard entry - regs valid
1239  KDB_STATE_SET(KEYBOARD)
1240  kdb_printf("due to Keyboard Entry\n")
1241  退出
1242  :reason恒等于KDB_ENTER_SLAVE() trap/fault - regs valid
1244  :reason恒等于CPU switch - regs valid
1245  kdb_printf("due to cpu switch\n")
1246  退出
1247  :reason恒等于Kernel Oops - regs valid
1248  kdb_printf("Oops: %s\n", kdb_diemsg)
1249  kdb_printf("due to oops @ "kdb_machreg_fmt"\n", instruction_pointer(regs))
1251  kdb_dumpregs(regs)
1252  退出
1253  :reason恒等于In NMI due to SYSTEM cmd; regs valid
1254  kdb_printf("due to System NonMaskable Interrupt\n")
1255  退出
1256  :reason恒等于Non-maskable interrupt; regs valid
1257  kdb_printf("due to NonMaskable Interrupt @ "kdb_machreg_fmt"\n", instruction_pointer(regs))
1260  退出
1261  :reason恒等于Single Step trap. - regs valid
1262  :reason恒等于Breakpoint inst. - regs valid
1263  kdb_printf("due to %s @ "kdb_machreg_fmt"\n", reason == Breakpoint inst. - regs valid ? "Breakpoint" : "SS trap", instruction_pointer(regs))
1270  如果db_result不等于 Breakpoint
1271  kdb_printf("kdb: error return from kdba_bp_trap: %d\n", db_result)
1274  返回:0
1276  退出
1277  :reason恒等于Recursive entry to kdb;* regs probably valid
1278  kdb_printf("due to Recursion @ "kdb_machreg_fmt"\n", instruction_pointer(regs))
1280  退出
1281  默认
1282  kdb_printf("kdb: unexpected reason code: %d\n", reason)
1284  返回:0
1287  当1循环
1291  kdb_nextline等于1
1292  KDB_STATE_CLEAR(SUPPRESS)
1293  kdb_grepping_flag等于0
1295  kdb_grep_string[0]等于'\0'
1297  cmdbuf等于cmd_cur
1298  cmdbuf等于'\0'
1299  *cmd_hist[cmd_head]等于'\0'
1301  do_full_getstr :
1306  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1308  如果defcmd_in_progressstrncat(kdb_prompt_str, "[defcmd]", kdb_printf: max printline* size == 256 )
1314  cmdbuf等于kdb_getstr* Print the prompt string and read a command from the* input device.* Parameters:* buffer Address of buffer to receive command* bufsize Size of buffer in bytes* prompt Pointer to string to use as prompt string* Returns:
1315  如果cmdbuf不等于'\n'则
1316  如果cmdbuf小于32则
1327  否则
1332  cmd_head等于cmd_head加1的和取模Command history
1333  如果cmd_head恒等于cmd_tailcmd_tail等于cmd_tail加1的和取模Command history
1337  cmdptr等于cmd_head
1338  diag等于kdb_parse(cmdbuf)
1341  kdb_printf("Unknown kdb command: '%s'\n", cmdbuf)
1342  diag等于0
1344  如果diag恒等于Kernel Debugger Command codes. Must not overlap with error codes. diag恒等于KDB_CMD_CPUdiag恒等于KDB_CMD_SSdiag恒等于KDB_CMD_KGDB退出
1350  如果diagkdb_cmderror(diag)
1354  返回:diag
调用者
名称描述
kdb_main_loopkdb_main_loop - After initial setup and assignment of the* controlling cpu, all cpus are in this loop