/* Python interface to finish breakpoints
- Copyright (C) 2011-2013 Free Software Foundation, Inc.
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
-#include "exceptions.h"
#include "python-internal.h"
#include "breakpoint.h"
#include "frame.h"
struct finish_breakpoint_object
{
/* gdb.Breakpoint base class. */
- breakpoint_object py_bp;
+ gdbpy_breakpoint_object py_bp;
/* gdb.Type object of the value return by the breakpointed function.
May be NULL if no debug information was available or return type
was VOID. */
`return_value', if possible. */
void
-bpfinishpy_pre_stop_hook (struct breakpoint_object *bp_obj)
+bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
{
struct finish_breakpoint_object *self_finishbp =
(struct finish_breakpoint_object *) bp_obj;
of the gdb.FinishBreakpoint object BP_OBJ. */
void
-bpfinishpy_post_stop_hook (struct breakpoint_object *bp_obj)
+bpfinishpy_post_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
{
volatile struct gdb_exception except;
if (frame == NULL)
{
- PyErr_SetString (PyExc_ValueError,
+ PyErr_SetString (PyExc_ValueError,
_("Invalid ID for the `frame' object."));
}
else
if (internal)
{
internal_bp = PyObject_IsTrue (internal);
- if (internal_bp == -1)
+ if (internal_bp == -1)
{
- PyErr_SetString (PyExc_ValueError,
+ PyErr_SetString (PyExc_ValueError,
_("The value of `internal' must be a boolean."));
return -1;
}
0, 1, internal_bp, 0);
}
GDB_PY_SET_HANDLE_EXCEPTION (except);
-
+
self_bpfinish->py_bp.bp->frame_id = frame_id;
self_bpfinish->py_bp.is_finish_bp = 1;
-
+
/* Bind the breakpoint with the current program space. */
self_bpfinish->py_bp.bp->pspace = current_program_space;
static void
bpfinishpy_out_of_scope (struct finish_breakpoint_object *bpfinish_obj)
{
- breakpoint_object *bp_obj = (breakpoint_object *) bpfinish_obj;
+ gdbpy_breakpoint_object *bp_obj = (gdbpy_breakpoint_object *) bpfinish_obj;
PyObject *py_obj = (PyObject *) bp_obj;
if (bpfinish_obj->py_bp.bp->enable_state == bp_enabled
struct breakpoint *bp_stopped = (struct breakpoint *) args;
PyObject *py_bp = (PyObject *) b->py_bp_object;
struct gdbarch *garch = b->gdbarch ? b->gdbarch : get_current_arch ();
-
+
/* Trigger out_of_scope if this is a FinishBreakpoint and its frame is
not anymore in the current callstack. */
if (py_bp != NULL && b->py_bp_object->is_finish_bp)
{
if (PyType_Ready (&finish_breakpoint_object_type) < 0)
return -1;
-
+
if (gdb_pymodule_addobject (gdb_module, "FinishBreakpoint",
(PyObject *) &finish_breakpoint_object_type) < 0)
return -1;
-
+
observer_attach_normal_stop (bpfinishpy_handle_stop);
observer_attach_inferior_exit (bpfinishpy_handle_exit);