GDBserver
Classes | Defines | Typedefs | Enumerations | Functions | Variables
/home/stan/gdb/src/gdb/gdbserver/tracepoint.c File Reference
#include "server.h"
#include "tracepoint.h"
#include "gdbthread.h"
#include "agent.h"
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/time.h>
#include <stddef.h>
#include <inttypes.h>
#include <stdint.h>
#include "ax.h"
#include "tdesc.h"

Go to the source code of this file.

Classes

struct  ipa_sym_addresses
struct  tracepoint_action_ops
struct  tracepoint_action
struct  collect_memory_action
struct  collect_registers_action
struct  eval_expr_action
struct  collect_static_trace_data_action
struct  source_string
struct  tracepoint
struct  wstep_state
struct  trace_state_variable
struct  traceframe
struct  trace_buffer_control
struct  ipa_trace_buffer_control
struct  readonly_region
struct  tracepoint_hit_ctx
struct  trap_tracepoint_ctx
struct  collecting_t

Defines

#define DEFAULT_TRACE_BUFFER_SIZE   5242880 /* 5*1024*1024 */
#define trace_debug_1(level, fmt, args...)
#define trace_debug(FMT, args...)   trace_debug_1 (1, FMT, ##args)
#define ATTR_USED
#define ATTR_NOINLINE
#define ATTR_CONSTRUCTOR
#define IP_AGENT_EXPORT
#define COPY_FIELD_TO_BUF(BUF, OBJ, FIELD)
#define ATTR_PACKED   /* nothing */
#define TRACEFRAME_EOB_MARKER_SIZE   offsetof (struct traceframe, data)
#define GDBSERVER_FLUSH_COUNT_MASK   0xfffffff0
#define GDBSERVER_FLUSH_COUNT_MASK_PREV   0x7ff00000
#define GDBSERVER_FLUSH_COUNT_MASK_CURR   0x0007ff00
#define GDBSERVER_UPDATED_FLUSH_COUNT_BIT   0x80000000
#define TRACE_BUFFER_CTRL_CURR   0
#define trace_buffer_start   (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].start)
#define trace_buffer_free   (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].free)
#define trace_buffer_end_free   (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].end_free)
#define trace_buffer_wrap   (trace_buffer_ctrl[TRACE_BUFFER_CTRL_CURR].wrap)
#define FIRST_TRACEFRAME()   ((struct traceframe *) trace_buffer_start)
#define NEXT_TRACEFRAME_1(TF)   (((unsigned char *) (TF)) + sizeof (struct traceframe) + (TF)->data_size)
#define NEXT_TRACEFRAME(TF)
#define traceframe_count   ((unsigned int) (traceframe_write_count - traceframe_read_count))
#define memory_barrier()   do {} while (0)
#define cmpxchg(mem, oldval, newval)   __sync_val_compare_and_swap (mem, oldval, newval)
#define MAX_JUMP_SIZE   20
#define UALIGN(V, N)   (((V) + ((N) - 1)) & ~((N) - 1))
#define IPA_PROTO_FAST_TRACE_FLAG   0
#define IPA_PROTO_FAST_TRACE_ADDR_ON_TARGET   2
#define IPA_PROTO_FAST_TRACE_JUMP_PAD   10
#define IPA_PROTO_FAST_TRACE_FJUMP_SIZE   18
#define IPA_PROTO_FAST_TRACE_FJUMP_INSN   22
#define IPA_FIRST_TRACEFRAME()   (ipa_trace_buffer_ctrl.start)
#define IPA_NEXT_TRACEFRAME_1(TF, TFOBJ)   ((TF) + sizeof (struct traceframe) + (TFOBJ)->data_size)
#define IPA_NEXT_TRACEFRAME(TF, TFOBJ)

Typedefs

typedef enum eval_result_type(* condfn )(struct tracepoint_hit_ctx *, ULONGEST *)
typedef struct collecting_t collecting_t

Enumerations

enum  tracepoint_type { trap_tracepoint, fast_tracepoint, static_tracepoint }

Functions

