GDB (xrefs)
Classes | Macros | Typedefs | Functions | Variables
/tmp/gdb-7.10/gdb/tracefile-tfile.c File Reference
#include "defs.h"
#include "tracefile.h"
#include "readline/tilde.h"
#include "filestuff.h"
#include "rsp-low.h"
#include "regcache.h"
#include "inferior.h"
#include "gdbthread.h"
#include "exec.h"
#include "completer.h"
#include "filenames.h"

Go to the source code of this file.

Classes

struct  tfile_trace_file_writer
 

Macros

#define O_LARGEFILE   0
 
#define MAX_TRACE_UPLOAD   2000
 
#define TRACE_HEADER_SIZE   8
 
#define TFILE_PID   (1)
 

Typedefs

typedef int(* walk_blocks_callback_func) (char blocktype, void *data)
 

Functions

static int tfile_target_save (struct trace_file_writer *self, const char *filename)
 
static void tfile_dtor (struct trace_file_writer *self)
 
static void tfile_start (struct trace_file_writer *self, const char *filename)
 
static void tfile_write_header (struct trace_file_writer *self)
 
static void tfile_write_regblock_type (struct trace_file_writer *self, int size)
 
static void tfile_write_status (struct trace_file_writer *self, struct trace_status *ts)
 
static void tfile_write_uploaded_tsv (struct trace_file_writer *self, struct uploaded_tsv *utsv)
 
static void tfile_write_uploaded_tp (struct trace_file_writer *self, struct uploaded_tp *utp)
 
static void tfile_write_definition_end (struct trace_file_writer *self)
 
static void tfile_write_raw_data (struct trace_file_writer *self, gdb_byte *buf, LONGEST len)
 
static void tfile_end (struct trace_file_writer *self)
 
struct trace_file_writertfile_trace_file_writer_new (void)
 
static void tfile_interp_line (char *line, struct uploaded_tp **utpp, struct uploaded_tsv **utsvp)
 
static void tfile_read (gdb_byte *readbuf, int size)
 
static void tfile_open (const char *arg, int from_tty)
 
static void tfile_close (struct target_ops *self)
 
static void tfile_files_info (struct target_ops *t)
 
static void tfile_get_tracepoint_status (struct target_ops *self, struct breakpoint *tp, struct uploaded_tp *utp)
 
static CORE_ADDR tfile_get_traceframe_address (off_t tframe_offset)
 
static int tfile_trace_find (struct target_ops *self, enum trace_find_type type, int num, CORE_ADDR addr1, CORE_ADDR addr2, int *tpp)
 
static int match_blocktype (char blocktype, void *data)
 
static int traceframe_walk_blocks (walk_blocks_callback_func callback, int pos, void *data)
 
static int traceframe_find_block_type (char type_wanted, int pos)
 
static void tfile_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regno)
 
static enum target_xfer_status tfile_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static int tfile_get_trace_state_variable_value (struct target_ops *self, int tsvnum, LONGEST *val)
 
static int build_traceframe_info (char blocktype, void *data)
 
static struct traceframe_infotfile_traceframe_info (struct target_ops *self)
 
static void init_tfile_ops (void)
 
void _initialize_tracefile_tfile (void)
 

Variables

static const struct trace_file_write_ops tfile_write_ops
 
static struct target_ops tfile_ops
 
static char * trace_filename
 
static int trace_fd = -1
 
static off_t trace_frames_offset
 
static off_t cur_offset
 
static int cur_data_size
 
int trace_regblock_size
 
initialize_file_ftype _initialize_tracefile_tfile
 

Macro Definition Documentation

#define MAX_TRACE_UPLOAD   2000

Definition at line 208 of file tracefile-tfile.c.

Referenced by tfile_write_uploaded_tp().

#define O_LARGEFILE   0

Definition at line 33 of file tracefile-tfile.c.

Referenced by tfile_open().

#define TFILE_PID   (1)

Definition at line 347 of file tracefile-tfile.c.

Referenced by tfile_open().

#define TRACE_HEADER_SIZE   8

Definition at line 345 of file tracefile-tfile.c.

Referenced by tfile_open().

Typedef Documentation

typedef int(* walk_blocks_callback_func) (char blocktype, void *data)

Definition at line 708 of file tracefile-tfile.c.

Function Documentation

void _initialize_tracefile_tfile ( void  )

Definition at line 1050 of file tracefile-tfile.c.

References add_target_with_completer(), init_tfile_ops(), and tfile_ops.

static int build_traceframe_info ( char  blocktype,
void *  data 
)
static
static void init_tfile_ops ( void  )
static
static int match_blocktype ( char  blocktype,
void *  data 
)
static

Definition at line 714 of file tracefile-tfile.c.

Referenced by traceframe_find_block_type().

