GDB (xrefs)

Classes | Macros | Functions | Variables
py-frame.c File Reference
`#include "defs.h"`
`#include "charset.h"`
`#include "block.h"`
`#include "frame.h"`
`#include "symtab.h"`
`#include "stack.h"`
`#include "value.h"`
`#include "python-internal.h"`
`#include "symfile.h"`
`#include "objfiles.h"`
`#include "user-regs.h"`
`#include "py-ref.h"`
`#include "unwind_stop_reasons.def"`

Go to the source code of this file.

## Classes
struct | frame_object

## Macros
#define | FRAPY_REQUIRE_VALID(frame_obj, frame)
#define | SET(name, description)

## Functions
struct frame_info * | frame_object_to_frame_info (PyObject *obj)
static PyObject * | frapy_str (PyObject *self)
static PyObject * | frapy_is_valid (PyObject *self, PyObject *args)
static PyObject * | frapy_name (PyObject *self, PyObject *args)
static PyObject * | frapy_type (PyObject *self, PyObject *args)
static PyObject * | frapy_arch (PyObject *self, PyObject *args)
static PyObject * | frapy_unwind_stop_reason (PyObject *self, PyObject *args)
static PyObject * | frapy_pc (PyObject *self, PyObject *args)
static PyObject * | frapy_read_register (PyObject *self, PyObject *args)
static PyObject * | frapy_block (PyObject *self, PyObject *args)
static PyObject * | frapy_function (PyObject *self, PyObject *args)
PyObject * | frame_info_to_frame_object (struct frame_info *frame)
static PyObject * | frapy_older (PyObject *self, PyObject *args)
static PyObject * | frapy_newer (PyObject *self, PyObject *args)
static PyObject * | frapy_find_sal (PyObject *self, PyObject *args)
static PyObject * | frapy_read_var (PyObject *self, PyObject *args)
static PyObject * | frapy_select (PyObject *self, PyObject *args)
PyObject * | gdbpy_newest_frame (PyObject *self, PyObject *args)
PyObject * | gdbpy_selected_frame (PyObject *self, PyObject *args)
PyObject * | gdbpy_frame_stop_reason_string (PyObject *self, PyObject *args)
static PyObject * | frapy_richcompare (PyObject *self, PyObject *other, int op)
int | gdbpy_initialize_frames (void)

## Variables
static PyMethodDef | frame_object_methods []
PyTypeObject | frame_object_type

## Macro Definition Documentation

## ◆ FRAPY_REQUIRE_VALID

#define FRAPY_REQUIRE_VALID | ( |  | frame_obj,
|  |  | frame
| ) |  |

Value:
do { \
frame = frame_object_to_frame_info (frame_obj); \
if (frame == NULL) \
error (_("Frame is invalid.")); \
} while (0)
_
#define _(String)
Definition: gdb_locale.h:35
frame_object_to_frame_info
struct frame_info * frame_object_to_frame_info(PyObject *obj)
Definition: py-frame.c:63

Definition at line 51 of file py-frame.c.

Referenced by frapy_arch(), frapy_block(), frapy_find_sal(), frapy_function(), frapy_name(), frapy_newer(), frapy_older(), frapy_pc(), frapy_read_register(), frapy_read_var(), frapy_select(), frapy_type(), and frapy_unwind_stop_reason().

## ◆ SET

#define SET | ( |  | name,
|  |  | description
| ) |  |

Value:
if (PyModule_AddIntConstant (gdb_module, "FRAME_"#name, name) < 0) \
return -1;
name
const char *const name
Definition: aarch64-tdep.c:76
gdb_module
PyObject * gdb_module
Definition: python.c:116

## Function Documentation

## ◆ frame_info_to_frame_object()

PyObject* frame_info_to_frame_object | ( | struct frame_info * | frame | ) |

Definition at line 359 of file py-frame.c.

References CATCH, END_CATCH, frame_object_type, gdbpy_convert_exception(), get_frame_arch(), get_frame_id(), get_frame_unwind_stop_reason(), get_next_frame(), get_prev_frame(), gdb::ref_ptr< T, Policy >::release(), RETURN_MASK_ALL, and TRY.

Referenced by bootstrap_python_frame_filters(), create_register_changed_event_object(), frapy_newer(), frapy_older(), gdbpy_newest_frame(), and gdbpy_selected_frame().

## ◆ frame_object_to_frame_info()

struct frame_info* frame_object_to_frame_info | ( | PyObject * | obj | ) |

Definition at line 63 of file py-frame.c.

References frame_find_by_id(), frame_object::frame_id, frame_object::frame_id_is_next, and get_prev_frame().

Referenced by bpfinishpy_init(), frapy_is_valid(), py_print_frame(), and sympy_value().

## ◆ frapy_arch()

static PyObject* frapy_arch | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 180 of file py-frame.c.

References CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, frame_object::gdbarch, gdbarch_to_arch_object(), RETURN_MASK_ALL, and TRY.

## ◆ frapy_block()

static PyObject* frapy_block | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 287 of file py-frame.c.

References _, BLOCK_FUNCTION, BLOCK_SUPERBLOCK, block_to_block_object(), CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, get_frame_block(), RETURN_MASK_ALL, symbol_objfile(), and TRY.

## ◆ frapy_find_sal()

static PyObject* frapy_find_sal | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 466 of file py-frame.c.

References CATCH, END_CATCH, find_frame_sal(), FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, symtab_and_line_to_sal_object(), and TRY.

## ◆ frapy_function()

static PyObject* frapy_function | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 329 of file py-frame.c.

References CATCH, END_CATCH, find_frame_funname(), FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, symbol_to_symbol_object(), and TRY.

## ◆ frapy_is_valid()

static PyObject* frapy_is_valid | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 95 of file py-frame.c.

References CATCH, END_CATCH, frame_object_to_frame_info(), GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, and TRY.

## ◆ frapy_name()

static PyObject* frapy_name | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 119 of file py-frame.c.

References CATCH, END_CATCH, find_frame_funname(), FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, host_charset(), name, RETURN_MASK_ALL, and TRY.

## ◆ frapy_newer()

static PyObject* frapy_newer | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

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

References CATCH, END_CATCH, frame_info_to_frame_object(), FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, get_next_frame(), frame_info::next, RETURN_MASK_ALL, and TRY.

## ◆ frapy_older()

static PyObject* frapy_older | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 401 of file py-frame.c.

References CATCH, END_CATCH, frame_info_to_frame_object(), FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, get_prev_frame(), frame_info::prev, RETURN_MASK_ALL, and TRY.

## ◆ frapy_pc()

static PyObject* frapy_pc | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 226 of file py-frame.c.

References CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, gdb_py_long_from_ulongest, get_frame_pc(), RETURN_MASK_ALL, and TRY.

## ◆ frapy_read_register()

static PyObject* frapy_read_register | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 250 of file py-frame.c.

References _, CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, get_frame_arch(), regnum, RETURN_MASK_ALL, TRY, user_reg_map_name_to_regnum(), value_of_register(), and value_to_value_object().

## ◆ frapy_read_var()

static PyObject* frapy_read_var | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 495 of file py-frame.c.

References _, block_symbol::block, block_object_to_block(), CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, gdbpy_convert_exception(), gdbpy_is_string(), get_frame_block(), lookup_symbol(), python_string_to_target_string(), read_var_value(), RETURN_MASK_ALL, block_symbol::symbol, symbol_object_to_symbol(), symbol_object_type, TRY, value_to_value_object(), and VAR_DOMAIN.

## ◆ frapy_richcompare()

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

Definition at line 667 of file py-frame.c.

References frame_id_eq(), and frame_object_type.

## ◆ frapy_select()

static PyObject* frapy_select | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 578 of file py-frame.c.

References CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, RETURN_MASK_ALL, select_frame(), and TRY.

## ◆ frapy_str()

static PyObject* frapy_str | ( | PyObject * | self | ) |
| static

Definition at line 82 of file py-frame.c.

References string_file::c_str(), and fprint_frame_id().

## ◆ frapy_type()

static PyObject* frapy_type | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 156 of file py-frame.c.

References CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, get_frame_type(), NORMAL_FRAME, RETURN_MASK_ALL, and TRY.

## ◆ frapy_unwind_stop_reason()

static PyObject* frapy_unwind_stop_reason | ( | PyObject * | self,
|  | PyObject * | args
| ) |  |
| static

Definition at line 202 of file py-frame.c.

References CATCH, END_CATCH, FRAPY_REQUIRE_VALID, GDB_PY_HANDLE_EXCEPTION, get_frame_unwind_stop_reason(), RETURN_MASK_ALL, frame_info::stop_reason, and TRY.

## ◆ gdbpy_frame_stop_reason_string()

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

Definition at line 643 of file py-frame.c.

References _, host_charset(), and unwind_stop_reason_to_string().

## ◆ gdbpy_initialize_frames()

int gdbpy_initialize_frames | ( | void |  | ) |

Definition at line 692 of file py-frame.c.

References ARCH_FRAME, DUMMY_FRAME, frame_object_type, gdb_module, gdb_pymodule_addobject(), INLINE_FRAME, NORMAL_FRAME, SENTINEL_FRAME, SIGTRAMP_FRAME, and TAILCALL_FRAME.

Referenced by do_start_initialization().

## ◆ gdbpy_newest_frame()

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

Definition at line 601 of file py-frame.c.

References CATCH, END_CATCH, frame_info_to_frame_object(), GDB_PY_HANDLE_EXCEPTION, get_current_frame(), RETURN_MASK_ALL, and TRY.

## ◆ gdbpy_selected_frame()

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

Definition at line 622 of file py-frame.c.

References CATCH, END_CATCH, frame_info_to_frame_object(), GDB_PY_HANDLE_EXCEPTION, get_selected_frame(), RETURN_MASK_ALL, and TRY.

## Variable Documentation

## ◆ frame_object_methods

PyMethodDef frame_object_methods[]
| static

Definition at line 725 of file py-frame.c.

## ◆ frame_object_type

PyTypeObject frame_object_type

Definition at line 770 of file py-frame.c.

Referenced by frame_info_to_frame_object(), frapy_richcompare(), gdbpy_initialize_frames(), and sympy_value().