static void trace_vdebug (const char *,...)
static int read_inferior_integer (CORE_ADDR symaddr, int *val)
static int in_process_agent_supports_ust (void)
static void write_e_ipa_not_loaded (char *buffer)
static void write_e_ust_not_loaded (char *buffer)
static int maybe_write_ipa_not_loaded (char *buffer)
static int maybe_write_ipa_ust_not_loaded (char *buffer)
void tracepoint_look_up_symbols (void)
static int tracepoint_handler (CORE_ADDR address)
static int stop_tracing_handler (CORE_ADDR)
static int flush_trace_buffer_handler (CORE_ADDR)
static void download_trace_state_variables (void)
static void upload_fast_traceframes (void)
static int run_inferior_command (char *cmd, int len)
static int tracepoint_send_agent (struct tracepoint *tpoint)
static int read_inferior_uinteger (CORE_ADDR symaddr, unsigned int *val)
static int read_inferior_data_pointer (CORE_ADDR symaddr, CORE_ADDR *val)
static int write_inferior_data_pointer (CORE_ADDR symaddr, CORE_ADDR val)
static int write_inferior_integer (CORE_ADDR symaddr, int val)
static int write_inferior_uinteger (CORE_ADDR symaddr, unsigned int val)
static CORE_ADDR target_malloc (ULONGEST size)
static int write_inferior_data_ptr (CORE_ADDR where, CORE_ADDR ptr)
static CORE_ADDR m_tracepoint_action_download (const struct tracepoint_action *action)
static char * m_tracepoint_action_send (char *buffer, const struct tracepoint_action *action)
static CORE_ADDR r_tracepoint_action_download (const struct tracepoint_action *action)
static char * r_tracepoint_action_send (char *buffer, const struct tracepoint_action *action)
static CORE_ADDR download_agent_expr (struct agent_expr *expr)
static CORE_ADDR x_tracepoint_action_download (const struct tracepoint_action *action)
static char * agent_expr_send (char *p, const struct agent_expr *aexpr)
static char * x_tracepoint_action_send (char *buffer, const struct tracepoint_action *action)
static CORE_ADDR l_tracepoint_action_download (const struct tracepoint_action *action)
static char * l_tracepoint_action_send (char *buffer, const struct tracepoint_action *action)
static CORE_ADDR traceframe_get_pc (struct traceframe *tframe)
static int traceframe_read_tsv (int num, LONGEST *val)
static int condition_true_at_tracepoint (struct tracepoint_hit_ctx *ctx, struct tracepoint *tpoint)
static void clear_readonly_regions (void)
static void clear_installed_tracepoints (void)
static void collect_data_at_tracepoint (struct tracepoint_hit_ctx *ctx, CORE_ADDR stop_pc, struct tracepoint *tpoint)
static void collect_data_at_step (struct tracepoint_hit_ctx *ctx, CORE_ADDR stop_pc, struct tracepoint *tpoint, int current_step)
static void compile_tracepoint_condition (struct tracepoint *tpoint, CORE_ADDR *jump_entry)
static void do_action_at_tracepoint (struct tracepoint_hit_ctx *ctx, CORE_ADDR stop_pc, struct tracepoint *tpoint, struct traceframe *tframe, struct tracepoint_action *taction)
static struct tracepointfast_tracepoint_from_ipa_tpoint_address (CORE_ADDR)
static void install_tracepoint (struct tracepoint *, char *own_buf)
static void download_tracepoint (struct tracepoint *)
static int install_fast_tracepoint (struct tracepoint *, char *errbuf)
static void clone_fast_tracepoint (struct tracepoint *to, const struct tracepoint *from)
static LONGEST get_timestamp (void)
static void record_tracepoint_error (struct tracepoint *tpoint, const char *which, enum eval_result_type rtype)
static void clear_trace_buffer (void)
static void clear_inferior_trace_buffer (void)
static void init_trace_buffer (LONGEST bufsize)
static void * trace_buffer_alloc (size_t amt)
static int free_space (void)
static struct tracepointadd_tracepoint (int num, CORE_ADDR addr)
static struct tracepointfind_tracepoint (int id, CORE_ADDR addr)
static void remove_tracepoint (struct tracepoint *tpoint)
static struct tracepointfind_next_tracepoint_by_number (struct tracepoint *prev_tp, int num)
static void add_tracepoint_action (struct tracepoint *tpoint, char *packet)
static struct
trace_state_variable
get_trace_state_variable (int num)
static struct
trace_state_variable
create_trace_state_variable (int num, int gdb)
IP_AGENT_EXPORT LONGEST get_trace_state_variable_value (int num)
IP_AGENT_EXPORT void set_trace_state_variable_value (int num, LONGEST val)
LONGEST agent_get_trace_state_variable_value (int num)
void agent_set_trace_state_variable_value (int num, LONGEST val)
static void set_trace_state_variable_name (int num, const char *name)
static void set_trace_state_variable_getter (int num, LONGEST(*getter)(void))
static struct traceframeadd_traceframe (struct tracepoint *tpoint)
static unsigned char * add_traceframe_block (struct traceframe *tframe, struct tracepoint *tpoint, int amt)
static void finish_traceframe (struct traceframe *tframe)
static struct traceframefind_traceframe (int num)
static CORE_ADDR get_traceframe_address (struct traceframe *tframe)
static struct traceframefind_next_traceframe_in_range (CORE_ADDR lo, CORE_ADDR hi, int inside_p, int *tfnump)
static struct traceframefind_next_traceframe_by_tracepoint (int num, int *tfnump)
static void cmd_qtinit (char *packet)
static void unprobe_marker_at (CORE_ADDR address)
static void cmd_qtdp (char *own_buf)
static void cmd_qtdpsrc (char *own_buf)
static void cmd_qtdv (char *own_buf)
static void cmd_qtenable_disable (char *own_buf, int enable)
static void cmd_qtv (char *own_buf)
static void cmd_qtro (char *own_buf)
int in_readonly_region (CORE_ADDR addr, ULONGEST length)
static CORE_ADDR get_jump_space_head (void)
static void claim_jump_space (ULONGEST used)
int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline)
int have_fast_tracepoint_trampoline_buffer (char *buf)
static int probe_marker_at (CORE_ADDR address, char *errout)
static void download_tracepoint_1 (struct tracepoint *tpoint)
static void cmd_qtstart (char *packet)
void stop_tracing (void)
static void cmd_qtstop (char *packet)
static void cmd_qtdisconnected (char *own_buf)
static void cmd_qtframe (char *own_buf)
static void cmd_qtstatus (char *packet)
static void cmd_qtp (char *own_buf)
static void response_tracepoint (char *packet, struct tracepoint *tpoint)
static void response_action (char *packet, struct tracepoint *tpoint, char *taction, int step)
static void response_source (char *packet, struct tracepoint *tpoint, struct source_string *src)
static void cmd_qtfp (char *packet)
static void cmd_qtsp (char *packet)
static void response_tsv (char *packet, struct trace_state_variable *tsv)
static void cmd_qtfv (char *packet)
static void cmd_qtsv (char *packet)
static void cmd_qtfstm (char *packet)
static void cmd_qtsstm (char *packet)
static void cmd_qtstmat (char *packet)
void gdb_agent_about_to_close (int pid)
static void cmd_qtminftpilen (char *packet)
static void cmd_qtbuffer (char *own_buf)
static void cmd_bigqtbuffer_circular (char *own_buf)
static void cmd_bigqtbuffer_size (char *own_buf)
static void cmd_qtnotes (char *own_buf)
int handle_tracepoint_general_set (char *packet)
int handle_tracepoint_query (char *packet)
static void add_while_stepping_state (struct thread_info *tinfo, int tp_number, CORE_ADDR tp_address)
static void release_while_stepping_state (struct wstep_state *wstep)
void release_while_stepping_state_list (struct thread_info *tinfo)
int tracepoint_finished_step (struct thread_info *tinfo, CORE_ADDR stop_pc)
int handle_tracepoint_bkpts (struct thread_info *tinfo, CORE_ADDR stop_pc)
int tracepoint_was_hit (struct thread_info *tinfo, CORE_ADDR stop_pc)
static struct regcacheget_context_regcache (struct tracepoint_hit_ctx *ctx)
int agent_mem_read (struct eval_agent_expr_context *ctx, unsigned char *to, CORE_ADDR from, ULONGEST len)
int agent_mem_read_string (struct eval_agent_expr_context *ctx, unsigned char *to, CORE_ADDR from, ULONGEST len)
int agent_tsv_read (struct eval_agent_expr_context *ctx, int n)
static int match_blocktype (char blocktype, unsigned char *dataptr, void *data)
static unsigned char * traceframe_walk_blocks (unsigned char *database, unsigned int datasize, int tfnum, int(*callback)(char blocktype, unsigned char *dataptr, void *data), void *data)
static unsigned char * traceframe_find_block_type (unsigned char *database, unsigned int datasize, int tfnum, char type_wanted)
static unsigned char * traceframe_find_regblock (struct traceframe *tframe, int tfnum)
int fetch_traceframe_registers (int tfnum, struct regcache *regcache, int regnum)
int traceframe_read_mem (int tfnum, CORE_ADDR addr, unsigned char *buf, ULONGEST length, ULONGEST *nbytes)
int traceframe_read_sdata (int tfnum, ULONGEST offset, unsigned char *buf, ULONGEST length, ULONGEST *nbytes)
static int build_traceframe_info_xml (char blocktype, unsigned char *dataptr, void *data)
int traceframe_read_info (int tfnum, struct buffer *buffer)
static struct tracepointfast_tracepoint_from_jump_pad_address (CORE_ADDR pc)
static struct tracepointfast_tracepoint_from_trampoline_address (CORE_ADDR pc)
void force_unlock_trace_buffer (void)
int fast_tracepoint_collecting (CORE_ADDR thread_area, CORE_ADDR stop_pc, struct fast_tpoint_collect_status *status)
CORE_ADDR get_raw_reg_func_addr (void)
CORE_ADDR get_get_tsv_func_addr (void)
CORE_ADDR get_set_tsv_func_addr (void)
void initialize_tracepoint (void)

Variables

struct {
   const char *   name
   int   offset
   int   required
symbol_list []
static struct ipa_sym_addresses ipa_sym_addrs
struct breakpointstop_tracing_bkpt
struct breakpointflush_trace_buffer_bkpt
static struct tracepoint_action_ops m_tracepoint_action_ops
static struct tracepoint_action_ops r_tracepoint_action_ops
static struct tracepoint_action_ops x_tracepoint_action_ops
static struct tracepoint_action_ops l_tracepoint_action_ops
IP_AGENT_EXPORT struct
tracepoint *tracepoints 
ATTR_USED
static struct tracepointlast_tracepoint
IP_AGENT_EXPORT struct tracepointstopping_tracepoint
IP_AGENT_EXPORT int trace_buffer_is_full
static enum eval_result_type expr_eval_result = expr_eval_no_error
static const char * eval_result_names []
static struct tracepointerror_tracepoint
IP_AGENT_EXPORT struct
trace_state_variable
trace_state_variables
struct traceframe ATTR_PACKED
int current_traceframe = -1
static int circular_trace_buffer
static LONGEST trace_buffer_size
static unsigned char * trace_buffer_lo
static unsigned char * trace_buffer_hi
struct trace_buffer_control trace_buffer_ctrl [1]
IP_AGENT_EXPORT unsigned int traceframe_write_count
IP_AGENT_EXPORT unsigned int traceframe_read_count
IP_AGENT_EXPORT int traceframes_created
static struct readonly_regionreadonly_regions
IP_AGENT_EXPORT int tracing
int disconnected_tracing
static const char * tracing_stop_reason = "tnotrun"
static int tracing_stop_tpnum
LONGEST tracing_start_time
LONGEST tracing_stop_time
char * tracing_user_name
char * tracing_notes
char * tracing_stop_note
static int seen_step_action_flag
static const int max_jump_pad_size = 0x100
static CORE_ADDR gdb_jump_pad_head
static CORE_ADDR trampoline_buffer_head = 0
static CORE_ADDR trampoline_buffer_tail
static struct tracepointcur_tpoint
static unsigned int cur_action
static unsigned int cur_step_action
static struct source_stringcur_source_string
static struct
trace_state_variable
cur_tsv
static CORE_ADDR target_tp_heap

Define Documentation

Definition at line 94 of file tracepoint.c.

#define ATTR_NOINLINE

Definition at line 93 of file tracepoint.c.

#define ATTR_PACKED   /* nothing */

Definition at line 957 of file tracepoint.c.

#define ATTR_USED

Definition at line 92 of file tracepoint.c.

#define cmpxchg (   mem,
  oldval,
  newval 
)    __sync_val_compare_and_swap (mem, oldval, newval)

