Commit 4d21764d authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds

[PATCH] gdb/strace fix for 2.5.x

Yes, gdb and strace are broken on alpha since 2.5.6, IIRC.
Some necessary 'thread_info' changes still are missing in ptrace.c.

Fixed thus.
parent 0888c167
...@@ -106,7 +106,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno) ...@@ -106,7 +106,7 @@ get_reg_addr(struct task_struct * task, unsigned long regno)
zero = 0; zero = 0;
addr = &zero; addr = &zero;
} else { } else {
addr = (long *)((long)task + regoff[regno]); addr = (long *)((long)task->thread_info + regoff[regno]);
} }
return addr; return addr;
} }
...@@ -340,9 +340,9 @@ sys_ptrace(long request, long pid, long addr, long data, ...@@ -340,9 +340,9 @@ sys_ptrace(long request, long pid, long addr, long data,
if ((unsigned long) data > _NSIG) if ((unsigned long) data > _NSIG)
goto out; goto out;
if (request == PTRACE_SYSCALL) if (request == PTRACE_SYSCALL)
set_thread_flag(TIF_SYSCALL_TRACE); set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
else else
clear_thread_flag(TIF_SYSCALL_TRACE); clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data; child->exit_code = data;
wake_up_process(child); wake_up_process(child);
/* make sure single-step breakpoint is gone. */ /* make sure single-step breakpoint is gone. */
...@@ -371,7 +371,7 @@ sys_ptrace(long request, long pid, long addr, long data, ...@@ -371,7 +371,7 @@ sys_ptrace(long request, long pid, long addr, long data,
goto out; goto out;
/* Mark single stepping. */ /* Mark single stepping. */
child->thread_info->bpt_nsaved = -1; child->thread_info->bpt_nsaved = -1;
clear_thread_flag(TIF_SYSCALL_TRACE); clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
wake_up_process(child); wake_up_process(child);
child->exit_code = data; child->exit_code = data;
/* give it a chance to run. */ /* give it a chance to run. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment