Add extern "C" to declarations of C symbols
[deliverable/binutils-gdb.git] / gdb / gdbserver / tracepoint.h
CommitLineData
270c6aea 1/* Tracepoint code for remote server for GDB.
32d0add0 2 Copyright (C) 1993-2015 Free Software Foundation, Inc.
270c6aea
PA
3
4 This file is part of GDB.
5
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.
10
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.
15
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/>. */
18
19#ifndef TRACEPOINT_H
20#define TRACEPOINT_H
21
22/* Size for a small buffer to report problems from the in-process
23 agent back to GDBserver. */
24#define IPA_BUFSIZ 100
25
26void initialize_tracepoint (void);
27
28extern int tracing;
29extern int disconnected_tracing;
30
31void tracepoint_look_up_symbols (void);
32
33void stop_tracing (void);
34
35int handle_tracepoint_general_set (char *own_buf);
36int handle_tracepoint_query (char *own_buf);
37
38int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc);
39int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc);
40
41void release_while_stepping_state_list (struct thread_info *tinfo);
42
43extern int current_traceframe;
44
45int in_readonly_region (CORE_ADDR addr, ULONGEST length);
46int traceframe_read_mem (int tfnum, CORE_ADDR addr,
47 unsigned char *buf, ULONGEST length,
48 ULONGEST *nbytes);
49int fetch_traceframe_registers (int tfnum,
50 struct regcache *regcache,
51 int regnum);
52
53int traceframe_read_sdata (int tfnum, ULONGEST offset,
54 unsigned char *buf, ULONGEST length,
55 ULONGEST *nbytes);
56
57int traceframe_read_info (int tfnum, struct buffer *buffer);
58
59/* If a thread is determined to be collecting a fast tracepoint, this
60 structure holds the collect status. */
61
62struct fast_tpoint_collect_status
63{
64 /* The tracepoint that is presently being collected. */
65 int tpoint_num;
66 CORE_ADDR tpoint_addr;
67
68 /* The address range in the jump pad of where the original
69 instruction the tracepoint jump was inserted was relocated
70 to. */
71 CORE_ADDR adjusted_insn_addr;
72 CORE_ADDR adjusted_insn_addr_end;
73};
74
75int fast_tracepoint_collecting (CORE_ADDR thread_area,
76 CORE_ADDR stop_pc,
77 struct fast_tpoint_collect_status *status);
78void force_unlock_trace_buffer (void);
79
80int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc);
81
82#ifdef IN_PROCESS_AGENT
83void initialize_low_tracepoint (void);
84void supply_fast_tracepoint_registers (struct regcache *regcache,
85 const unsigned char *regs);
86void supply_static_tracepoint_registers (struct regcache *regcache,
87 const unsigned char *regs,
88 CORE_ADDR pc);
89void set_trampoline_buffer_space (CORE_ADDR begin, CORE_ADDR end,
90 char *errmsg);
91
92extern const struct target_desc *ipa_tdesc;
93
94#else
95void stop_tracing (void);
96
97int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline);
98int have_fast_tracepoint_trampoline_buffer (char *msgbuf);
99void gdb_agent_about_to_close (int pid);
100#endif
101
102struct traceframe;
103struct eval_agent_expr_context;
104
105/* Do memory copies for bytecodes. */
106/* Do the recording of memory blocks for actions and bytecodes. */
107
108int agent_mem_read (struct eval_agent_expr_context *ctx,
109 unsigned char *to, CORE_ADDR from,
110 ULONGEST len);
111
112LONGEST agent_get_trace_state_variable_value (int num);
113void agent_set_trace_state_variable_value (int num, LONGEST val);
114
115/* Record the value of a trace state variable. */
116
117int agent_tsv_read (struct eval_agent_expr_context *ctx, int n);
118int agent_mem_read_string (struct eval_agent_expr_context *ctx,
119 unsigned char *to,
120 CORE_ADDR from,
121 ULONGEST len);
122
123/* Returns the address of the get_raw_reg function in the IPA. */
124CORE_ADDR get_raw_reg_func_addr (void);
125/* Returns the address of the get_trace_state_variable_value
126 function in the IPA. */
127CORE_ADDR get_get_tsv_func_addr (void);
128/* Returns the address of the set_trace_state_variable_value
129 function in the IPA. */
130CORE_ADDR get_set_tsv_func_addr (void);
131
132#endif /* TRACEPOINT_H */
This page took 0.156092 seconds and 4 git commands to generate.