Definition at line 1411 of file tracepoint.c.

Referenced by record_tracepoint_error(), and trace_buffer_alloc().

#define COPY_FIELD_TO_BUF (   BUF,
  OBJ,
  FIELD 
)
Value:
do {                                                    \
    memcpy (BUF, &(OBJ)->FIELD, sizeof ((OBJ)->FIELD)); \
    BUF += sizeof ((OBJ)->FIELD);                       \
  } while (0)

Definition at line 472 of file tracepoint.c.

Referenced by m_tracepoint_action_send(), and tracepoint_send_agent().

#define DEFAULT_TRACE_BUFFER_SIZE   5242880 /* 5*1024*1024 */

Definition at line 35 of file tracepoint.c.

Referenced by cmd_bigqtbuffer_size(), and initialize_tracepoint().

#define FIRST_TRACEFRAME ( )    ((struct traceframe *) trace_buffer_start)

Definition at line 1195 of file tracepoint.c.

Referenced by find_traceframe(), and trace_buffer_alloc().

#define GDBSERVER_FLUSH_COUNT_MASK   0xfffffff0

Definition at line 1155 of file tracepoint.c.

Referenced by trace_buffer_alloc(), and upload_fast_traceframes().

#define GDBSERVER_FLUSH_COUNT_MASK_CURR   0x0007ff00

Definition at line 1161 of file tracepoint.c.

Referenced by trace_buffer_alloc(), and upload_fast_traceframes().

#define GDBSERVER_FLUSH_COUNT_MASK_PREV   0x7ff00000

Definition at line 1160 of file tracepoint.c.

Referenced by trace_buffer_alloc().

#define GDBSERVER_UPDATED_FLUSH_COUNT_BIT   0x80000000

Definition at line 1165 of file tracepoint.c.

Referenced by upload_fast_traceframes().

#define IP_AGENT_EXPORT

Definition at line 112 of file tracepoint.c.

#define IPA_FIRST_TRACEFRAME ( )    (ipa_trace_buffer_ctrl.start)

Referenced by upload_fast_traceframes().

#define IPA_NEXT_TRACEFRAME (   TF,
  TFOBJ 
)
Value:
(IPA_NEXT_TRACEFRAME_1 (TF, TFOBJ)                                      \
   - ((IPA_NEXT_TRACEFRAME_1 (TF, TFOBJ) >= ipa_trace_buffer_ctrl.wrap) \
      ? (ipa_trace_buffer_ctrl.wrap - ipa_trace_buffer_lo)              \
      : 0))

Referenced by upload_fast_traceframes().

#define IPA_NEXT_TRACEFRAME_1 (   TF,
  TFOBJ 
)    ((TF) + sizeof (struct traceframe) + (TFOBJ)->data_size)

Definition at line 6033 of file tracepoint.c.

Referenced by tracepoint_send_agent().

Definition at line 6036 of file tracepoint.c.

Referenced by tracepoint_send_agent().

Definition at line 6035 of file tracepoint.c.

Referenced by tracepoint_send_agent().

#define IPA_PROTO_FAST_TRACE_FLAG   0

Definition at line 6032 of file tracepoint.c.

Definition at line 6034 of file tracepoint.c.

Referenced by tracepoint_send_agent().

#define MAX_JUMP_SIZE   20

Definition at line 3067 of file tracepoint.c.

Referenced by install_fast_tracepoint().

#define memory_barrier ( )    do {} while (0)

Definition at line 1405 of file tracepoint.c.

Referenced by trace_buffer_alloc().

#define NEXT_TRACEFRAME (   TF)
#define NEXT_TRACEFRAME_1 (   TF)    (((unsigned char *) (TF)) + sizeof (struct traceframe) + (TF)->data_size)

Definition at line 1201 of file tracepoint.c.

#define TRACE_BUFFER_CTRL_CURR   0

Definition at line 1181 of file tracepoint.c.

Definition at line 1188 of file tracepoint.c.

Referenced by clear_trace_buffer(), and free_space().

Definition at line 1187 of file tracepoint.c.

Referenced by clear_trace_buffer(), and free_space().

Definition at line 1186 of file tracepoint.c.

Referenced by clear_trace_buffer(), and cmd_qtbuffer().

Definition at line 1190 of file tracepoint.c.

Referenced by clear_trace_buffer(), cmd_qtbuffer(), and traceframe_walk_blocks().

#define trace_debug (   FMT,
  args... 
)    trace_debug_1 (1, FMT, ##args)
#define trace_debug_1 (   level,
  fmt,
  args... 
)
Value:
do {                                            \
    if (level <= debug_threads)         \
      trace_vdebug ((fmt), ##args);             \
  } while (0)

Definition at line 78 of file tracepoint.c.

Definition at line 1219 of file tracepoint.c.

Referenced by cmd_qtstatus().

#define TRACEFRAME_EOB_MARKER_SIZE   offsetof (struct traceframe, data)

Definition at line 988 of file tracepoint.c.

Referenced by init_trace_buffer(), and trace_buffer_alloc().

#define UALIGN (   V,
 
)    (((V) + ((N) - 1)) & ~((N) - 1))

Definition at line 5951 of file tracepoint.c.

Referenced by download_tracepoint_1().


Typedef Documentation

typedef struct collecting_t collecting_t
typedef enum eval_result_type(* condfn)(struct tracepoint_hit_ctx *, ULONGEST *)

Definition at line 713 of file tracepoint.c.


Enumeration Type Documentation

Enumerator:
trap_tracepoint 
fast_tracepoint 
static_tracepoint 

