+2019-06-10 Tom Tromey <tom@tromey.com>
+
+ * python/py-breakpoint.c (gdbpy_breakpoint_created)
+ (gdbpy_breakpoint_deleted, gdbpy_breakpoint_modified): Use
+ gdbpy_enter.
+
2019-06-10 Tom Tromey <tromey@adacore.com>
* elfread.c (elf_read_minimal_symbols): Don't set the dbx objfile
gdbpy_breakpoint_created (struct breakpoint *bp)
{
gdbpy_breakpoint_object *newbp;
- PyGILState_STATE state;
if (!user_breakpoint_p (bp) && bppy_pending_object == NULL)
return;
&& bp->type != bp_access_watchpoint)
return;
- state = PyGILState_Ensure ();
+ struct gdbarch *garch = bp->gdbarch ? bp->gdbarch : get_current_arch ();
+ gdbpy_enter enter_py (garch, current_language);
if (bppy_pending_object)
{
gdb_py_events.breakpoint_created) < 0)
gdbpy_print_stack ();
}
-
- PyGILState_Release (state);
}
/* Callback that is used when a breakpoint is deleted. This will
gdbpy_breakpoint_deleted (struct breakpoint *b)
{
int num = b->number;
- PyGILState_STATE state;
struct breakpoint *bp = NULL;
- state = PyGILState_Ensure ();
bp = get_breakpoint (num);
if (bp)
{
+ struct gdbarch *garch = bp->gdbarch ? bp->gdbarch : get_current_arch ();
+ gdbpy_enter enter_py (garch, current_language);
+
gdbpy_ref<gdbpy_breakpoint_object> bp_obj (bp->py_bp_object);
if (bp_obj != NULL)
{
--bppy_live;
}
}
- PyGILState_Release (state);
}
/* Callback that is used when a breakpoint is modified. */
gdbpy_breakpoint_modified (struct breakpoint *b)
{
int num = b->number;
- PyGILState_STATE state;
struct breakpoint *bp = NULL;
- state = PyGILState_Ensure ();
bp = get_breakpoint (num);
if (bp)
{
+ struct gdbarch *garch = bp->gdbarch ? bp->gdbarch : get_current_arch ();
+ gdbpy_enter enter_py (garch, current_language);
+
PyObject *bp_obj = (PyObject *) bp->py_bp_object;
if (bp_obj)
{
}
}
}
- PyGILState_Release (state);
}
\f