函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Our handling of the processor debug registers is non-trivial.* We do not clear them on entry and exit from the kernel. Therefore* it is possible to get a watchpoint trap here from inside the kernel.* However, the code in

函数原型:__attribute__((__externally_visible__)) void do_debug(struct pt_regs *regs, long error_code)

返回类型:void

参数:

类型参数名称
struct pt_regs *regs
longerror_code
715  tsk等于当前进程
716  user_icebp等于0
720  In IST context, we explicitly disable preemption. This serves two* purposes: it makes it much less likely that we would accidentally* schedule in IST context and it will force a warning if we somehow* manage to schedule by accident.
722  These special macros can be used to get or set a debugging register(dr6, 6)
734  set_debugreg(0, 6)
737  dr6与等于Define reserved bits in DR6 which are always set to 1 的反
744  清除线程指定标志
746  如果此条件成立可能性小(为编译器优化)(!ser_mode(regs) determines whether a register set came from user* mode && (dr6 & single-step ) && is_sysenter_singlestep(regs))则
748  dr6与等于single-step 的反
749  如果非dr6则转到:exit
763  如果非dr6ser_mode(regs) determines whether a register set came from user* modeuser_icebp等于1
767  Debug status used for traps, single steps, etc... 等于dr6
770  如果kprobe_debug_handler(regs)则转到:exit
774  如果notify_die(DIE_DEBUG, "debug", regs, (long) & dr6, error_code, SIGTRAP)恒等于Clean way to return from the notifier and stop further calls.则转到:exit
782  debug_stack_usage_inc()
785  cond_local_irq_enable(regs)
787  如果v8086_mode(regs)则
788  handle_vm86_trap((structkernel_vm86_regs * )regs, error_code, X86_TRAP_DB)
790  cond_local_irq_disable(regs)
791  debug_stack_usage_dec()
792  转到:exit
795  如果WARN_ON_ONCE((dr6 & single-step ) && !ser_mode(regs) determines whether a register set came from user* mode)则
802  Debug status used for traps, single steps, etc... 与等于single-step 的反
803  Set thread flags in other task's structures.* See asm/thread_info.h for TIF_xxxx flags available:
804  flags与等于X86_EFLAGS_TF的反
806  si_code等于get_si_code( Debug status used for traps, single steps, etc... )
807  如果 Debug status used for traps, single steps, etc... 按位与single-step 按位或DR_TRAP_BITS的值或user_icebpsend_sigtrap(regs, error_code, si_code)
809  cond_local_irq_disable(regs)
810  debug_stack_usage_dec()
812  exit :
813  ist_exit(regs)