static void tfile_close ( struct target_ops self)
static
static void tfile_dtor ( struct trace_file_writer self)
static
static void tfile_end ( struct trace_file_writer self)
static
static void tfile_fetch_registers ( struct target_ops ops,
struct regcache regcache,
int  regno 
)
static
static void tfile_files_info ( struct target_ops t)
static

Definition at line 560 of file tracefile-tfile.c.

References printf_filtered(), and trace_filename.

Referenced by init_tfile_ops().

static int tfile_get_trace_state_variable_value ( struct target_ops self,
int  tsvnum,
LONGEST val 
)
static
static CORE_ADDR tfile_get_traceframe_address ( off_t  tframe_offset)
static
static void tfile_get_tracepoint_status ( struct target_ops self,
struct breakpoint tp,
struct uploaded_tp utp 
)
static

Definition at line 566 of file tracefile-tfile.c.

Referenced by init_tfile_ops().

static void tfile_interp_line ( char *  line,
struct uploaded_tp **  utpp,
struct uploaded_tsv **  utsvp 
)
static
static void tfile_open ( const char *  arg,
int  from_tty 
)
static
static void tfile_read ( gdb_byte readbuf,
int  size 
)
static
static void tfile_start ( struct trace_file_writer self,
const char *  filename 
)
static
static int tfile_target_save ( struct trace_file_writer self,
const char *  filename 
)
static

Definition at line 53 of file tracefile-tfile.c.

References err, and target_save_trace_data.

struct trace_file_writer* tfile_trace_file_writer_new ( void  )
static int tfile_trace_find ( struct target_ops self,
enum trace_find_type  type,
int  num,
CORE_ADDR  addr1,
CORE_ADDR  addr2,
int tpp 
)
static
static struct traceframe_info* tfile_traceframe_info ( struct target_ops self)
static

Definition at line 1018 of file tracefile-tfile.c.

References build_traceframe_info(), and traceframe_walk_blocks().

Referenced by init_tfile_ops().

static void tfile_write_definition_end ( struct trace_file_writer self)
static

Definition at line 269 of file tracefile-tfile.c.

References tfile_trace_file_writer::fp.

static void tfile_write_header ( struct trace_file_writer self)
static
static void tfile_write_raw_data ( struct trace_file_writer self,
gdb_byte buf,
LONGEST  len 
)
static
static void tfile_write_regblock_type ( struct trace_file_writer self,
int  size 
)
static

Definition at line 115 of file tracefile-tfile.c.

References tfile_trace_file_writer::fp.

static void tfile_write_status ( struct trace_file_writer self,
struct trace_status ts 
)
static
static void tfile_write_uploaded_tp ( struct trace_file_writer self,
struct uploaded_tp utp 
)
static
static void tfile_write_uploaded_tsv ( struct trace_file_writer self,
struct uploaded_tsv utsv 
)
static
static enum target_xfer_status tfile_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static int traceframe_find_block_type ( char  type_wanted,
int  pos 
)
static
static int traceframe_walk_blocks ( walk_blocks_callback_func  callback,
int  pos,
void *  data 
)
static

Variable Documentation

initialize_file_ftype _initialize_tracefile_tfile
int cur_data_size
static

Definition at line 353 of file tracefile-tfile.c.

Referenced by tfile_trace_find(), and traceframe_walk_blocks().

off_t cur_offset
static
struct target_ops tfile_ops
static

Definition at line 341 of file tracefile-tfile.c.

Referenced by _initialize_tracefile_tfile(), init_tfile_ops(), and tfile_open().

const struct trace_file_write_ops tfile_write_ops
static
Initial value:
=
{
NULL,
}
static void tfile_dtor(struct trace_file_writer *self)
static void tfile_write_uploaded_tsv(struct trace_file_writer *self, struct uploaded_tsv *utsv)
static void tfile_write_regblock_type(struct trace_file_writer *self, int size)
static void tfile_write_definition_end(struct trace_file_writer *self)
static int tfile_target_save(struct trace_file_writer *self, const char *filename)
static void tfile_write_header(struct trace_file_writer *self)
static void tfile_write_uploaded_tp(struct trace_file_writer *self, struct uploaded_tp *utp)
static void tfile_end(struct trace_file_writer *self)
static void tfile_start(struct trace_file_writer *self, const char *filename)
static void tfile_write_raw_data(struct trace_file_writer *self, gdb_byte *buf, LONGEST len)
static void tfile_write_status(struct trace_file_writer *self, struct trace_status *ts)

Definition at line 308 of file tracefile-tfile.c.

Referenced by tfile_trace_file_writer_new().

int trace_fd = -1
static
char* trace_filename
static

Definition at line 349 of file tracefile-tfile.c.

Referenced by tfile_close(), tfile_files_info(), tfile_open(), and tfile_read().

off_t trace_frames_offset
static

Definition at line 351 of file tracefile-tfile.c.

Referenced by tfile_open(), and tfile_trace_find().

int trace_regblock_size