Definition at line 698 of file tracepoint.c.


Function Documentation

static struct traceframe* add_traceframe ( struct tracepoint tpoint) [static, read]
static unsigned char* add_traceframe_block ( struct traceframe tframe,
struct tracepoint tpoint,
int  amt 
) [static]
static struct tracepoint* add_tracepoint ( int  num,
CORE_ADDR  addr 
) [static, read]
static void add_tracepoint_action ( struct tracepoint tpoint,
char *  packet 
) [static]
static void add_while_stepping_state ( struct thread_info tinfo,
int  tp_number,
CORE_ADDR  tp_address 
) [static]
static char* agent_expr_send ( char *  p,
const struct agent_expr aexpr 
) [static]

Definition at line 2158 of file tracepoint.c.

References get_trace_state_variable_value().

Referenced by gdb_eval_agent_expr().

int agent_mem_read ( struct eval_agent_expr_context ctx,
unsigned char *  to,
CORE_ADDR  from,
ULONGEST  len 
)
int agent_mem_read_string ( struct eval_agent_expr_context ctx,
unsigned char *  to,
CORE_ADDR  from,
ULONGEST  len 
)
void agent_set_trace_state_variable_value ( int  num,
LONGEST  val 
)

Definition at line 2164 of file tracepoint.c.

References set_trace_state_variable_value().

Referenced by gdb_eval_agent_expr().

int agent_tsv_read ( struct eval_agent_expr_context ctx,
int  n 
)
static int build_traceframe_info_xml ( char  blocktype,
unsigned char *  dataptr,
void *  data 
) [static]

Definition at line 5394 of file tracepoint.c.

References buffer_xml_printf(), memcpy(), paddress(), phex_nz(), and warning().

Referenced by traceframe_read_info().

static void claim_jump_space ( ULONGEST  used) [static]

Definition at line 2939 of file tracepoint.c.

References paddress(), pulongest(), and trace_debug.

Referenced by download_tracepoint_1(), and install_fast_tracepoint().

int claim_trampoline_space ( ULONGEST  used,
CORE_ADDR trampoline 
)
static void clear_inferior_trace_buffer ( void  ) [static]
static void clear_installed_tracepoints ( void  ) [static]
static void clear_readonly_regions ( void  ) [static]

Definition at line 2853 of file tracepoint.c.

References readonly_region::next, and readonly_regions.

Referenced by cmd_qtinit(), and cmd_qtro().

static void clear_trace_buffer ( void  ) [static]
static void clone_fast_tracepoint ( struct tracepoint to,
const struct tracepoint from 
) [static]
static void cmd_bigqtbuffer_circular ( char *  own_buf) [static]

Definition at line 4032 of file tracepoint.c.

References own_buf, trace_debug, unpack_varlen_hex(), and write_ok().

Referenced by handle_tracepoint_general_set().

static void cmd_bigqtbuffer_size ( char *  own_buf) [static]
static void cmd_qtbuffer ( char *  own_buf) [static]
static void cmd_qtdisconnected ( char *  own_buf) [static]

Definition at line 3513 of file tracepoint.c.

References own_buf, unpack_varlen_hex(), and write_ok().

Referenced by handle_tracepoint_general_set().

static void cmd_qtdp ( char *  own_buf) [static]
static void cmd_qtdpsrc ( char *  own_buf) [static]
static void cmd_qtdv ( char *  own_buf) [static]
static void cmd_qtenable_disable ( char *  own_buf,
int  enable 
) [static]
static void cmd_qtfp ( char *  packet) [static]

Definition at line 3781 of file tracepoint.c.

References response_tracepoint(), and trace_debug.

Referenced by handle_tracepoint_query().

static void cmd_qtframe ( char *  own_buf) [static]
static void cmd_qtfstm ( char *  packet) [static]

Definition at line 3905 of file tracepoint.c.

References maybe_write_ipa_ust_not_loaded(), and run_inferior_command().

Referenced by handle_tracepoint_query().

static void cmd_qtfv ( char *  packet) [static]

Definition at line 3869 of file tracepoint.c.

References response_tsv(), trace_debug, and trace_state_variables.

Referenced by handle_tracepoint_query().

static void cmd_qtinit ( char *  packet) [static]
static void cmd_qtminftpilen ( char *  packet) [static]

Definition at line 3966 of file tracepoint.c.

References current_inferior, and target_get_min_fast_tracepoint_insn_len.

Referenced by handle_tracepoint_query().

static void cmd_qtnotes ( char *  own_buf) [static]

Definition at line 4078 of file tracepoint.c.

References own_buf, strchr(), trace_debug, unhexify(), write_ok(), xfree(), and xmalloc().

Referenced by handle_tracepoint_general_set().

static void cmd_qtp ( char *  own_buf) [static]
static void cmd_qtro ( char *  own_buf) [static]
static void cmd_qtsp ( char *  packet) [static]
static void cmd_qtsstm ( char *  packet) [static]

Definition at line 3914 of file tracepoint.c.

References maybe_write_ipa_ust_not_loaded(), and run_inferior_command().

Referenced by handle_tracepoint_query().

static void cmd_qtstart ( char *  packet) [static]
static void cmd_qtstatus ( char *  packet) [static]
static void cmd_qtstmat ( char *  packet) [static]

Definition at line 3924 of file tracepoint.c.

References maybe_write_ipa_ust_not_loaded(), and run_inferior_command().

Referenced by handle_tracepoint_query().

static void cmd_qtstop ( char *  packet) [static]

Definition at line 3506 of file tracepoint.c.

References stop_tracing(), and write_ok().

Referenced by handle_tracepoint_general_set().

