GDB (xrefs)

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"`

Go to the source code of this file.

## Classes
struct | recpy_gap_object

## Functions
static PyObject * | recpy_method (PyObject *self, void *closure)
static PyObject * | recpy_format (PyObject *self, void *closure)
static PyObject * | recpy_goto (PyObject *self, PyObject *value)
static PyObject * | recpy_replay_position (PyObject *self, void *closure)
static PyObject * | recpy_instruction_history (PyObject *self, void *closure)
static PyObject * | recpy_function_call_history (PyObject *self, void *closure)
static PyObject * | recpy_begin (PyObject *self, void *closure)
static PyObject * | recpy_end (PyObject *self, void *closure)
PyObject * | recpy_insn_new (ptid_t ptid, enum record_method method, Py_ssize_t number)
static PyObject * | recpy_insn_sal (PyObject *self, void *closure)
static PyObject * | recpy_insn_pc (PyObject *self, void *closure)
static PyObject * | recpy_insn_data (PyObject *self, void *closure)
static PyObject * | recpy_insn_decoded (PyObject *self, void *closure)
static PyObject * | recpy_insn_size (PyObject *self, void *closure)
static PyObject * | recpy_insn_is_speculative (PyObject *self, void *closure)
PyObject * | recpy_func_new (ptid_t ptid, enum record_method method, Py_ssize_t number)
static PyObject * | recpy_func_level (PyObject *self, void *closure)
static PyObject * | recpy_func_symbol (PyObject *self, void *closure)
static PyObject * | recpy_func_instructions (PyObject *self, void *closure)
static PyObject * | recpy_func_up (PyObject *self, void *closure)
static PyObject * | recpy_func_prev (PyObject *self, void *closure)
static PyObject * | recpy_func_next (PyObject *self, void *closure)
static PyObject * | recpy_element_number (PyObject *self, void *closure)
static Py_hash_t | recpy_element_hash (PyObject *self)
static PyObject * | recpy_element_richcompare (PyObject *self, PyObject *other, int op)
PyObject * | recpy_gap_new (int reason_code, const char *reason_string, Py_ssize_t number)
static PyObject * | recpy_gap_number (PyObject *self, void *closure)
static PyObject * | recpy_gap_reason_code (PyObject *self, void *closure)
static PyObject * | recpy_gap_reason_string (PyObject *self, void *closure)
int | gdbpy_initialize_record (void)
PyObject * | gdbpy_start_recording (PyObject *self, PyObject *args)
PyObject * | gdbpy_current_recording (PyObject *self, PyObject *args)
PyObject * | gdbpy_stop_recording (PyObject *self, PyObject *args)

## Variables
static PyTypeObject | recpy_record_type
PyTypeObject | recpy_insn_type
PyTypeObject | recpy_func_type
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
| ) |  |

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

References find_record_target(), inferior_ptid, recpy_record_object::method, recpy_record_object::ptid, recpy_record_type, and target_record_method().

Referenced by gdbpy_start_recording().

## ◆ gdbpy_initialize_record()

int gdbpy_initialize_record | ( | void |  | ) |

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

References py_insn_type, recpy_element_hash(), recpy_element_richcompare(), recpy_func_getset, recpy_func_type, recpy_gap_getset, recpy_gap_type, recpy_insn_getset, recpy_insn_type, recpy_record_getset, recpy_record_methods, and recpy_record_type.

Referenced by do_start_initialization().

## ◆ gdbpy_start_recording()

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

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

References CATCH, END_CATCH, gdbpy_convert_exception(), gdbpy_current_recording(), record_start(), RETURN_MASK_ALL, and TRY.

## ◆ gdbpy_stop_recording()

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

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

References CATCH, END_CATCH, gdbpy_convert_exception(), record_stop(), RETURN_MASK_ALL, and TRY.

## ◆ recpy_begin()

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

Definition at line 153 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 383 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 372 of file py-record.c.

References recpy_element_object::number.

## ◆ recpy_element_richcompare()

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

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

References recpy_element_object::method, recpy_element_object::number, recpy_element_object::ptid, ptid_equal(), and Py_TYPE.

Referenced by gdbpy_initialize_record().

## ◆ recpy_end()

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

Definition at line 166 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

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

References _, recpy_record_object::method, RECORD_METHOD_BTRACE, RECORD_METHOD_FULL, recpy_bt_format(), and recpy_full_format().

## ◆ recpy_func_instructions()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_func_instructions().

## ◆ recpy_func_level()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_func_level().

## ◆ recpy_func_new()

PyObject* recpy_func_new | ( | ptid_t | ptid,
|  | enum record_method | method,
|  | Py_ssize_t | number
| ) |  |

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

References recpy_element_object::method, recpy_element_object::number, recpy_element_object::ptid, and recpy_func_type.

Referenced by btpy_list_item(), recpy_bt_func_next(), recpy_bt_func_prev(), and recpy_bt_func_up().

## ◆ recpy_func_next()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_func_next().

## ◆ recpy_func_prev()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_func_prev().

## ◆ recpy_func_symbol()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_func_symbol().

## ◆ recpy_func_up()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_func_up().

## ◆ recpy_function_call_history()

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

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

References _, recpy_record_object::method, RECORD_METHOD_BTRACE, and recpy_bt_function_call_history().

## ◆ recpy_gap_new()

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

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

References recpy_gap_object::number, recpy_gap_object::reason_code, recpy_gap_object::reason_string, and recpy_gap_type.

Referenced by btpy_insn_or_gap_new().

## ◆ recpy_gap_number()

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

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

References recpy_gap_object::number.

## ◆ recpy_gap_reason_code()

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

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

References recpy_gap_object::reason_code.

## ◆ recpy_gap_reason_string()

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

Definition at line 472 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 101 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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_insn_data().

## ◆ recpy_insn_decoded()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_insn_decoded().

## ◆ recpy_insn_is_speculative()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_insn_is_speculative().

## ◆ recpy_insn_new()

PyObject* recpy_insn_new | ( | ptid_t | ptid,
|  | enum record_method | method,
|  | Py_ssize_t | number
| ) |  |

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

References recpy_element_object::method, recpy_element_object::number, recpy_element_object::ptid, and recpy_insn_type.

Referenced by btpy_insn_or_gap_new(), and btpy_list_item().

## ◆ recpy_insn_pc()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_insn_pc().

## ◆ recpy_insn_sal()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_insn_sal().

## ◆ recpy_insn_size()

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

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

References _, recpy_element_object::method, RECORD_METHOD_BTRACE, and recpy_bt_insn_size().

## ◆ recpy_instruction_history()

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

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

References _, recpy_record_object::method, RECORD_METHOD_BTRACE, and recpy_bt_instruction_history().

## ◆ recpy_method()

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

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

References _, recpy_record_object::method, RECORD_METHOD_BTRACE, RECORD_METHOD_FULL, recpy_bt_method(), and recpy_full_method().

## ◆ recpy_replay_position()

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

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

References _, recpy_record_object::method, RECORD_METHOD_BTRACE, and recpy_bt_replay_position().

## 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 }
}
recpy_func_symbol
static PyObject * recpy_func_symbol(PyObject *self, void *closure)
Definition: py-record.c:306
recpy_func_instructions
static PyObject * recpy_func_instructions(PyObject *self, void *closure)
Definition: py-record.c:319
recpy_func_up
static PyObject * recpy_func_up(PyObject *self, void *closure)
Definition: py-record.c:332
recpy_func_next
static PyObject * recpy_func_next(PyObject *self, void *closure)
Definition: py-record.c:358
recpy_func_prev
static PyObject * recpy_func_prev(PyObject *self, void *closure)
Definition: py-record.c:345
recpy_func_level
static PyObject * recpy_func_level(PyObject *self, void *closure)
Definition: py-record.c:293
recpy_element_number
static PyObject * recpy_element_number(PyObject *self, void *closure)
Definition: py-record.c:372

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

Referenced by gdbpy_initialize_record().

## ◆ recpy_func_type

PyTypeObject recpy_func_type

Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: python-internal.h:133

Definition at line 41 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 }
}
recpy_gap_number
static PyObject * recpy_gap_number(PyObject *self, void *closure)
Definition: py-record.c:452
recpy_gap_reason_string
static PyObject * recpy_gap_reason_string(PyObject *self, void *closure)
Definition: py-record.c:472
recpy_gap_reason_code
static PyObject * recpy_gap_reason_code(PyObject *self, void *closure)
Definition: py-record.c:462

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

Referenced by gdbpy_initialize_record().

## ◆ recpy_gap_type

PyTypeObject recpy_gap_type

Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: python-internal.h:133

Definition at line 47 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 }
}
recpy_insn_decoded
static PyObject * recpy_insn_decoded(PyObject *self, void *closure)
Definition: py-record.c:236
recpy_insn_data
static PyObject * recpy_insn_data(PyObject *self, void *closure)
Definition: py-record.c:223
recpy_insn_pc
static PyObject * recpy_insn_pc(PyObject *self, void *closure)
Definition: py-record.c:210
recpy_insn_is_speculative
static PyObject * recpy_insn_is_speculative(PyObject *self, void *closure)
Definition: py-record.c:262
recpy_insn_sal
static PyObject * recpy_insn_sal(PyObject *self, void *closure)
Definition: py-record.c:197
recpy_insn_size
static PyObject * recpy_insn_size(PyObject *self, void *closure)
Definition: py-record.c:249
recpy_element_number
static PyObject * recpy_element_number(PyObject *self, void *closure)
Definition: py-record.c:372

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

Referenced by gdbpy_initialize_record().

## ◆ recpy_insn_type

PyTypeObject recpy_insn_type

Initial value:
= {
PyVarObject_HEAD_INIT (NULL, 0)
}
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: python-internal.h:133

Definition at line 35 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 }
}
recpy_instruction_history
static PyObject * recpy_instruction_history(PyObject *self, void *closure)
Definition: py-record.c:127
recpy_begin
static PyObject * recpy_begin(PyObject *self, void *closure)
Definition: py-record.c:153
recpy_replay_position
static PyObject * recpy_replay_position(PyObject *self, void *closure)
Definition: py-record.c:114
recpy_method
static PyObject * recpy_method(PyObject *self, void *closure)
Definition: py-record.c:69
recpy_end
static PyObject * recpy_end(PyObject *self, void *closure)
Definition: py-record.c:166
recpy_format
static PyObject * recpy_format(PyObject *self, void *closure)
Definition: py-record.c:85
recpy_function_call_history
static PyObject * recpy_function_call_history(PyObject *self, void *closure)
Definition: py-record.c:140

Definition at line 490 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 }
}
recpy_goto
static PyObject * recpy_goto(PyObject *self, PyObject *value)
Definition: py-record.c:101

Definition at line 481 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)
}
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: python-internal.h:133

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

Referenced by gdbpy_current_recording(), and gdbpy_initialize_record().