gdb/gdbserver/tracepoint.h - gdb

Data types defined

Macros defined

Source code

  1. /* Tracepoint code for remote server for GDB.
  2.    Copyright (C) 1993-2015 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 TRACEPOINT_H
  15. #define TRACEPOINT_H

  16. /* Size for a small buffer to report problems from the in-process
  17.    agent back to GDBserver.  */
  18. #define IPA_BUFSIZ 100

  19. void initialize_tracepoint (void);

  20. extern int tracing;
  21. extern int disconnected_tracing;

  22. void tracepoint_look_up_symbols (void);

  23. void stop_tracing (void);

  24. int handle_tracepoint_general_set (char *own_buf);
  25. int handle_tracepoint_query (char *own_buf);

  26. int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc);
  27. int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc);

  28. void release_while_stepping_state_list (struct thread_info *tinfo);

  29. extern int current_traceframe;

  30. int in_readonly_region (CORE_ADDR addr, ULONGEST length);
  31. int traceframe_read_mem (int tfnum, CORE_ADDR addr,
  32.                          unsigned char *buf, ULONGEST length,
  33.                          ULONGEST *nbytes);
  34. int fetch_traceframe_registers (int tfnum,
  35.                                 struct regcache *regcache,
  36.                                 int regnum);

  37. int traceframe_read_sdata (int tfnum, ULONGEST offset,
  38.                            unsigned char *buf, ULONGEST length,
  39.                            ULONGEST *nbytes);

  40. int traceframe_read_info (int tfnum, struct buffer *buffer);

  41. /* If a thread is determined to be collecting a fast tracepoint, this
  42.    structure holds the collect status.  */

  43. struct fast_tpoint_collect_status
  44. {
  45.   /* The tracepoint that is presently being collected.  */
  46.   int tpoint_num;
  47.   CORE_ADDR tpoint_addr;

  48.   /* The address range in the jump pad of where the original
  49.      instruction the tracepoint jump was inserted was relocated
  50.      to.  */
  51.   CORE_ADDR adjusted_insn_addr;
  52.   CORE_ADDR adjusted_insn_addr_end;
  53. };

  54. int fast_tracepoint_collecting (CORE_ADDR thread_area,
  55.                                 CORE_ADDR stop_pc,
  56.                                 struct fast_tpoint_collect_status *status);
  57. void force_unlock_trace_buffer (void);

  58. int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc);

  59. #ifdef IN_PROCESS_AGENT
  60. void initialize_low_tracepoint (void);
  61. void supply_fast_tracepoint_registers (struct regcache *regcache,
  62.                                        const unsigned char *regs);
  63. void supply_static_tracepoint_registers (struct regcache *regcache,
  64.                                          const unsigned char *regs,
  65.                                          CORE_ADDR pc);
  66. void set_trampoline_buffer_space (CORE_ADDR begin, CORE_ADDR end,
  67.                                   char *errmsg);

  68. extern const struct target_desc *ipa_tdesc;

  69. #else
  70. void stop_tracing (void);

  71. int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline);
  72. int have_fast_tracepoint_trampoline_buffer (char *msgbuf);
  73. void gdb_agent_about_to_close (int pid);
  74. #endif

  75. struct traceframe;
  76. struct eval_agent_expr_context;

  77. /* Do memory copies for bytecodes.  */
  78. /* Do the recording of memory blocks for actions and bytecodes.  */

  79. int agent_mem_read (struct eval_agent_expr_context *ctx,
  80.                     unsigned char *to, CORE_ADDR from,
  81.                     ULONGEST len);

  82. LONGEST agent_get_trace_state_variable_value (int num);
  83. void agent_set_trace_state_variable_value (int num, LONGEST val);

  84. /* Record the value of a trace state variable.  */

  85. int agent_tsv_read (struct eval_agent_expr_context *ctx, int n);
  86. int agent_mem_read_string (struct eval_agent_expr_context *ctx,
  87.                            unsigned char *to,
  88.                            CORE_ADDR from,
  89.                            ULONGEST len);

  90. /* Returns the address of the get_raw_reg function in the IPA.  */
  91. CORE_ADDR get_raw_reg_func_addr (void);
  92. /* Returns the address of the get_trace_state_variable_value
  93.    function in the IPA.  */
  94. CORE_ADDR get_get_tsv_func_addr (void);
  95. /* Returns the address of the set_trace_state_variable_value
  96.    function in the IPA.  */
  97. CORE_ADDR get_set_tsv_func_addr (void);

  98. #endif /* TRACEPOINT_H */