agent.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /* Shared utility routines for GDB to interact with agent.
  2. Copyright (C) 2009-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program 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
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef COMMON_AGENT_H
  15. #define COMMON_AGENT_H
  16. #include "gdbsupport/preprocessor.h"
  17. int agent_run_command (int pid, const char *cmd, int len);
  18. int agent_look_up_symbols (void *);
  19. #define IPA_SYM_EXPORTED_NAME(SYM) gdb_agent_ ## SYM
  20. /* Define an entry in an IPA symbol list array. If IPA_SYM is used, the macro
  21. IPA_SYM_STRUCT_NAME must be defined to the structure name holding the IPA
  22. symbol addresses in that particular file, before including
  23. gdbsupport/agent.h. */
  24. #define IPA_SYM(SYM) \
  25. { \
  26. STRINGIFY (IPA_SYM_EXPORTED_NAME (SYM)), \
  27. offsetof (IPA_SYM_STRUCT_NAME, addr_ ## SYM) \
  28. }
  29. /* The size in bytes of the buffer used to talk to the IPA helper
  30. thread. */
  31. #define IPA_CMD_BUF_SIZE 1024
  32. bool agent_loaded_p (void);
  33. extern bool debug_agent;
  34. extern bool use_agent;
  35. /* Capability of agent. Different agents may have different capabilities,
  36. such as installing fast tracepoint or evaluating breakpoint conditions.
  37. Capabilities are represented by bit-maps, and each capability occupies one
  38. bit. */
  39. enum agent_capa
  40. {
  41. /* Capability to install fast tracepoint. */
  42. AGENT_CAPA_FAST_TRACE = 0x1,
  43. /* Capability to install static tracepoint. */
  44. AGENT_CAPA_STATIC_TRACE = (0x1 << 1),
  45. };
  46. bool agent_capability_check (enum agent_capa);
  47. void agent_capability_invalidate (void);
  48. #endif /* COMMON_AGENT_H */