ptrace.h 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. /* `ptrace' debugger support interface. Linux/v850 version.
  2. Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_PTRACE_H
  16. #define _SYS_PTRACE_H 1
  17. #include <features.h>
  18. __BEGIN_DECLS
  19. /* Type of the REQUEST argument to `ptrace.' */
  20. enum __ptrace_request
  21. {
  22. /* Indicate that the process making this request should be traced.
  23. All signals received by this process can be intercepted by its
  24. parent, and its parent can use the other `ptrace' requests. */
  25. PTRACE_TRACEME = 0,
  26. #define PT_TRACE_ME PTRACE_TRACEME
  27. /* Return the word in the process's text space at address ADDR. */
  28. PTRACE_PEEKTEXT = 1,
  29. #define PT_READ_I PTRACE_PEEKTEXT
  30. /* Return the word in the process's data space at address ADDR. */
  31. PTRACE_PEEKDATA = 2,
  32. #define PT_READ_D PTRACE_PEEKDATA
  33. /* Return the word in the process's user area at offset ADDR. */
  34. PTRACE_PEEKUSER = 3,
  35. #define PT_READ_U PTRACE_PEEKUSER
  36. /* Write the word DATA into the process's text space at address ADDR. */
  37. PTRACE_POKETEXT = 4,
  38. #define PT_WRITE_I PTRACE_POKETEXT
  39. /* Write the word DATA into the process's data space at address ADDR. */
  40. PTRACE_POKEDATA = 5,
  41. #define PT_WRITE_D PTRACE_POKEDATA
  42. /* Write the word DATA into the process's user area at offset ADDR. */
  43. PTRACE_POKEUSER = 6,
  44. #define PT_WRITE_U PTRACE_POKEUSER
  45. /* Continue the process. */
  46. PTRACE_CONT = 7,
  47. #define PT_CONTINUE PTRACE_CONT
  48. /* Kill the process. */
  49. PTRACE_KILL = 8,
  50. #define PT_KILL PTRACE_KILL
  51. /* Single step the process. */
  52. PTRACE_SINGLESTEP = 9,
  53. #define PT_STEP PTRACE_SINGLESTEP
  54. /* Attach to a process that is already running. */
  55. PTRACE_ATTACH = 16,
  56. #define PT_ATTACH PTRACE_ATTACH
  57. /* Detach from a process attached to with PTRACE_ATTACH. */
  58. PTRACE_DETACH = 17,
  59. #define PT_DETACH PTRACE_DETACH
  60. /* Continue and stop at the next (return from) syscall. */
  61. PTRACE_SYSCALL = 24
  62. #define PT_SYSCALL PTRACE_SYSCALL
  63. };
  64. /* Perform process tracing functions. REQUEST is one of the values
  65. above, and determines the action to be taken.
  66. For all requests except PTRACE_TRACEME, PID specifies the process to be
  67. traced.
  68. PID and the other arguments described above for the various requests should
  69. appear (those that are used for the particular request) as:
  70. pid_t PID, void *ADDR, int DATA, void *ADDR2
  71. after REQUEST. */
  72. extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
  73. __END_DECLS
  74. #endif /* _SYS_PTRACE_H */