GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Functions | Variables
tracefile-tfile.c File Reference
#include "defs.h"
#include "tracefile.h"
#include "readline/tilde.h"
#include "gdbsupport/filestuff.h"
#include "gdbsupport/rsp-low.h"
#include "regcache.h"
#include "inferior.h"
#include "gdbthread.h"
#include "exec.h"
#include "completer.h"
#include "filenames.h"
#include "remote.h"
#include "xml-tdesc.h"
#include "target-descriptions.h"
#include "gdbsupport/pathstuff.h"
#include <algorithm>

Go to the source code of this file.

Classes

class  tfile_target
 
struct  tfile_trace_file_writer
 

Macros

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

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_tdesc (struct trace_file_writer *self)
 
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_append_tdesc_line (const char *line)
 
static void tfile_interp_line (const char *line, struct uploaded_tp **utpp, struct uploaded_tsv **utsvp)
 
static void tfile_read (gdb_byte *readbuf, int size)
 
static void tfile_target_open (const char *arg, int from_tty)
 
static CORE_ADDR tfile_get_traceframe_address (off_t tframe_offset)
 
static int traceframe_walk_blocks (gdb::function_view< bool(char)> callback, int pos)
 
static int traceframe_find_block_type (char type_wanted, int pos)
 
static enum target_xfer_status tfile_xfer_partial_features (const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static bool build_traceframe_info (char blocktype, struct traceframe_info *info)
 
void _initialize_tracefile_tfile ()
 

Variables

static const target_info tfile_target_info
 
static const struct trace_file_write_ops tfile_write_ops
 
static tfile_target tfile_ops
 
static gdb::unique_xmalloc_ptr< 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
 
static std::string trace_tdesc
 

Macro Definition Documentation

◆ MAX_TRACE_UPLOAD

#define MAX_TRACE_UPLOAD   2000

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

Referenced by tfile_write_uploaded_tp().

◆ O_LARGEFILE

#define O_LARGEFILE   0

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

Referenced by tfile_target_open().

◆ TFILE_PID

#define TFILE_PID   (1)

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

Referenced by tfile_target_open().

◆ TRACE_HEADER_SIZE

#define TRACE_HEADER_SIZE   8

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

Referenced by tfile_target_open().

Function Documentation

◆ _initialize_tracefile_tfile()

void _initialize_tracefile_tfile ( )

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

Referenced by initialize_all_files().

◆ build_traceframe_info()

static bool build_traceframe_info ( char blocktype,
struct traceframe_info * info )
static

◆ tfile_append_tdesc_line()

static void tfile_append_tdesc_line ( const char * line)
static

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

References trace_tdesc.

Referenced by tfile_interp_line().

◆ tfile_dtor()

static void tfile_dtor ( struct trace_file_writer * self)
static

◆ tfile_end()

static void tfile_end ( struct trace_file_writer * self)
static

◆ tfile_get_traceframe_address()

static CORE_ADDR tfile_get_traceframe_address ( off_t tframe_offset)
static

◆ tfile_interp_line()

static void tfile_interp_line ( const char * line,
struct uploaded_tp ** utpp,
struct uploaded_tsv ** utsvp )
static

◆ tfile_read()

static void tfile_read ( gdb_byte * readbuf,
int size )
static

◆ tfile_start()

static void tfile_start ( struct trace_file_writer * self,
const char * filename )
static

◆ tfile_target_open()

static void tfile_target_open ( const char * arg,
int from_tty )
static

◆ tfile_target_save()

static int tfile_target_save ( struct trace_file_writer * self,
const char * filename )
static

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

References err, and target_save_trace_data().

◆ tfile_trace_file_writer_new()

struct trace_file_writer * tfile_trace_file_writer_new ( void )

◆ tfile_write_definition_end()

static void tfile_write_definition_end ( struct trace_file_writer * self)
static

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

References tfile_trace_file_writer::fp.

◆ tfile_write_header()

static void tfile_write_header ( struct trace_file_writer * self)
static

◆ tfile_write_raw_data()

static void tfile_write_raw_data ( struct trace_file_writer * self,
gdb_byte * buf,
LONGEST len )
static

◆ tfile_write_regblock_type()

static void tfile_write_regblock_type ( struct trace_file_writer * self,
int size )
static

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

References tfile_trace_file_writer::fp, and size.

◆ tfile_write_status()

static void tfile_write_status ( struct trace_file_writer * self,
struct trace_status * ts )
static

◆ tfile_write_tdesc()

static void tfile_write_tdesc ( struct trace_file_writer * self)
static

◆ tfile_write_uploaded_tp()

static void tfile_write_uploaded_tp ( struct trace_file_writer * self,
struct uploaded_tp * utp )
static

◆ tfile_write_uploaded_tsv()

static void tfile_write_uploaded_tsv ( struct trace_file_writer * self,
struct uploaded_tsv * utsv )
static

◆ tfile_xfer_partial_features()

static enum target_xfer_status tfile_xfer_partial_features ( const char * annex,
gdb_byte * readbuf,
const gdb_byte * writebuf,
ULONGEST offset,
ULONGEST len,
ULONGEST * xfered_len )
static

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

References TARGET_XFER_E_IO, TARGET_XFER_EOF, TARGET_XFER_OK, and trace_tdesc.

Referenced by tfile_target::xfer_partial().

◆ traceframe_find_block_type()

static int traceframe_find_block_type ( char type_wanted,
int pos )
static

◆ traceframe_walk_blocks()

static int traceframe_walk_blocks ( gdb::function_view< bool(char)> callback,
int pos )
static

Variable Documentation

◆ cur_data_size

int cur_data_size
static

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

Referenced by tfile_target::trace_find(), and traceframe_walk_blocks().

◆ cur_offset

off_t cur_offset
static

◆ tfile_ops

tfile_target tfile_ops
static

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

Referenced by tfile_target_open().

◆ tfile_target_info

const target_info tfile_target_info
static
Initial value:
= {
"tfile",
N_("Local trace dump file"),
N_("Use a trace file as a target.\n\
Specify the filename of the trace file.")
}

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

Referenced by tfile_target::info().

◆ tfile_write_ops

const struct trace_file_write_ops tfile_write_ops
static
Initial value:
=
{
NULL,
}
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_definition_end(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_tp(struct trace_file_writer *self, struct uploaded_tp *utp)
static void tfile_write_raw_data(struct trace_file_writer *self, gdb_byte *buf, LONGEST len)
static void tfile_write_tdesc(struct trace_file_writer *self)
static void tfile_end(struct trace_file_writer *self)
static void tfile_write_uploaded_tsv(struct trace_file_writer *self, struct uploaded_tsv *utsv)
static void tfile_dtor(struct trace_file_writer *self)
static void tfile_start(struct trace_file_writer *self, const char *filename)

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

Referenced by tfile_trace_file_writer_new().

◆ trace_fd

int trace_fd = -1
static

◆ trace_filename

gdb::unique_xmalloc_ptr<char> trace_filename
static

◆ trace_frames_offset

off_t trace_frames_offset
static

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

Referenced by tfile_target_open(), and tfile_target::trace_find().

◆ trace_regblock_size

int trace_regblock_size

◆ trace_tdesc

std::string trace_tdesc
static