]> Pileus Git - ~andy/linux/blobdiff - arch/sh/kernel/ptrace_32.c
sh: Set the cfa_offset to 0 if we see a DW_CFA_def_cfa_register op
[~andy/linux] / arch / sh / kernel / ptrace_32.c
index f7b22dd83b0c125ada90571539eda06530d04613..c198eceaee94dbef536ee9e0db32a2a002abfea6 100644 (file)
@@ -34,6 +34,8 @@
 #include <asm/syscalls.h>
 #include <asm/fpu.h>
 
+#include <trace/syscall.h>
+
 /*
  * This routine will get a word off of the process kernel stack.
  */
@@ -334,6 +336,14 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
                                        [(addr - (long)&dummy->fpu) >> 2];
                } else if (addr == (long) &dummy->u_fpvalid)
                        tmp = !!tsk_used_math(child);
+               else if (addr == PT_TEXT_ADDR)
+                       tmp = child->mm->start_code;
+               else if (addr == PT_DATA_ADDR)
+                       tmp = child->mm->start_data;
+               else if (addr == PT_TEXT_END_ADDR)
+                       tmp = child->mm->end_code;
+               else if (addr == PT_TEXT_LEN)
+                       tmp = child->mm->end_code - child->mm->start_code;
                else
                        tmp = 0;
                ret = put_user(tmp, datap);
@@ -451,6 +461,9 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs)
                 */
                ret = -1L;
 
+       if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE)))
+               ftrace_syscall_enter(regs);
+
        if (unlikely(current->audit_context))
                audit_syscall_entry(audit_arch(), regs->regs[3],
                                    regs->regs[4], regs->regs[5],
@@ -467,6 +480,9 @@ asmlinkage void do_syscall_trace_leave(struct pt_regs *regs)
                audit_syscall_exit(AUDITSC_RESULT(regs->regs[0]),
                                   regs->regs[0]);
 
+       if (unlikely(test_thread_flag(TIF_SYSCALL_FTRACE)))
+               ftrace_syscall_exit(regs);
+
        step = test_thread_flag(TIF_SINGLESTEP);
        if (step || test_thread_flag(TIF_SYSCALL_TRACE))
                tracehook_report_syscall_exit(regs, step);