ptrace.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. /* `ptrace' debugger support interface. FRV-Linux version.
  2. Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004
  3. Free Software Foundation, Inc.
  4. This file is part of the GNU C Library.
  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. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with the GNU C Library; if not, write to the Free
  15. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  16. 02111-1307 USA. */
  17. #ifndef _SYS_PTRACE_H
  18. #define _SYS_PTRACE_H 1
  19. #include <features.h>
  20. __BEGIN_DECLS
  21. /* Type of the REQUEST argument to `ptrace.' */
  22. enum __ptrace_request
  23. {
  24. /* Indicate that the process making this request should be traced.
  25. All signals received by this process can be intercepted by its
  26. parent, and its parent can use the other `ptrace' requests. */
  27. PTRACE_TRACEME = 0,
  28. #define PT_TRACE_ME PTRACE_TRACEME
  29. /* Return the word in the process's text space at address ADDR. */
  30. PTRACE_PEEKTEXT = 1,
  31. #define PT_READ_I PTRACE_PEEKTEXT
  32. /* Return the word in the process's data space at address ADDR. */
  33. PTRACE_PEEKDATA = 2,
  34. #define PT_READ_D PTRACE_PEEKDATA
  35. /* Return the word in the process's user area at offset ADDR. */
  36. PTRACE_PEEKUSER = 3,
  37. #define PT_READ_U PTRACE_PEEKUSER
  38. /* Write the word DATA into the process's text space at address ADDR. */
  39. PTRACE_POKETEXT = 4,
  40. #define PT_WRITE_I PTRACE_POKETEXT
  41. /* Write the word DATA into the process's data space at address ADDR. */
  42. PTRACE_POKEDATA = 5,
  43. #define PT_WRITE_D PTRACE_POKEDATA
  44. /* Write the word DATA into the process's user area at offset ADDR. */
  45. PTRACE_POKEUSER = 6,
  46. #define PT_WRITE_U PTRACE_POKEUSER
  47. /* Continue the process. */
  48. PTRACE_CONT = 7,
  49. #define PT_CONTINUE PTRACE_CONT
  50. /* Kill the process. */
  51. PTRACE_KILL = 8,
  52. #define PT_KILL PTRACE_KILL
  53. /* Single step the process.
  54. This is not supported on all machines. */
  55. PTRACE_SINGLESTEP = 9,
  56. #define PT_STEP PTRACE_SINGLESTEP
  57. /* Get all general purpose registers used by a processes.
  58. This is not supported on all machines. */
  59. PTRACE_GETREGS = 12,
  60. #define PT_GETREGS PTRACE_GETREGS
  61. /* Set all general purpose registers used by a processes.
  62. This is not supported on all machines. */
  63. PTRACE_SETREGS = 13,
  64. #define PT_SETREGS PTRACE_SETREGS
  65. /* Get all floating point registers used by a processes.
  66. This is not supported on all machines. */
  67. PTRACE_GETFPREGS = 14,
  68. #define PT_GETFPREGS PTRACE_GETFPREGS
  69. /* Set all floating point registers used by a processes.
  70. This is not supported on all machines. */
  71. PTRACE_SETFPREGS = 15,
  72. #define PT_SETFPREGS PTRACE_SETFPREGS
  73. /* Attach to a process that is already running. */
  74. PTRACE_ATTACH = 16,
  75. #define PT_ATTACH PTRACE_ATTACH
  76. /* Detach from a process attached to with PTRACE_ATTACH. */
  77. PTRACE_DETACH = 17,
  78. #define PT_DETACH PTRACE_DETACH
  79. /* Get all extended floating point registers used by a processes.
  80. This is not supported on all machines. */
  81. PTRACE_GETFPXREGS = 18,
  82. #define PT_GETFPXREGS PTRACE_GETFPXREGS
  83. /* Set all extended floating point registers used by a processes.
  84. This is not supported on all machines. */
  85. PTRACE_SETFPXREGS = 19,
  86. #define PT_SETFPXREGS PTRACE_SETFPXREGS
  87. /* Continue and stop at the next (return from) syscall. */
  88. PTRACE_SYSCALL = 24,
  89. #define PT_SYSCALL PTRACE_SYSCALL
  90. /* Obtain the load map of the main program or the interpreter of the
  91. ptraced process, depending on whether the addr argument is
  92. (void*)0 or (void*)1, respectively. */
  93. PTRACE_GETFDPIC = 31
  94. #define PT_GETFDPIC PTRACE_GETFDPIC
  95. };
  96. #define PTRACE_GETFDPIC_EXEC ((void*)0) /* [addr] request the executable loadmap */
  97. #define PTRACE_GETFDPIC_INTERP ((void*)1) /* [addr] request the interpreter loadmap */
  98. /* Perform process tracing functions. REQUEST is one of the values
  99. above, and determines the action to be taken.
  100. For all requests except PTRACE_TRACEME, PID specifies the process to be
  101. traced.
  102. PID and the other arguments described above for the various requests should
  103. appear (those that are used for the particular request) as:
  104. pid_t PID, void *ADDR, int DATA, void *ADDR2
  105. after REQUEST. */
  106. extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
  107. __END_DECLS
  108. #endif /* _SYS_PTRACE_H */