GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Functions | Variables
py-record.c File Reference
#include "defs.h"
#include "py-instruction.h"
#include "py-record.h"
#include "py-record-btrace.h"
#include "py-record-full.h"
#include "target.h"
#include "gdbthread.h"

Go to the source code of this file.

Classes

struct  recpy_gap_object
 

Functions

static PyObjectrecpy_method (PyObject *self, void *closure)
 
static PyObjectrecpy_format (PyObject *self, void *closure)
 
static PyObjectrecpy_goto (PyObject *self, PyObject *value)
 
static PyObjectrecpy_replay_position (PyObject *self, void *closure)
 
static PyObjectrecpy_instruction_history (PyObject *self, void *closure)
 
static PyObjectrecpy_function_call_history (PyObject *self, void *closure)
 
static PyObjectrecpy_begin (PyObject *self, void *closure)
 
static PyObjectrecpy_end (PyObject *self, void *closure)
 
PyObjectrecpy_insn_new (thread_info *thread, enum record_method method, Py_ssize_t number)
 
static PyObjectrecpy_insn_sal (PyObject *self, void *closure)
 
static PyObjectrecpy_insn_pc (PyObject *self, void *closure)
 
static PyObjectrecpy_insn_data (PyObject *self, void *closure)
 
static PyObjectrecpy_insn_decoded (PyObject *self, void *closure)
 
static PyObjectrecpy_insn_size (PyObject *self, void *closure)
 
static PyObjectrecpy_insn_is_speculative (PyObject *self, void *closure)
 
PyObjectrecpy_func_new (thread_info *thread, enum record_method method, Py_ssize_t number)
 
static PyObjectrecpy_func_level (PyObject *self, void *closure)
 
static PyObjectrecpy_func_symbol (PyObject *self, void *closure)
 
static PyObjectrecpy_func_instructions (PyObject *self, void *closure)
 
static PyObjectrecpy_func_up (PyObject *self, void *closure)
 
static PyObjectrecpy_func_prev (PyObject *self, void *closure)
 
static PyObjectrecpy_func_next (PyObject *self, void *closure)
 
static PyObjectrecpy_element_number (PyObject *self, void *closure)
 
static Py_hash_t recpy_element_hash (PyObject *self)
 
static PyObjectrecpy_element_richcompare (PyObject *self, PyObject *other, int op)
 
PyObjectrecpy_gap_new (int reason_code, const char *reason_string, Py_ssize_t number)
 
static PyObjectrecpy_gap_number (PyObject *self, void *closure)
 
static PyObjectrecpy_gap_reason_code (PyObject *self, void *closure)
 
static PyObjectrecpy_gap_reason_string (PyObject *self, void *closure)
 
static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_record (void)
 
PyObjectgdbpy_start_recording (PyObject *self, PyObject *args)
 
PyObjectgdbpy_current_recording (PyObject *self, PyObject *args)
 
PyObjectgdbpy_stop_recording (PyObject *self, PyObject *args)
 
 GDBPY_INITIALIZE_FILE (gdbpy_initialize_record)
 

Variables

static PyTypeObject recpy_record_type
 
PyTypeObject recpy_insn_type
 
PyTypeObject recpy_func_type
 
static PyTypeObject recpy_gap_type
 
static PyMethodDef recpy_record_methods []
 
static gdb_PyGetSetDef recpy_record_getset []
 
static gdb_PyGetSetDef recpy_insn_getset []
 
static gdb_PyGetSetDef recpy_func_getset []
 
static gdb_PyGetSetDef recpy_gap_getset []
 

Function Documentation

◆ gdbpy_current_recording()

PyObject * gdbpy_current_recording ( PyObject * self,
PyObject * args )

◆ GDBPY_INITIALIZE_FILE()

GDBPY_INITIALIZE_FILE ( gdbpy_initialize_record )

◆ gdbpy_initialize_record()

