powerpc.patch

来自「Linux-2.6.18内核调试工具补丁程序KGDB。」· PATCH 代码 · 共 44 行

PATCH
44
字号
Signed-Off-By Milind Dumbare <milind@linsyssoft.com> kgdb.c |   23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-)Index: linux-2.6.15-ppc-cope-singlestep/arch/ppc/kernel/kgdb.c===================================================================--- linux-2.6.15-ppc-cope-singlestep.orig/arch/ppc/kernel/kgdb.c	2006-02-24 08:45:37.000000000 +0530+++ linux-2.6.15-ppc-cope-singlestep/arch/ppc/kernel/kgdb.c	2006-02-24 08:52:14.000000000 +0530@@ -105,10 +105,31 @@  static int kgdb_singlestep(struct pt_regs *regs) {+	struct thread_info *thread_info, *exception_thread_info;+ 	if (user_mode(regs)) 		return 0;-+	/*+	* On Book E and perhaps other processsors, singlestep is handled on+	* the critical exception stack.  This causes current_thread_info()+	* to fail, since it it locates the thread_info by masking off+	* the low bits of the current stack pointer.  We work around+	* this issue by copying the thread_info from the kernel stack+	* before calling kgdb_handle_exception, and copying it back+	* afterwards.  On most processors the copy is avoided since+	* exception_thread_info == thread_info.+	*/+	thread_info = (struct thread_info *)(regs->gpr[1] & ~(THREAD_SIZE-1));+	exception_thread_info = current_thread_info();++	if (thread_info != exception_thread_info)+		memcpy(exception_thread_info, thread_info, sizeof *thread_info);+  	kgdb_handle_exception(0, SIGTRAP, 0, regs);++	if (thread_info != exception_thread_info)+		memcpy(thread_info, exception_thread_info, sizeof *thread_info);+ 	return 1; } 

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?