Advertisement
Guest User

sys/ptrace.h

a guest
Dec 14th, 2014
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.03 KB | None | 0 0
  1. /* `ptrace' debugger support interface. Linux version.
  2. Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4.  
  5. The GNU C Library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9.  
  10. The GNU C Library is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. Lesser General Public License for more details.
  14.  
  15. You should have received a copy of the GNU Lesser General Public
  16. License along with the GNU C Library; if not, write to the Free
  17. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  18. 02111-1307 USA. */
  19.  
  20. #ifndef _SYS_PTRACE_H
  21. #define _SYS_PTRACE_H 1
  22.  
  23. #include <features.h>
  24.  
  25. __BEGIN_DECLS
  26.  
  27. /* Type of the REQUEST argument to `ptrace.' */
  28. enum __ptrace_request
  29. {
  30. /* Indicate that the process making this request should be traced.
  31. All signals received by this process can be intercepted by its
  32. parent, and its parent can use the other `ptrace' requests. */
  33. PTRACE_TRACEME = 0,
  34. #define PT_TRACE_ME PTRACE_TRACEME
  35.  
  36. /* Return the word in the process's text space at address ADDR. */
  37. PTRACE_PEEKTEXT = 1,
  38. #define PT_READ_I PTRACE_PEEKTEXT
  39.  
  40. /* Return the word in the process's data space at address ADDR. */
  41. PTRACE_PEEKDATA = 2,
  42. #define PT_READ_D PTRACE_PEEKDATA
  43.  
  44. /* Return the word in the process's user area at offset ADDR. */
  45. PTRACE_PEEKUSER = 3,
  46. #define PT_READ_U PTRACE_PEEKUSER
  47.  
  48. /* Write the word DATA into the process's text space at address ADDR. */
  49. PTRACE_POKETEXT = 4,
  50. #define PT_WRITE_I PTRACE_POKETEXT
  51.  
  52. /* Write the word DATA into the process's data space at address ADDR. */
  53. PTRACE_POKEDATA = 5,
  54. #define PT_WRITE_D PTRACE_POKEDATA
  55.  
  56. /* Write the word DATA into the process's user area at offset ADDR. */
  57. PTRACE_POKEUSER = 6,
  58. #define PT_WRITE_U PTRACE_POKEUSER
  59.  
  60. /* Continue the process. */
  61. PTRACE_CONT = 7,
  62. #define PT_CONTINUE PTRACE_CONT
  63.  
  64. /* Kill the process. */
  65. PTRACE_KILL = 8,
  66. #define PT_KILL PTRACE_KILL
  67.  
  68. /* Single step the process.
  69. This is not supported on all machines. */
  70. PTRACE_SINGLESTEP = 9,
  71. #define PT_STEP PTRACE_SINGLESTEP
  72.  
  73. /* Get all general purpose registers used by a processes.
  74. This is not supported on all machines. */
  75. PTRACE_GETREGS = 12,
  76. #define PT_GETREGS PTRACE_GETREGS
  77.  
  78. /* Set all general purpose registers used by a processes.
  79. This is not supported on all machines. */
  80. PTRACE_SETREGS = 13,
  81. #define PT_SETREGS PTRACE_SETREGS
  82.  
  83. /* Get all floating point registers used by a processes.
  84. This is not supported on all machines. */
  85. PTRACE_GETFPREGS = 14,
  86. #define PT_GETFPREGS PTRACE_GETFPREGS
  87.  
  88. /* Set all floating point registers used by a processes.
  89. This is not supported on all machines. */
  90. PTRACE_SETFPREGS = 15,
  91. #define PT_SETFPREGS PTRACE_SETFPREGS
  92.  
  93. /* Attach to a process that is already running. */
  94. PTRACE_ATTACH = 16,
  95. #define PT_ATTACH PTRACE_ATTACH
  96.  
  97. /* Detach from a process attached to with PTRACE_ATTACH. */
  98. PTRACE_DETACH = 17,
  99. #define PT_DETACH PTRACE_DETACH
  100.  
  101. /* Get all extended floating point registers used by a processes.
  102. This is not supported on all machines. */
  103. PTRACE_GETFPXREGS = 18,
  104. #define PT_GETFPXREGS PTRACE_GETFPXREGS
  105.  
  106. /* Set all extended floating point registers used by a processes.
  107. This is not supported on all machines. */
  108. PTRACE_SETFPXREGS = 19,
  109. #define PT_SETFPXREGS PTRACE_SETFPXREGS
  110.  
  111. /* Continue and stop at the next (return from) syscall. */
  112. PTRACE_SYSCALL = 24,
  113. #define PT_SYSCALL PTRACE_SYSCALL
  114.  
  115. /* E2k extentions. */
  116.  
  117. /* In protected mode return the descriptor-as-8-byte-adress
  118. * in the process's data space at address ADDR. */
  119. PTRACE_PEEKPTR = 0x100,
  120.  
  121. /* In protected mode write the word DATA (which respresents
  122. * descriptor-as-8-byte-adress) into the process's data space
  123. * at address ADDR. */
  124. PTRACE_POKEPTR = 0x101,
  125.  
  126. /* Return the tag of 4-byte in the process's data space at address ADDR. */
  127. PTRACE_PEEKTAG = 0x120,
  128.  
  129. /* Write the word DATA into the process's data space as a tag of 4-byte
  130. * at address ADDR. */
  131. PTRACE_POKETAG = 0x121,
  132.  
  133. /* Expand stack by one page */
  134. PTRACE_EXPAND_STACK = 0x130,
  135. };
  136.  
  137. /* Perform process tracing functions. REQUEST is one of the values
  138. above, and determines the action to be taken.
  139. For all requests except PTRACE_TRACEME, PID specifies the process to be
  140. traced.
  141.  
  142. PID and the other arguments described above for the various requests should
  143. appear (those that are used for the particular request) as:
  144. pid_t PID, void *ADDR, int DATA, void *ADDR2
  145. after REQUEST. */
  146. extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
  147.  
  148. __END_DECLS
  149.  
  150. #endif /* _SYS_PTRACE_H */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement