Whenever present, use the CONFIG_FRAME_POINTER option while compiling the kernel with KDB. 在编译带KDB的内核时,只要CONFIGFRAMEPOINTER选项出现就使用该选项。
If the CONFIG_FRAME_POINTER option was set during kernel compilation, the frame pointer register is used to maintain stacks and, hence, the stack traceback can be performed correctly. 如果内核编译期间设置了CONFIGFRAMEPOINTER选项,那么就用帧指针(FP)寄存器来维护堆栈,从而就可以正确地执行堆栈回溯。
This will lead to better stack tracebacks, as the frame pointer register is used as a frame pointer rather than a general purpose register. 这将产生更好的堆栈回溯,因为帧指针(FP)寄存器被用作帧指针(FP)而不是通用寄存器。
You could, in fact, manually dump the contents of the frame pointer register and trace the entire stack. 实际上,您可以手工转储帧指针(FP)寄存器的内容并跟踪整个堆栈。
Next, the current stack frame pointer is stored as the back pointer for the next stack frame, even though you haven't established the stack frame yet ( this is done through negative offsets ). 接下来,当前堆栈框架指针会被存储为指向下一个堆栈框架的后向指针,虽然尚未建立堆栈框架(这是通过负的偏移量实现的)。