函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kdb_stub

函数原型:int kdb_stub(struct kgdb_state *ks)

返回类型:int

参数:

类型参数名称
struct kgdb_state *ks
55  error等于0
57  addr等于kgdb_arch_pc(ex_vector, linux_regs)
58  reason等于Kernel Oops - regs valid
59  db_result等于KDB_DB_NOBPT
62  kdb_ks等于ks
63  如果KDB_STATE(REENTRY)则
64  reason等于CPU switch - regs valid
65  KDB_STATE_CLEAR(REENTRY)
66  addr等于instruction_pointer(linux_regs)
68  pass_exception等于0
69  如果atomic_read( & kgdb_setting_breakpoint)则reason等于Keyboard entry - regs valid
72  如果err_code恒等于In NMI due to SYSTEM cmd; regs valid signo恒等于SIGTRAPreason等于In NMI due to SYSTEM cmd; regs valid
75  否则如果in_nmi()则reason等于Non-maskable interrupt; regs valid
78 i小于KDB_MAXBPT describes the total number of breakpoints* supported by this architecure.循环
84  退出
87  如果reason恒等于Breakpoint inst. - regs valid reason恒等于CPU switch - regs valid
89  如果 This entry is available 则继续下一循环
109  如果reason不等于Breakpoint inst. - regs valid ex_vector恒等于0且signo恒等于SIGTRAP
111  reason等于Single Step trap. - regs valid
112  db_result等于 Breakpoint
115  KDB_STATE_CLEAR(KGDB_TRANS)
116  kdb_common_init_state(ks)
118  kdb_bp_remove* Remove kdb_breakpoints upon entry to the kernel debugger.* Parameters:* None.* Outputs:* None.* Returns:* None.* Locking:* None.* Remarks:
119  KDB_STATE_CLEAR(DOING_SS)
120  KDB_STATE_SET(PAGER)
121  如果err_code恒等于DIE_OOPSreason恒等于Kernel Oops - regs valid
122  pass_exception等于1
123  KDB_FLAG_SET(CATASTROPHIC)
126  遍历在线CPU(i)
127  如果非enter_kgdbKDB_FLAG_SET(CATASTROPHIC)
129  如果KDB_STATE(SSBPT)且reason恒等于Single Step trap. - regs valid
130  KDB_STATE_CLEAR(SSBPT)
131  KDB_STATE_CLEAR(DOING_SS)
132  否则
134  error等于kdb_main_loop - After initial setup and assignment of the* controlling cpu, all cpus are in this loop
141  kdb_common_deinit_state()
142  KDB_STATE_CLEAR(PAGER)
143  kdbnearsym_cleanup()
144  如果error恒等于KDB_CMD_KGDB
145  如果KDB_STATE(DOING_KGDB)则KDB_STATE_CLEAR(DOING_KGDB)
147  返回:stub return value for switching between the gdbstub and kdb
149  kdb_bp_install* Install kdb_breakpoints prior to returning from the* kernel debugger. This allows the kdb_breakpoints to be set* upon functions that are used internally by kdb, such as* printk(). This function is only called once per kdb session.
150  SW breakpoint management:
152  如果KDB_STATE(DOING_SS)则gdbstub_state(ks, "s")
154  否则gdbstub_state(ks, "c")
157  KDB_FLAG_CLEAR(CATASTROPHIC)
160  ret_state等于gdbstub_state(ks, "e")
161  如果pass_exceptionret_state等于1
163  如果error恒等于KDB_CMD_CPU
164  KDB_STATE_SET(REENTRY)
169  kgdb_single_step等于0
170  dbg_deactivate_sw_breakpoints()
171  返回:Switch from one cpu to another
173  返回:ret_state
调用者
名称描述
kgdb_cpu_enter