ptrace.h 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* `ptrace' debugger support interface. Linux/microblaze version.
  2. Copyright (C) 2001, 2002 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, write to the Free
  14. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  15. 02111-1307 USA. */
  16. #ifndef _SYS_PTRACE_H
  17. #define _SYS_PTRACE_H 1
  18. #include <features.h>
  19. __BEGIN_DECLS
  20. /* Type of the REQUEST argument to `ptrace.' */
  21. enum __ptrace_request
  22. {
  23. /* Indicate that the process making this request should be traced.
  24. All signals received by this process can be intercepted by its
  25. parent, and its parent can use the other `ptrace' requests. */
  26. PTRACE_TRACEME = 0,
  27. #define PT_TRACE_ME PTRACE_TRACEME
  28. /* Return the word in the process's text space at address ADDR. */
  29. PTRACE_PEEKTEXT = 1,
  30. #define PT_READ_I PTRACE_PEEKTEXT
  31. /* Return the word in the process's data space at address ADDR. */
  32. PTRACE_PEEKDATA = 2,
  33. #define PT_READ_D PTRACE_PEEKDATA
  34. /* Return the word in the process's user area at offset ADDR. */
  35. PTRACE_PEEKUSER = 3,
  36. #define PT_READ_U PTRACE_PEEKUSER
  37. /* Write the word DATA into the process's text space at address ADDR. */
  38. PTRACE_POKETEXT = 4,
  39. #define PT_WRITE_I PTRACE_POKETEXT
  40. /* Write the word DATA into the process's data space at address ADDR. */
  41. PTRACE_POKEDATA = 5,
  42. #define PT_WRITE_D PTRACE_POKEDATA
  43. /* Write the word DATA into the process's user area at offset ADDR. */
  44. PTRACE_POKEUSER = 6,
  45. #define PT_WRITE_U PTRACE_POKEUSER
  46. /* Continue the process. */
  47. PTRACE_CONT = 7,
  48. #define PT_CONTINUE PTRACE_CONT
  49. /* Kill the process. */
  50. PTRACE_KILL = 8,
  51. #define PT_KILL PTRACE_KILL
  52. /* Single step the process. */
  53. PTRACE_SINGLESTEP = 9,
  54. #define PT_STEP PTRACE_SINGLESTEP
  55. /* Attach to a process that is already running. */
  56. PTRACE_ATTACH = 16,
  57. #define PT_ATTACH PTRACE_ATTACH
  58. /* Detach from a process attached to with PTRACE_ATTACH. */
  59. PTRACE_DETACH = 17,
  60. #define PT_DETACH PTRACE_DETACH
  61. /* Continue and stop at the next (return from) syscall. */
  62. PTRACE_SYSCALL = 24
  63. #define PT_SYSCALL PTRACE_SYSCALL
  64. };
  65. /* Perform process tracing functions. REQUEST is one of the values
  66. above, and determines the action to be taken.
  67. For all requests except PTRACE_TRACEME, PID specifies the process to be
  68. traced.
  69. PID and the other arguments described above for the various requests should
  70. appear (those that are used for the particular request) as:
  71. pid_t PID, void *ADDR, int DATA, void *ADDR2
  72. after REQUEST. */
  73. extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
  74. __END_DECLS
  75. #endif /* _SYS_PTRACE_H */