583
void user_enable_single_step(struct task_struct *child)
585
unsigned long next_pc;
586
unsigned long pc, insn;
588
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
590
/* Compute next pc. */
591
pc = get_stack_long(child, PT_BPC);
593
if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0)
597
compute_next_pc(insn, pc, &next_pc, child);
598
if (next_pc & 0x80000000)
601
if (embed_debug_trap(child, next_pc))
608
void user_disable_single_step(struct task_struct *child)
610
unregister_all_debug_traps(child);
585
615
* Called by kernel/ptrace.c when detaching..
595
arch_ptrace(struct task_struct *child, long request, long addr, long data)
625
arch_ptrace(struct task_struct *child, long request,
626
unsigned long addr, unsigned long data)
629
unsigned long __user *datap = (unsigned long __user *) data;
599
631
switch (request) {
609
641
* read the word at location addr in the USER area.
611
643
case PTRACE_PEEKUSR:
612
ret = ptrace_read_user(child, addr,
613
(unsigned long __user *)data);
644
ret = ptrace_read_user(child, addr, datap);
630
661
ret = ptrace_write_user(child, addr, data);
634
* continue/restart and stop at next (return from) syscall
639
if (!valid_signal(data))
641
if (request == PTRACE_SYSCALL)
642
set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
644
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
645
child->exit_code = data;
646
wake_up_process(child);
651
* make the child exit. Best I can do is send it a sigkill.
652
* perhaps it should be put in the status that it wants to
657
unregister_all_debug_traps(child);
659
if (child->exit_state == EXIT_ZOMBIE) /* already dead */
661
child->exit_code = SIGKILL;
662
wake_up_process(child);
667
* execute single instruction.
669
case PTRACE_SINGLESTEP: {
670
unsigned long next_pc;
671
unsigned long pc, insn;
674
if (!valid_signal(data))
676
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
678
/* Compute next pc. */
679
pc = get_stack_long(child, PT_BPC);
681
if (access_process_vm(child, pc&~3, &insn, sizeof(insn), 0)
685
compute_next_pc(insn, pc, &next_pc, child);
686
if (next_pc & 0x80000000)
689
if (embed_debug_trap(child, next_pc))
693
child->exit_code = data;
695
/* give it a chance to run. */
696
wake_up_process(child);
701
664
case PTRACE_GETREGS:
702
ret = ptrace_getregs(child, (void __user *)data);
665
ret = ptrace_getregs(child, datap);
705
668
case PTRACE_SETREGS:
706
ret = ptrace_setregs(child, (void __user *)data);
669
ret = ptrace_setregs(child, datap);