函数逻辑报告 |
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 |
注解内核,赢得工具 | 下载SCCT | English |
函数名称: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_t | reason | |
int | error | |
struct pt_regs * | regs | |
kdb_dbtrap_t | db_result |
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) |
1203 | 当:reason恒等于Debug Fault - regs valid |
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 | 退出 |
1219 | 当:db_result恒等于 Single-step trap |
1220 | 退出 |
1221 | 当:db_result恒等于 Single step over breakpoint |
1223 | 返回:1 |
1224 | 默认 |
1225 | kdb_printf("kdb: Bad result from kdba_db_trap: %d\n", db_result) |
1227 | 退出 |
1231 | 退出 |
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 |
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 | 退出 |
1254 | kdb_printf("due to System NonMaskable Interrupt\n") |
1255 | 退出 |
1257 | kdb_printf("due to NonMaskable Interrupt @ "kdb_machreg_fmt"\n", instruction_pointer(regs)) |
1260 | 退出 |
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 | 退出 |
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' |
1298 | cmdbuf等于'\0' |
1301 | do_full_getstr : |
1308 | 如果defcmd_in_progress则strncat(kdb_prompt_str, "[defcmd]", kdb_printf: max printline* size == 256 ) |
1315 | 如果cmdbuf不等于'\n'则 |
1316 | 如果cmdbuf小于32则 |
1323 | 如果非handle_ctrl_cmd(cmdbuf)则*cmd_cur加strlen - Find the length of a string*@s: The string to be sized减1的差等于'\0' |
1326 | 转到:do_full_getstr |
1327 | 否则 |
1332 | cmd_head等于cmd_head加1的和取模Command history |
1333 | 如果cmd_head恒等于cmd_tail则cmd_tail等于cmd_tail加1的和取模Command history |
1344 | 如果diag恒等于Kernel Debugger Command codes. Must not overlap with error codes. 或diag恒等于KDB_CMD_CPU或diag恒等于KDB_CMD_SS或diag恒等于KDB_CMD_KGDB则退出 |
1350 | 如果diag则kdb_cmderror(diag) |
1354 | 返回:diag |
名称 | 描述 |
---|---|
kdb_main_loop | kdb_main_loop - After initial setup and assignment of the* controlling cpu, all cpus are in this loop |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |