GDB (xrefs)

Classes | Functions | Variables
py-finishbreakpoint.c File Reference
`#include "defs.h"`
`#include "python-internal.h"`
`#include "breakpoint.h"`
`#include "frame.h"`
`#include "gdbthread.h"`
`#include "arch-utils.h"`
`#include "language.h"`
`#include "observer.h"`
`#include "inferior.h"`
`#include "block.h"`
`#include "location.h"`
`#include "py-ref.h"`

Go to the source code of this file.

## Classes
struct | finish_breakpoint_object

## Functions
PyTypeObject finish_breakpoint_object_type | CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("finish_breakpoint_object")
static PyObject * | bpfinishpy_get_returnvalue (PyObject *self, void *closure)
static void | bpfinishpy_dealloc (PyObject *self)
void | bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
void | bpfinishpy_post_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
static int | bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
static void | bpfinishpy_out_of_scope (struct finish_breakpoint_object *bpfinish_obj)
static int | bpfinishpy_detect_out_scope_cb (struct breakpoint *b, void *args)
static void | bpfinishpy_handle_stop (struct bpstats *bs, int print_frame)
static void | bpfinishpy_handle_exit (struct inferior *inf)
int | gdbpy_initialize_finishbreakpoints (void)

## Variables
static const char | outofscope_func [] = "out_of_scope"
static gdb_PyGetSetDef | finish_breakpoint_object_getset []
PyTypeObject | finish_breakpoint_object_type

## Function Documentation

## ◆ bpfinishpy_dealloc()

static void bpfinishpy_dealloc | ( | PyObject * | self | ) |
| static

Definition at line 79 of file py-finishbreakpoint.c.

References finish_breakpoint_object::function_value, finish_breakpoint_object::return_type, and finish_breakpoint_object::return_value.

## ◆ bpfinishpy_detect_out_scope_cb()

static int bpfinishpy_detect_out_scope_cb | ( | struct breakpoint * | b,
|  | void * | args
| ) |  |
| static

Definition at line 350 of file py-finishbreakpoint.c.

References bpfinishpy_out_of_scope(), CATCH, current_inferior(), END_CATCH, frame_find_by_id(), breakpoint::frame_id, gdbpy_convert_exception(), gdbpy_print_stack(), if(), gdbpy_breakpoint_object::is_finish_bp, inferior::pspace, breakpoint::pspace, finish_breakpoint_object::py_bp, breakpoint::py_bp_object, RETURN_MASK_ALL, target_has_registers, and TRY.

Referenced by bpfinishpy_handle_exit(), and bpfinishpy_handle_stop().

## ◆ bpfinishpy_get_returnvalue()

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

Definition at line 64 of file py-finishbreakpoint.c.

References finish_breakpoint_object::return_value.

## ◆ bpfinishpy_handle_exit()

static void bpfinishpy_handle_exit | ( | struct inferior * | inf | ) |
| static

Definition at line 400 of file py-finishbreakpoint.c.

References bpfinishpy_detect_out_scope_cb(), current_language, iterate_over_breakpoints(), and target_gdbarch().

Referenced by gdbpy_initialize_finishbreakpoints().

## ◆ bpfinishpy_handle_stop()

static void bpfinishpy_handle_stop | ( | struct bpstats * | bs,
|  | int | print_frame
| ) |  |
| static

Definition at line 388 of file py-finishbreakpoint.c.

References bpfinishpy_detect_out_scope_cb(), bpstats::breakpoint_at, current_language, get_current_arch(), and iterate_over_breakpoints().

Referenced by gdbpy_initialize_finishbreakpoints().

## ◆ bpfinishpy_init()

static int bpfinishpy_init | ( | PyObject * | self,
|  | PyObject * | args,
|  | PyObject * | kwargs
| ) |  |
| static

Definition at line 157 of file py-finishbreakpoint.c.

References _, AUTO_BOOLEAN_TRUE, bkpt_breakpoint_ops, gdbpy_breakpoint_object::bp, bp_breakpoint, bppy_pending_object, CATCH, create_breakpoint(), current_program_space, DUMMY_FRAME, END_CATCH, find_pc_function(), breakpoint::frame_id, frame_id_eq(), frame_object_to_frame_info(), finish_breakpoint_object::function_value, GDB_PY_SET_HANDLE_EXCEPTION, gdb_PyArg_ParseTupleAndKeywords(), gdbpy_convert_exception(), get_current_frame(), get_frame_id(), get_frame_pc(), get_frame_pc_if_available(), get_frame_type(), get_prev_frame(), inferior_ptid, gdbpy_breakpoint_object::is_finish_bp, value::location, new_address_location(), null_frame_id, gdbpy_breakpoint_object::number, breakpoint::pspace, ptid_to_global_thread_id(), finish_breakpoint_object::py_bp, python_gdbarch, read_var_value(), RETURN_MASK_ALL, finish_breakpoint_object::return_type, SYMBOL_TYPE, TRY, TYPE_CODE, TYPE_CODE_VOID, TYPE_TARGET_TYPE, type_to_type_object(), and value_to_value_object().

## ◆ bpfinishpy_out_of_scope()

static void bpfinishpy_out_of_scope | ( | struct finish_breakpoint_object * | bpfinish_obj | ) |
| static

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

References gdbpy_breakpoint_object::bp, bp_enabled, delete_breakpoint(), breakpoint::enable_state, gdbpy_print_stack(), outofscope_func, finish_breakpoint_object::py_bp, PyObject_CallMethod, and PyObject_HasAttrString.

Referenced by bpfinishpy_detect_out_scope_cb().

## ◆ bpfinishpy_post_stop_hook()

void bpfinishpy_post_stop_hook | ( | struct gdbpy_breakpoint_object * | bp_obj | ) |

Definition at line 137 of file py-finishbreakpoint.c.

References gdbpy_breakpoint_object::bp, CATCH, disable_breakpoint(), disp_del, breakpoint::disposition, END_CATCH, gdb_assert, gdbpy_convert_exception(), gdbpy_print_stack(), RETURN_MASK_ALL, and TRY.

Referenced by gdbpy_breakpoint_cond_says_stop().

## ◆ bpfinishpy_pre_stop_hook()

void bpfinishpy_pre_stop_hook | ( | struct gdbpy_breakpoint_object * | bp_obj | ) |

Definition at line 94 of file py-finishbreakpoint.c.

References CATCH, END_CATCH, finish_breakpoint_object::function_value, gdb_assert, gdbpy_convert_exception(), gdbpy_print_stack(), get_return_value(), RETURN_MASK_ALL, finish_breakpoint_object::return_type, finish_breakpoint_object::return_value, TRY, type_object_to_type(), value_object_to_value(), value_to_value_object(), and value_type().

Referenced by gdbpy_breakpoint_cond_says_stop().

## ◆ CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF()

PyTypeObject finish_breakpoint_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF | ( | "finish_breakpoint_object" |  | ) |

## ◆ gdbpy_initialize_finishbreakpoints()

int gdbpy_initialize_finishbreakpoints | ( | void |  | ) |

Definition at line 410 of file py-finishbreakpoint.c.

References bpfinishpy_handle_exit(), bpfinishpy_handle_stop(), finish_breakpoint_object_type, gdb_module, gdb_pymodule_addobject(), observer_attach_inferior_exit(), and observer_attach_normal_stop().

Referenced by do_start_initialization().

## Variable Documentation

## ◆ finish_breakpoint_object_getset

gdb_PyGetSetDef finish_breakpoint_object_getset[]
| static

Initial value:
= {
{ "return_value", bpfinishpy_get_returnvalue, NULL,
"gdb.Value object representing the return value, if any. \
None otherwise.", NULL },
{ NULL }
}
bpfinishpy_get_returnvalue
static PyObject * bpfinishpy_get_returnvalue(PyObject *self, void *closure)
Definition: py-finishbreakpoint.c:64

Definition at line 425 of file py-finishbreakpoint.c.

## ◆ finish_breakpoint_object_type

PyTypeObject finish_breakpoint_object_type

Definition at line 432 of file py-finishbreakpoint.c.

Referenced by gdbpy_initialize_finishbreakpoints().

## ◆ outofscope_func

const char outofscope_func[] = "out_of_scope"
| static

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

Referenced by bpfinishpy_out_of_scope().