105 struct value *
function =
160 static char *keywords[] = {
"frame",
"internal", NULL };
164 PyObject *frame_obj = NULL;
169 PyObject *
internal = NULL;
172 char *addr_str, small_buf[100];
175 if (!PyArg_ParseTupleAndKeywords (args, kwargs,
"|OO", keywords,
176 &frame_obj, &
internal))
182 if (frame_obj == NULL)
189 PyErr_SetString (PyExc_ValueError,
190 _(
"Invalid ID for the `frame' object."));
197 PyErr_SetString (PyExc_ValueError,
198 _(
"\"FinishBreakpoint\" not "
199 "meaningful in the outermost "
204 PyErr_SetString (PyExc_ValueError,
205 _(
"\"FinishBreakpoint\" cannot "
206 "be set on a dummy frame."));
212 PyErr_SetString (PyExc_ValueError,
213 _(
"Invalid ID for the `frame' object."));
224 if (PyErr_Occurred ())
230 PyErr_SetString (PyExc_ValueError,
231 _(
"No thread currently selected."));
237 internal_bp = PyObject_IsTrue (
internal);
238 if (internal_bp == -1)
240 PyErr_SetString (PyExc_ValueError,
241 _(
"The value of `internal' must be a boolean."));
255 if (
function != NULL)
257 struct type *ret_type =
263 struct value *func_value;
302 addr_str = small_buf;
305 addr_str, NULL, thread, NULL,
312 0, 1, internal_bp, 0);
337 PyObject *py_obj = (PyObject *) bp_obj;
342 PyObject *meth_result;
345 if (meth_result == NULL)
347 Py_XDECREF (meth_result);
441 "gdb.Value object representing the return value, if any. \
442 None otherwise.", NULL },
449 "gdb.FinishBreakpoint",
467 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
468 "GDB finish breakpoint object",
477 finish_breakpoint_object_getset,
struct gdbarch * target_gdbarch(void)
struct frame_info * frame_find_by_id(struct frame_id id)
int gdb_pymodule_addobject(PyObject *module, const char *name, PyObject *object)
char * hex_string(LONGEST num)
#define target_has_registers
void bpfinishpy_pre_stop_hook(struct gdbpy_breakpoint_object *bp_obj)
int gdbpy_initialize_finishbreakpoints(void)
CORE_ADDR get_frame_pc(struct frame_info *frame)
struct frame_info * get_current_frame(void)
gdbpy_breakpoint_object * bppy_pending_object
struct frame_info * get_prev_frame(struct frame_info *this_frame)
struct type * type_object_to_type(PyObject *obj)
const struct frame_id null_frame_id
int get_frame_pc_if_available(struct frame_info *frame, CORE_ADDR *pc)
static void bpfinishpy_handle_exit(struct inferior *inf)
PyObject * function_value
static int bpfinishpy_detect_out_scope_cb(struct breakpoint *b, void *args)
struct value * read_var_value(struct symbol *var, struct frame_info *frame)
struct observer * observer_attach_inferior_exit(observer_inferior_exit_ftype *f)
struct gdbpy_breakpoint_object * py_bp_object
static void bpfinishpy_handle_stop(struct bpstats *bs, int print_frame)
struct program_space * pspace
static int bpfinishpy_init(PyObject *self, PyObject *args, PyObject *kwargs)
int frame_id_eq(struct frame_id l, struct frame_id r)
gdbpy_breakpoint_object py_bp
enum frame_type get_frame_type(struct frame_info *frame)
struct value * get_return_value(struct value *function, struct type *value_type, struct dummy_frame_context_saver *ctx_saver)
struct frame_id get_frame_id(struct frame_info *fi)
#define CATCH(EXCEPTION, MASK)
struct program_space * pspace
struct breakpoint * iterate_over_breakpoints(int(*callback)(struct breakpoint *, void *), void *data)
struct symbol * find_pc_function(CORE_ADDR pc)
void disable_breakpoint(struct breakpoint *bpt)
#define GDB_PY_SET_HANDLE_EXCEPTION(Exception)
struct gdbarch * get_current_arch(void)
struct gdbarch * python_gdbarch
struct cleanup * ensure_python_env(struct gdbarch *gdbarch, const struct language_defn *language)
PyObject * value_to_value_object(struct value *val)
static PyObject * bpfinishpy_get_returnvalue(PyObject *self, void *closure)
struct breakpoint_ops bkpt_breakpoint_ops
struct breakpoint * breakpoint_at
PyTypeObject finish_breakpoint_object_type
PyTypeObject breakpoint_object_type
static void print_frame(struct frame_info *frame, int print_level, enum print_what print_what, int print_args, struct symtab_and_line sal)
const struct language_defn * current_language
int create_breakpoint(struct gdbarch *gdbarch, char *arg, char *cond_string, int thread, char *extra_string, int parse_arg, int tempflag, enum bptype type_wanted, int ignore_count, enum auto_boolean pending_break_support, const struct breakpoint_ops *ops, int from_tty, int enabled, int internal, unsigned flags)
#define TYPE_TARGET_TYPE(thistype)
void gdbpy_convert_exception(struct gdb_exception exception)
int xsnprintf(char *str, size_t size, const char *format,...)
#define TYPE_CODE(thistype)
void gdbpy_print_stack(void)
static void bpfinishpy_out_of_scope(struct finish_breakpoint_object *bpfinish_obj)
struct inferior * current_inferior(void)
struct program_space * current_program_space
int pid_to_thread_id(ptid_t ptid)
struct observer * observer_attach_normal_stop(observer_normal_stop_ftype *f)
static void bpfinishpy_dealloc(PyObject *self)
struct type * value_type(const struct value *value)
#define SYMBOL_TYPE(symbol)
struct value * value_object_to_value(PyObject *self)
PyTypeObject finish_breakpoint_object_type CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF("finish_breakpoint_object")
struct frame_info * frame_object_to_frame_info(PyObject *obj)
enum enable_state enable_state
void delete_breakpoint(struct breakpoint *bpt)
static char *const outofscope_func
#define PyObject_HasAttrString(obj, attr)
void do_cleanups(struct cleanup *old_chain)
static PyGetSetDef finish_breakpoint_object_getset[]
void bpfinishpy_post_stop_hook(struct gdbpy_breakpoint_object *bp_obj)
#define PyVarObject_HEAD_INIT(type, size)
PyObject * type_to_type_object(struct type *type)