| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: ptrace.2,v 1.55 2017/01/14 14:33:18 wiz Exp $ | | 1 | .\" $NetBSD: ptrace.2,v 1.56 2017/01/15 22:18:11 kamil Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" This file is in the public domain. | | 3 | .\" This file is in the public domain. |
4 | .Dd January 14, 2016 | | 4 | .Dd January 14, 2016 |
5 | .Dt PTRACE 2 | | 5 | .Dt PTRACE 2 |
6 | .Os | | 6 | .Os |
7 | .Sh NAME | | 7 | .Sh NAME |
8 | .Nm ptrace | | 8 | .Nm ptrace |
9 | .Nd process tracing and debugging | | 9 | .Nd process tracing and debugging |
10 | .Sh LIBRARY | | 10 | .Sh LIBRARY |
11 | .Lb libc | | 11 | .Lb libc |
12 | .Sh SYNOPSIS | | 12 | .Sh SYNOPSIS |
13 | .In sys/types.h | | 13 | .In sys/types.h |
14 | .In sys/ptrace.h | | 14 | .In sys/ptrace.h |
| @@ -101,27 +101,27 @@ value set to | | | @@ -101,27 +101,27 @@ value set to |
101 | These events are by default disabled and can be configured with | | 101 | These events are by default disabled and can be configured with |
102 | .Dv PT_SET_EVENT_MASK . | | 102 | .Dv PT_SET_EVENT_MASK . |
103 | If this event occurs, | | 103 | If this event occurs, |
104 | check with | | 104 | check with |
105 | .Dv PT_GET_PROCESS_STATE | | 105 | .Dv PT_GET_PROCESS_STATE |
106 | the details of the process state associated with this event. | | 106 | the details of the process state associated with this event. |
107 | .Pp | | 107 | .Pp |
108 | A debugger might reuse a port specific symbols, | | 108 | A debugger might reuse a port specific symbols, |
109 | to help writing portable code as described in the port specific part of the | | 109 | to help writing portable code as described in the port specific part of the |
110 | .In sys/ptrace.h | | 110 | .In sys/ptrace.h |
111 | header. | | 111 | header. |
112 | Among these symbols, | | 112 | Among these symbols, |
113 | there are: | | 113 | there are: |
114 | .Bl -dash -tag | | 114 | .Bl -dash |
115 | .It | | 115 | .It |
116 | .Dv PTRACE_REG_PC | | 116 | .Dv PTRACE_REG_PC |
117 | .It | | 117 | .It |
118 | .Dv PTRACE_REG_SET_PC | | 118 | .Dv PTRACE_REG_SET_PC |
119 | .It | | 119 | .It |
120 | .Dv PTRACE_REG_SP | | 120 | .Dv PTRACE_REG_SP |
121 | .It | | 121 | .It |
122 | .Dv PTRACE_REG_INTRV | | 122 | .Dv PTRACE_REG_INTRV |
123 | .It | | 123 | .It |
124 | .Dv PTRACE_BREAKPOINT | | 124 | .Dv PTRACE_BREAKPOINT |
125 | .It | | 125 | .It |
126 | .Dv PTRACE_BREAKPOINT_SIZE | | 126 | .Dv PTRACE_BREAKPOINT_SIZE |
127 | .It | | 127 | .It |
| @@ -694,26 +694,31 @@ attempted to manipulate a process that w | | | @@ -694,26 +694,31 @@ attempted to manipulate a process that w |
694 | .It | | 694 | .It |
695 | An attempt was made to use | | 695 | An attempt was made to use |
696 | .Dv PT_ATTACH | | 696 | .Dv PT_ATTACH |
697 | on a process in violation of the requirements listed under | | 697 | on a process in violation of the requirements listed under |
698 | .Dv PT_ATTACH | | 698 | .Dv PT_ATTACH |
699 | above. | | 699 | above. |
700 | .El | | 700 | .El |
701 | .It Bq Er ESRCH | | 701 | .It Bq Er ESRCH |
702 | No process having the specified process ID exists. | | 702 | No process having the specified process ID exists. |
703 | .El | | 703 | .El |
704 | .Sh SEE ALSO | | 704 | .Sh SEE ALSO |
705 | .Xr sigaction 2 , | | 705 | .Xr sigaction 2 , |
706 | .Xr signal 7 | | 706 | .Xr signal 7 |
| | | 707 | .Sh HISTORY |
| | | 708 | The |
| | | 709 | .Fn ptrace |
| | | 710 | function appeared in |
| | | 711 | .At v7 . |
707 | .Sh BUGS | | 712 | .Sh BUGS |
708 | On the SPARC, the PC is set to the provided PC value for | | 713 | On the SPARC, the PC is set to the provided PC value for |
709 | .Dv PT_CONTINUE | | 714 | .Dv PT_CONTINUE |
710 | and similar calls, | | 715 | and similar calls, |
711 | but the NPC is set willy-nilly to 4 greater than the PC value. | | 716 | but the NPC is set willy-nilly to 4 greater than the PC value. |
712 | Using | | 717 | Using |
713 | .Dv PT_GETREGS | | 718 | .Dv PT_GETREGS |
714 | and | | 719 | and |
715 | .Dv PT_SETREGS | | 720 | .Dv PT_SETREGS |
716 | to modify the PC, passing | | 721 | to modify the PC, passing |
717 | .Li (void *)1 | | 722 | .Li (void *)1 |
718 | to | | 723 | to |
719 | .Eo \& | | 724 | .Eo \& |