static void cmd_qtsv ( char *  packet) [static]

Definition at line 3884 of file tracepoint.c.

References trace_state_variable::next, response_tsv(), and trace_debug.

Referenced by handle_tracepoint_query().

static void cmd_qtv ( char *  own_buf) [static]
static void collect_data_at_step ( struct tracepoint_hit_ctx ctx,
CORE_ADDR  stop_pc,
struct tracepoint tpoint,
int  current_step 
) [static]
static void collect_data_at_tracepoint ( struct tracepoint_hit_ctx ctx,
CORE_ADDR  stop_pc,
struct tracepoint tpoint 
) [static]
static void compile_tracepoint_condition ( struct tracepoint tpoint,
CORE_ADDR jump_entry 
) [static]
static int condition_true_at_tracepoint ( struct tracepoint_hit_ctx ctx,
struct tracepoint tpoint 
) [static]
static struct trace_state_variable* create_trace_state_variable ( int  num,
int  gdb 
) [static, read]
static void do_action_at_tracepoint ( struct tracepoint_hit_ctx ctx,
CORE_ADDR  stop_pc,
struct tracepoint tpoint,
struct traceframe tframe,
struct tracepoint_action taction 
) [static]
static CORE_ADDR download_agent_expr ( struct agent_expr expr) [static]
static void download_trace_state_variables ( void  ) [static]
static void download_tracepoint ( struct tracepoint tpoint) [static]
static void download_tracepoint_1 ( struct tracepoint tpoint) [static]
int fast_tracepoint_collecting ( CORE_ADDR  thread_area,
CORE_ADDR  stop_pc,
struct fast_tpoint_collect_status status 
)
static struct tracepoint * fast_tracepoint_from_ipa_tpoint_address ( CORE_ADDR  ipa_tpoint_obj) [static, read]
static struct tracepoint* fast_tracepoint_from_jump_pad_address ( CORE_ADDR  pc) [static, read]
static struct tracepoint* fast_tracepoint_from_trampoline_address ( CORE_ADDR  pc) [static, read]
int fetch_traceframe_registers ( int  tfnum,
struct regcache regcache,
int  regnum 
)
static struct traceframe* find_next_traceframe_by_tracepoint ( int  num,
int *  tfnump 
) [static, read]

Definition at line 2330 of file tracepoint.c.

References find_traceframe(), NEXT_TRACEFRAME, and traceframe::tpnum.

Referenced by cmd_qtframe().

static struct traceframe* find_next_traceframe_in_range ( CORE_ADDR  lo,
CORE_ADDR  hi,
int  inside_p,
int *  tfnump 
) [static, read]

Definition at line 2296 of file tracepoint.c.

References find_traceframe(), get_traceframe_address(), NEXT_TRACEFRAME, and traceframe::tpnum.

Referenced by cmd_qtframe().

static struct tracepoint* find_next_tracepoint_by_number ( struct tracepoint prev_tp,
int  num 
) [static, read]
static struct traceframe* find_traceframe ( int  num) [static, read]
static struct tracepoint* find_tracepoint ( int  id,
CORE_ADDR  addr 
) [static, read]
static void finish_traceframe ( struct traceframe tframe) [static]
static int flush_trace_buffer_handler ( CORE_ADDR  addr) [static]

Definition at line 3499 of file tracepoint.c.

References trace_debug.

Referenced by cmd_qtstart().

void force_unlock_trace_buffer ( void  )
static int free_space ( void  ) [static]

Definition at line 1787 of file tracepoint.c.

References trace_buffer_end_free, and trace_buffer_free.

Referenced by cmd_qtbuffer(), and cmd_qtstatus().

void gdb_agent_about_to_close ( int  pid)
static struct regcache* get_context_regcache ( struct tracepoint_hit_ctx ctx) [static, read]
static CORE_ADDR get_jump_space_head ( void  ) [static]

Definition at line 5827 of file tracepoint.c.

References ipa_sym_addresses::addr_get_raw_reg, and ipa_sym_addrs.

Referenced by i386_emit_reg().

static LONGEST get_timestamp ( void  ) [static]

Definition at line 7298 of file tracepoint.c.

Referenced by cmd_qtstart(), initialize_tracepoint(), and stop_tracing().

static struct trace_state_variable* get_trace_state_variable ( int  num) [static, read]
static CORE_ADDR get_traceframe_address ( struct traceframe tframe) [static]
int handle_tracepoint_bkpts ( struct thread_info tinfo,
CORE_ADDR  stop_pc 
)
int handle_tracepoint_general_set ( char *  packet)
int handle_tracepoint_query ( char *  packet)
static int in_process_agent_supports_ust ( void  ) [static]
int in_readonly_region ( CORE_ADDR  addr,
ULONGEST  length 
)

Definition at line 2905 of file tracepoint.c.

References readonly_region::end, readonly_region::next, and readonly_region::start.

Referenced by gdb_read_memory().

static void init_trace_buffer ( LONGEST  bufsize) [static]
void initialize_tracepoint ( void  )
static int install_fast_tracepoint ( struct tracepoint tpoint,
char *  errbuf 
) [static]
static void install_tracepoint ( struct tracepoint tpoint,
char *  own_buf 
) [static]
static CORE_ADDR l_tracepoint_action_download ( const struct tracepoint_action action) [static]

Definition at line 653 of file tracepoint.c.

References target_malloc(), tracepoint_action::type, and write_inferior_memory().

static char* l_tracepoint_action_send ( char *  buffer,
const struct tracepoint_action action 
) [static]

Definition at line 666 of file tracepoint.c.

static CORE_ADDR m_tracepoint_action_download ( const struct tracepoint_action action) [static]

Definition at line 539 of file tracepoint.c.

References target_malloc(), tracepoint_action::type, and write_inferior_memory().

static char* m_tracepoint_action_send ( char *  buffer,
const struct tracepoint_action action 
) [static]
static int match_blocktype ( char  blocktype,
unsigned char *  dataptr,
void *  data 
) [static]

Definition at line 5048 of file tracepoint.c.

Referenced by traceframe_find_block_type().

static int maybe_write_ipa_not_loaded ( char *  buffer) [static]

Definition at line 289 of file tracepoint.c.

References agent_loaded_p(), and write_e_ipa_not_loaded().

Referenced by cmd_qtstart(), and gdb_agent_about_to_close().

static int maybe_write_ipa_ust_not_loaded ( char *  buffer) [static]
static int probe_marker_at ( CORE_ADDR  address,
char *  errout 
) [static]

Definition at line 3032 of file tracepoint.c.

References IPA_CMD_BUF_SIZE, paddress(), and run_inferior_command().

Referenced by cmd_qtstart(), and install_tracepoint().

static CORE_ADDR r_tracepoint_action_download ( const struct tracepoint_action action) [static]

Definition at line 570 of file tracepoint.c.

References target_malloc(), tracepoint_action::type, and write_inferior_memory().

static char* r_tracepoint_action_send ( char *  buffer,
const struct tracepoint_action action 
) [static]

Definition at line 583 of file tracepoint.c.

static int read_inferior_data_pointer ( CORE_ADDR  symaddr,
CORE_ADDR val 
) [static]
static int read_inferior_integer ( CORE_ADDR  symaddr,
int *  val 
) [static]

Definition at line 422 of file tracepoint.c.

References read_inferior_memory().

Referenced by handle_tracepoint_bkpts(), and in_process_agent_supports_ust().

static int read_inferior_uinteger ( CORE_ADDR  symaddr,
unsigned int *  val 
) [static]

Definition at line 432 of file tracepoint.c.

References read_inferior_memory().

Referenced by upload_fast_traceframes().

static void record_tracepoint_error ( struct tracepoint tpoint,
const char *  which,
enum eval_result_type  rtype 
) [static]
static void release_while_stepping_state ( struct wstep_state wstep) [static]

Definition at line 4323 of file tracepoint.c.

Referenced by release_while_stepping_state_list(), and tracepoint_finished_step().

static void remove_tracepoint ( struct tracepoint tpoint) [static]

Definition at line 1878 of file tracepoint.c.

References tracepoint::next, and xfree().

Referenced by cmd_qtdp().

static void response_action ( char *  packet,
struct tracepoint tpoint,
char *  taction,
int  step 
) [static]

Definition at line 3749 of file tracepoint.c.

References tracepoint::address, tracepoint::number, and paddress().

Referenced by cmd_qtsp().

static void response_source ( char *  packet,
struct tracepoint tpoint,
struct source_string src 
) [static]
static void response_tracepoint ( char *  packet,
struct tracepoint tpoint 
) [static]
static void response_tsv ( char *  packet,
struct trace_state_variable tsv 
) [static]
static int run_inferior_command ( char *  cmd,
int  len 
) [static]
static void set_trace_state_variable_getter ( int  num,
LONGEST(*)(void)  getter 
) [static]
static void set_trace_state_variable_name ( int  num,
const char *  name 
) [static]

Definition at line 2170 of file tracepoint.c.

References get_trace_state_variable(), trace_state_variable::name, and trace_debug.

Referenced by initialize_tracepoint().

void stop_tracing ( void  )
static int stop_tracing_handler ( CORE_ADDR  addr) [static]

Definition at line 3487 of file tracepoint.c.

References trace_debug.

Referenced by cmd_qtstart().

static CORE_ADDR target_malloc ( ULONGEST  size) [static]
static void* trace_buffer_alloc ( size_t  amt) [static]
static void trace_vdebug ( const char *  ,
  ... 
) [static]

Definition at line 64 of file tracepoint.c.

References PROG.

static unsigned char* traceframe_find_block_type ( unsigned char *  database,
unsigned int  datasize,
int  tfnum,
char  type_wanted 
) [static]
static unsigned char* traceframe_find_regblock ( struct traceframe tframe,
int  tfnum 
) [static]
static CORE_ADDR traceframe_get_pc ( struct traceframe tframe) [static]
int traceframe_read_info ( int  tfnum,
struct buffer buffer 
)
int traceframe_read_mem ( int  tfnum,
CORE_ADDR  addr,
unsigned char *  buf,
ULONGEST  length,
ULONGEST nbytes 
)
int traceframe_read_sdata ( int  tfnum,
ULONGEST  offset,
unsigned char *  buf,
ULONGEST  length,
ULONGEST nbytes 
)
static int traceframe_read_tsv ( int  num,
LONGEST val 
) [static]
static unsigned char* traceframe_walk_blocks ( unsigned char *  database,
unsigned int  datasize,
int  tfnum,
int(*)(char blocktype, unsigned char *dataptr, void *data)  callback,
void *  data 
) [static]
int tracepoint_finished_step ( struct thread_info tinfo,
CORE_ADDR  stop_pc 
)
static int tracepoint_handler ( CORE_ADDR  address) [static]

Definition at line 401 of file tracepoint.c.

References paddress(), and trace_debug.

Referenced by cmd_qtstart(), and install_tracepoint().

void tracepoint_look_up_symbols ( void  )
static int tracepoint_send_agent ( struct tracepoint tpoint) [static]
int tracepoint_was_hit ( struct thread_info tinfo,
CORE_ADDR  stop_pc 
)
static void unprobe_marker_at ( CORE_ADDR  address) [static]

Definition at line 2412 of file tracepoint.c.

References IPA_CMD_BUF_SIZE, paddress(), and run_inferior_command().

Referenced by clear_installed_tracepoints().

static void upload_fast_traceframes ( void  ) [static]
static void write_e_ipa_not_loaded ( char *  buffer) [static]
static void write_e_ust_not_loaded ( char *  buffer) [static]

Definition at line 274 of file tracepoint.c.

Referenced by install_tracepoint(), and maybe_write_ipa_ust_not_loaded().

static int write_inferior_data_pointer ( CORE_ADDR  symaddr,
CORE_ADDR  val 
) [static]
static int write_inferior_data_ptr ( CORE_ADDR  where,
CORE_ADDR  ptr 
) [static]
static int write_inferior_integer ( CORE_ADDR  symaddr,
int  val 
) [static]
static int write_inferior_uinteger ( CORE_ADDR  symaddr,
unsigned int  val 
) [static]

Definition at line 464 of file tracepoint.c.

References write_inferior_memory().

Referenced by clear_inferior_trace_buffer(), and upload_fast_traceframes().

static CORE_ADDR x_tracepoint_action_download ( const struct tracepoint_action action) [static]
static char* x_tracepoint_action_send ( char *  buffer,
const struct tracepoint_action action 
) [static]

Definition at line 639 of file tracepoint.c.

References agent_expr_send(), and eval_expr_action::expr.


Variable Documentation

IP_AGENT_EXPORT struct tracepoint* tracepoints ATTR_USED

Definition at line 852 of file tracepoint.c.

int circular_trace_buffer [static]

Definition at line 1000 of file tracepoint.c.

unsigned int cur_action [static]

Definition at line 3711 of file tracepoint.c.

Referenced by cmd_qtsp().

struct source_string* cur_source_string [static]

Definition at line 3713 of file tracepoint.c.

unsigned int cur_step_action [static]

Definition at line 3712 of file tracepoint.c.

Referenced by cmd_qtsp().

struct tracepoint* cur_tpoint [static]

Definition at line 3710 of file tracepoint.c.

struct trace_state_variable* cur_tsv [static]

Definition at line 3714 of file tracepoint.c.

Definition at line 1261 of file tracepoint.c.

Referenced by main(), and process_serial_event().

struct tracepoint* error_tracepoint [static]

Definition at line 890 of file tracepoint.c.

const char* eval_result_names[] [static]
Initial value:
  {
    "terror:in the attic",  
    "terror:empty expression",
    "terror:empty stack",
    "terror:stack overflow",
    "terror:stack underflow",
    "terror:unhandled opcode",
    "terror:unrecognized opcode",
    "terror:divide by zero"
  }

Definition at line 874 of file tracepoint.c.

Definition at line 870 of file tracepoint.c.

Referenced by stop_tracing().

Definition at line 413 of file tracepoint.c.

Definition at line 2919 of file tracepoint.c.

Referenced by get_jump_space_head().

Initial value:

Definition at line 671 of file tracepoint.c.

Referenced by add_tracepoint_action().

struct tracepoint* last_tracepoint [static]

Definition at line 859 of file tracepoint.c.

Initial value:

Definition at line 563 of file tracepoint.c.

Referenced by add_tracepoint_action().

const int max_jump_pad_size = 0x100 [static]

Definition at line 2917 of file tracepoint.c.

const char* name
int offset
Initial value:

Definition at line 588 of file tracepoint.c.

Referenced by add_tracepoint_action().

Definition at line 1249 of file tracepoint.c.

Referenced by clear_readonly_regions(), and cmd_qtro().

int required

Definition at line 194 of file tracepoint.c.

int seen_step_action_flag [static]

Definition at line 1799 of file tracepoint.c.

Definition at line 409 of file tracepoint.c.

Definition at line 864 of file tracepoint.c.

struct { ... } symbol_list[] [static]

Definition at line 5906 of file tracepoint.c.

Referenced by target_malloc().

Definition at line 1180 of file tracepoint.c.

Referenced by trace_buffer_alloc().

unsigned char* trace_buffer_hi [static]

Definition at line 1014 of file tracepoint.c.

Referenced by clear_trace_buffer(), and trace_buffer_alloc().

Definition at line 868 of file tracepoint.c.

unsigned char* trace_buffer_lo [static]

Definition at line 1005 of file tracepoint.c.

Referenced by init_trace_buffer().

Definition at line 924 of file tracepoint.c.

Referenced by cmd_qtfv(), cmd_qtinit(), and create_trace_state_variable().

Definition at line 1215 of file tracepoint.c.

Definition at line 1214 of file tracepoint.c.

Referenced by finish_traceframe(), and trace_buffer_alloc().

Definition at line 1225 of file tracepoint.c.

Referenced by finish_traceframe().

Definition at line 1255 of file tracepoint.c.

Referenced by main(), and process_serial_event().

Definition at line 1285 of file tracepoint.c.

Definition at line 1274 of file tracepoint.c.

Definition at line 1290 of file tracepoint.c.

const char* tracing_stop_reason = "tnotrun" [static]

Definition at line 1267 of file tracepoint.c.

Definition at line 1275 of file tracepoint.c.

int tracing_stop_tpnum [static]

Definition at line 1269 of file tracepoint.c.

Definition at line 1280 of file tracepoint.c.

Definition at line 2946 of file tracepoint.c.

Referenced by claim_trampoline_space().

Definition at line 2947 of file tracepoint.c.

Initial value:

Definition at line 646 of file tracepoint.c.

Referenced by add_tracepoint_action().

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines