1 /* Tracepoint code for remote server for GDB.
2 Copyright (C) 1993-2014 Free Software Foundation, Inc.
4 This file is part of GDB.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
22 /* Size for a small buffer to report problems from the in-process
23 agent back to GDBserver. */
24 #define IPA_BUFSIZ 100
26 void initialize_tracepoint (void);
29 extern int disconnected_tracing
;
31 void tracepoint_look_up_symbols (void);
33 void stop_tracing (void);
35 int handle_tracepoint_general_set (char *own_buf
);
36 int handle_tracepoint_query (char *own_buf
);
38 int tracepoint_finished_step (struct thread_info
*tinfo
, CORE_ADDR stop_pc
);
39 int tracepoint_was_hit (struct thread_info
*tinfo
, CORE_ADDR stop_pc
);
41 void release_while_stepping_state_list (struct thread_info
*tinfo
);
43 extern int current_traceframe
;
45 int in_readonly_region (CORE_ADDR addr
, ULONGEST length
);
46 int traceframe_read_mem (int tfnum
, CORE_ADDR addr
,
47 unsigned char *buf
, ULONGEST length
,
49 int fetch_traceframe_registers (int tfnum
,
50 struct regcache
*regcache
,
53 int traceframe_read_sdata (int tfnum
, ULONGEST offset
,
54 unsigned char *buf
, ULONGEST length
,
57 int traceframe_read_info (int tfnum
, struct buffer
*buffer
);
59 /* If a thread is determined to be collecting a fast tracepoint, this
60 structure holds the collect status. */
62 struct fast_tpoint_collect_status
64 /* The tracepoint that is presently being collected. */
66 CORE_ADDR tpoint_addr
;
68 /* The address range in the jump pad of where the original
69 instruction the tracepoint jump was inserted was relocated
71 CORE_ADDR adjusted_insn_addr
;
72 CORE_ADDR adjusted_insn_addr_end
;
75 int fast_tracepoint_collecting (CORE_ADDR thread_area
,
77 struct fast_tpoint_collect_status
*status
);
78 void force_unlock_trace_buffer (void);
80 int handle_tracepoint_bkpts (struct thread_info
*tinfo
, CORE_ADDR stop_pc
);
82 #ifdef IN_PROCESS_AGENT
83 void initialize_low_tracepoint (void);
84 void supply_fast_tracepoint_registers (struct regcache
*regcache
,
85 const unsigned char *regs
);
86 void supply_static_tracepoint_registers (struct regcache
*regcache
,
87 const unsigned char *regs
,
89 void set_trampoline_buffer_space (CORE_ADDR begin
, CORE_ADDR end
,
92 extern const struct target_desc
*ipa_tdesc
;
95 void stop_tracing (void);
97 int claim_trampoline_space (ULONGEST used
, CORE_ADDR
*trampoline
);
98 int have_fast_tracepoint_trampoline_buffer (char *msgbuf
);
99 void gdb_agent_about_to_close (int pid
);
103 struct eval_agent_expr_context
;
105 /* Do memory copies for bytecodes. */
106 /* Do the recording of memory blocks for actions and bytecodes. */
108 int agent_mem_read (struct eval_agent_expr_context
*ctx
,
109 unsigned char *to
, CORE_ADDR from
,
112 LONGEST
agent_get_trace_state_variable_value (int num
);
113 void agent_set_trace_state_variable_value (int num
, LONGEST val
);
115 /* Record the value of a trace state variable. */
117 int agent_tsv_read (struct eval_agent_expr_context
*ctx
, int n
);
118 int agent_mem_read_string (struct eval_agent_expr_context
*ctx
,
123 /* Returns the address of the get_raw_reg function in the IPA. */
124 CORE_ADDR
get_raw_reg_func_addr (void);
125 /* Returns the address of the get_trace_state_variable_value
126 function in the IPA. */
127 CORE_ADDR
get_get_tsv_func_addr (void);
128 /* Returns the address of the set_trace_state_variable_value
129 function in the IPA. */
130 CORE_ADDR
get_set_tsv_func_addr (void);
132 #endif /* TRACEPOINT_H */