ptrace.h 645 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2020, Itamar S. <itamar8910@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <sys/types.h>
  8. __BEGIN_DECLS
  9. #define PT_TRACE_ME 1
  10. #define PT_ATTACH 2
  11. #define PT_CONTINUE 3
  12. #define PT_SYSCALL 4
  13. #define PT_GETREGS 5
  14. #define PT_DETACH 6
  15. #define PT_PEEK 7
  16. #define PT_POKE 8
  17. #define PT_SETREGS 9
  18. #define PT_POKEDEBUG 10
  19. #define PT_PEEKDEBUG 11
  20. #define DEBUG_STATUS_REGISTER 6
  21. #define DEBUG_CONTROL_REGISTER 7
  22. // FIXME: PID/TID ISSUE
  23. // Affects the entirety of LibDebug and Userland/strace.cpp.
  24. // See also Kernel/Ptrace.cpp
  25. int ptrace(int request, pid_t tid, void* addr, int data);
  26. __END_DECLS