GDBserver
|
00001 /* Tracepoint code for remote server for GDB. 00002 Copyright (C) 1993-2013 Free Software Foundation, Inc. 00003 00004 This file is part of GDB. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00018 00019 #ifndef TRACEPOINT_H 00020 #define TRACEPOINT_H 00021 00022 /* Size for a small buffer to report problems from the in-process 00023 agent back to GDBserver. */ 00024 #define IPA_BUFSIZ 100 00025 00026 void initialize_tracepoint (void); 00027 00028 extern int tracing; 00029 extern int disconnected_tracing; 00030 00031 void tracepoint_look_up_symbols (void); 00032 00033 void stop_tracing (void); 00034 00035 int handle_tracepoint_general_set (char *own_buf); 00036 int handle_tracepoint_query (char *own_buf); 00037 00038 int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc); 00039 int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc); 00040 00041 void release_while_stepping_state_list (struct thread_info *tinfo); 00042 00043 extern int current_traceframe; 00044 00045 int in_readonly_region (CORE_ADDR addr, ULONGEST length); 00046 int traceframe_read_mem (int tfnum, CORE_ADDR addr, 00047 unsigned char *buf, ULONGEST length, 00048 ULONGEST *nbytes); 00049 int fetch_traceframe_registers (int tfnum, 00050 struct regcache *regcache, 00051 int regnum); 00052 00053 int traceframe_read_sdata (int tfnum, ULONGEST offset, 00054 unsigned char *buf, ULONGEST length, 00055 ULONGEST *nbytes); 00056 00057 int traceframe_read_info (int tfnum, struct buffer *buffer); 00058 00059 /* If a thread is determined to be collecting a fast tracepoint, this 00060 structure holds the collect status. */ 00061 00062 struct fast_tpoint_collect_status 00063 { 00064 /* The tracepoint that is presently being collected. */ 00065 int tpoint_num; 00066 CORE_ADDR tpoint_addr; 00067 00068 /* The address range in the jump pad of where the original 00069 instruction the tracepoint jump was inserted was relocated 00070 to. */ 00071 CORE_ADDR adjusted_insn_addr; 00072 CORE_ADDR adjusted_insn_addr_end; 00073 }; 00074 00075 int fast_tracepoint_collecting (CORE_ADDR thread_area, 00076 CORE_ADDR stop_pc, 00077 struct fast_tpoint_collect_status *status); 00078 void force_unlock_trace_buffer (void); 00079 00080 int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc); 00081 00082 #ifdef IN_PROCESS_AGENT 00083 void initialize_low_tracepoint (void); 00084 void supply_fast_tracepoint_registers (struct regcache *regcache, 00085 const unsigned char *regs); 00086 void supply_static_tracepoint_registers (struct regcache *regcache, 00087 const unsigned char *regs, 00088 CORE_ADDR pc); 00089 void set_trampoline_buffer_space (CORE_ADDR begin, CORE_ADDR end, 00090 char *errmsg); 00091 00092 extern const struct target_desc *ipa_tdesc; 00093 00094 #else 00095 void stop_tracing (void); 00096 00097 int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline); 00098 int have_fast_tracepoint_trampoline_buffer (char *msgbuf); 00099 void gdb_agent_about_to_close (int pid); 00100 #endif 00101 00102 struct traceframe; 00103 struct eval_agent_expr_context; 00104 00105 /* Do memory copies for bytecodes. */ 00106 /* Do the recording of memory blocks for actions and bytecodes. */ 00107 00108 int agent_mem_read (struct eval_agent_expr_context *ctx, 00109 unsigned char *to, CORE_ADDR from, 00110 ULONGEST len); 00111 00112 LONGEST agent_get_trace_state_variable_value (int num); 00113 void agent_set_trace_state_variable_value (int num, LONGEST val); 00114 00115 /* Record the value of a trace state variable. */ 00116 00117 int agent_tsv_read (struct eval_agent_expr_context *ctx, int n); 00118 int agent_mem_read_string (struct eval_agent_expr_context *ctx, 00119 unsigned char *to, 00120 CORE_ADDR from, 00121 ULONGEST len); 00122 00123 /* Returns the address of the get_raw_reg function in the IPA. */ 00124 CORE_ADDR get_raw_reg_func_addr (void); 00125 /* Returns the address of the get_trace_state_variable_value 00126 function in the IPA. */ 00127 CORE_ADDR get_get_tsv_func_addr (void); 00128 /* Returns the address of the set_trace_state_variable_value 00129 function in the IPA. */ 00130 CORE_ADDR get_set_tsv_func_addr (void); 00131 00132 #endif /* TRACEPOINT_H */