static int CPYCHECKER_NEGATIVE_RESULT_SETS_EXCEPTION gdbpy_initialize_record ( void )
static

◆ gdbpy_start_recording()

PyObject * gdbpy_start_recording ( PyObject * self,
PyObject * args )

Definition at line 598 of file py-record.c.

References gdbpy_convert_exception(), gdbpy_current_recording(), and record_start().

◆ gdbpy_stop_recording()

PyObject * gdbpy_stop_recording ( PyObject * self,
PyObject * args )

Definition at line 640 of file py-record.c.

References GDB_PY_HANDLE_EXCEPTION, and record_stop().

◆ recpy_begin()

static PyObject * recpy_begin ( PyObject * self,
void * closure )
static

Definition at line 154 of file py-record.c.

References recpy_record_object::method, RECORD_METHOD_BTRACE, and recpy_bt_begin().

◆ recpy_element_hash()

static Py_hash_t recpy_element_hash ( PyObject * self)
static

Definition at line 386 of file py-record.c.

References recpy_element_object::number.

Referenced by gdbpy_initialize_record().

◆ recpy_element_number()

static PyObject * recpy_element_number ( PyObject * self,
void * closure )
static

Definition at line 375 of file py-record.c.

References gdb_py_object_from_longest(), and recpy_element_object::number.

◆ recpy_element_richcompare()

static PyObject * recpy_element_richcompare ( PyObject * self,
PyObject * other,
int op )
static

◆ recpy_end()

static PyObject * recpy_end ( PyObject * self,
void * closure )
static

Definition at line 167 of file py-record.c.

References recpy_record_object::method, RECORD_METHOD_BTRACE, and recpy_bt_end().

◆ recpy_format()

static PyObject * recpy_format ( PyObject * self,
void * closure )
static

◆ recpy_func_instructions()

static PyObject * recpy_func_instructions ( PyObject * self,
void * closure )
static

◆ recpy_func_level()

static PyObject * recpy_func_level ( PyObject * self,
void * closure )
static

◆ recpy_func_new()

PyObject * recpy_func_new ( thread_info * thread,
enum record_method method,
Py_ssize_t number )

◆ recpy_func_next()

static PyObject * recpy_func_next ( PyObject * self,
void * closure )
static

◆ recpy_func_prev()

static PyObject * recpy_func_prev ( PyObject * self,
void * closure )
static

◆ recpy_func_symbol()

static PyObject * recpy_func_symbol ( PyObject * self,
void * closure )
static

◆ recpy_func_up()

static PyObject * recpy_func_up ( PyObject * self,
void * closure )
static

◆ recpy_function_call_history()

static PyObject * recpy_function_call_history ( PyObject * self,
void * closure )
static

◆ recpy_gap_new()

PyObject * recpy_gap_new ( int reason_code,
const char * reason_string,
Py_ssize_t number )

◆ recpy_gap_number()

static PyObject * recpy_gap_number ( PyObject * self,
void * closure )
static

Definition at line 455 of file py-record.c.

References gdb_py_object_from_longest(), and recpy_gap_object::number.

◆ recpy_gap_reason_code()

static PyObject * recpy_gap_reason_code ( PyObject * self,
void * closure )
static

Definition at line 465 of file py-record.c.

References gdb_py_object_from_longest(), and recpy_gap_object::reason_code.

◆ recpy_gap_reason_string()

static PyObject * recpy_gap_reason_string ( PyObject * self,
void * closure )
static

Definition at line 475 of file py-record.c.

References recpy_gap_object::reason_string.

◆ recpy_goto()

static PyObject * recpy_goto ( PyObject * self,
PyObject * value )
static

Definition at line 102 of file py-record.c.

References recpy_record_object::method, RECORD_METHOD_BTRACE, and recpy_bt_goto().

◆ recpy_insn_data()

static PyObject * recpy_insn_data ( PyObject * self,
void * closure )
static

◆ recpy_insn_decoded()

static PyObject * recpy_insn_decoded ( PyObject * self,
void * closure )
static

◆ recpy_insn_is_speculative()

static PyObject * recpy_insn_is_speculative ( PyObject * self,
void * closure )
static

◆ recpy_insn_new()

PyObject * recpy_insn_new ( thread_info * thread,
enum record_method method,
Py_ssize_t number )

◆ recpy_insn_pc()

static PyObject * recpy_insn_pc ( PyObject * self,
void * closure )
static

◆ recpy_insn_sal()

static PyObject * recpy_insn_sal ( PyObject * self,
void * closure )
static

◆ recpy_insn_size()

static PyObject * recpy_insn_size ( PyObject * self,
void * closure )
static

◆ recpy_instruction_history()

static PyObject * recpy_instruction_history ( PyObject * self,
void * closure )
static

◆ recpy_method()

static PyObject * recpy_method ( PyObject * self,
void * closure )
static

◆ recpy_replay_position()

static PyObject * recpy_replay_position ( PyObject * self,
void * closure )
static

Variable Documentation

◆ recpy_func_getset

gdb_PyGetSetDef recpy_func_getset[]
static
Initial value:
= {
{ "number", recpy_element_number, NULL, "function segment number", NULL},
{ "level", recpy_func_level, NULL, "call stack level", NULL},
{ "symbol", recpy_func_symbol, NULL, "associated line and symbol", NULL},
{ "instructions", recpy_func_instructions, NULL, "list of instructions in \
this function segment", NULL},
{ "up", recpy_func_up, NULL, "caller or returned-to function segment", NULL},
{ "prev", recpy_func_prev, NULL, "previous segment of this function", NULL},
{ "next", recpy_func_next, NULL, "next segment of this function", NULL},
{ NULL }
}
static PyObject * recpy_func_prev(PyObject *self, void *closure)
Definition py-record.c:348
static PyObject * recpy_func_instructions(PyObject *self, void *closure)
Definition py-record.c:322
static PyObject * recpy_func_next(PyObject *self, void *closure)
Definition py-record.c:361
static PyObject * recpy_func_up(PyObject *self, void *closure)
Definition py-record.c:335
static PyObject * recpy_element_number(PyObject *self, void *closure)
Definition py-record.c:375
static PyObject * recpy_func_level(PyObject *self, void *closure)
Definition py-record.c:296
static PyObject * recpy_func_symbol(PyObject *self, void *closure)
Definition py-record.c:309

Definition at line 526 of file py-record.c.

Referenced by gdbpy_initialize_record().

◆ recpy_func_type

PyTypeObject recpy_func_type
Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}

Definition at line 42 of file py-record.c.

Referenced by btrace_func_from_recpy_func(), gdbpy_initialize_record(), recpy_bt_function_call_history(), and recpy_func_new().

◆ recpy_gap_getset

gdb_PyGetSetDef recpy_gap_getset[]
static
Initial value:
= {
{ "number", recpy_gap_number, NULL, "element number", NULL},
{ "reason_code", recpy_gap_reason_code, NULL, "reason code", NULL},
{ "reason_string", recpy_gap_reason_string, NULL, "reason string", NULL},
{ NULL }
}
static PyObject * recpy_gap_reason_code(PyObject *self, void *closure)
Definition py-record.c:465
static PyObject * recpy_gap_number(PyObject *self, void *closure)
Definition py-record.c:455
static PyObject * recpy_gap_reason_string(PyObject *self, void *closure)
Definition py-record.c:475

Definition at line 540 of file py-record.c.

Referenced by gdbpy_initialize_record().

◆ recpy_gap_type

PyTypeObject recpy_gap_type
static
Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}

Definition at line 48 of file py-record.c.

Referenced by gdbpy_initialize_record(), and recpy_gap_new().

◆ recpy_insn_getset

gdb_PyGetSetDef recpy_insn_getset[]
static
Initial value:
= {
{ "number", recpy_element_number, NULL, "instruction number", NULL},
{ "sal", recpy_insn_sal, NULL, "associated symbol and line", NULL},
{ "pc", recpy_insn_pc, NULL, "instruction address", NULL},
{ "data", recpy_insn_data, NULL, "raw instruction data", NULL},
{ "decoded", recpy_insn_decoded, NULL, "decoded instruction", NULL},
{ "size", recpy_insn_size, NULL, "instruction size in byte", NULL},
{ "is_speculative", recpy_insn_is_speculative, NULL, "if the instruction was \
executed speculatively", NULL},
{ NULL }
}
static PyObject * recpy_insn_decoded(PyObject *self, void *closure)
Definition py-record.c:238
static PyObject * recpy_insn_data(PyObject *self, void *closure)
Definition py-record.c:225
static PyObject * recpy_insn_size(PyObject *self, void *closure)
Definition py-record.c:251
static PyObject * recpy_insn_is_speculative(PyObject *self, void *closure)
Definition py-record.c:264
static PyObject * recpy_insn_sal(PyObject *self, void *closure)
Definition py-record.c:199
static PyObject * recpy_insn_pc(PyObject *self, void *closure)
Definition py-record.c:212

Definition at line 512 of file py-record.c.

Referenced by gdbpy_initialize_record().

◆ recpy_insn_type

PyTypeObject recpy_insn_type
Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}

Definition at line 36 of file py-record.c.

Referenced by btpy_list_item(), btrace_insn_from_recpy_insn(), gdbpy_initialize_record(), recpy_bt_func_instructions(), recpy_bt_goto(), recpy_bt_instruction_history(), and recpy_insn_new().

◆ recpy_record_getset

gdb_PyGetSetDef recpy_record_getset[]
static
Initial value:
= {
{ "method", recpy_method, NULL, "Current recording method.", NULL },
{ "format", recpy_format, NULL, "Current recording format.", NULL },
{ "replay_position", recpy_replay_position, NULL, "Current replay position.",
NULL },
{ "instruction_history", recpy_instruction_history, NULL,
"List of instructions in current recording.", NULL },
{ "function_call_history", recpy_function_call_history, NULL,
"List of function calls in current recording.", NULL },
{ "begin", recpy_begin, NULL,
"First instruction in current recording.", NULL },
{ "end", recpy_end, NULL,
"One past the last instruction in current recording. This is typically \
the current instruction and is used for e.g. record.goto (record.end).", NULL },
{ NULL }
}
static PyObject * recpy_replay_position(PyObject *self, void *closure)
Definition py-record.c:115
static PyObject * recpy_format(PyObject *self, void *closure)
Definition py-record.c:86
static PyObject * recpy_begin(PyObject *self, void *closure)
Definition py-record.c:154
static PyObject * recpy_end(PyObject *self, void *closure)
Definition py-record.c:167
static PyObject * recpy_instruction_history(PyObject *self, void *closure)
Definition py-record.c:128
static PyObject * recpy_function_call_history(PyObject *self, void *closure)
Definition py-record.c:141
static PyObject * recpy_method(PyObject *self, void *closure)
Definition py-record.c:70

Definition at line 493 of file py-record.c.

Referenced by gdbpy_initialize_record().

◆ recpy_record_methods

PyMethodDef recpy_record_methods[]
static
Initial value:
= {
{ "goto", recpy_goto, METH_VARARGS,
"goto (instruction|function_call) -> None.\n\
Rewind to given location."},
{ NULL }
}
static PyObject * recpy_goto(PyObject *self, PyObject *value)
Definition py-record.c:102

Definition at line 484 of file py-record.c.

Referenced by gdbpy_initialize_record().

◆ recpy_record_type

PyTypeObject recpy_record_type
static
Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}

Definition at line 30 of file py-record.c.

Referenced by gdbpy_current_recording(), and gdbpy_initialize_record().