aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-finishbreakpoint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python/py-finishbreakpoint.c')
-rw-r--r--gdb/python/py-finishbreakpoint.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index f3affbd..6faffd2e 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -101,7 +101,7 @@ bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
if (!self_finishbp->return_type)
return;
- TRY
+ try
{
struct value *function =
value_object_to_value (self_finishbp->function_value);
@@ -121,12 +121,11 @@ bpfinishpy_pre_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
self_finishbp->return_value = Py_None;
}
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
gdbpy_convert_exception (except);
gdbpy_print_stack ();
}
- END_CATCH
}
/* Triggered when gdbpy_should_stop has triggered the `stop' callback
@@ -136,18 +135,17 @@ void
bpfinishpy_post_stop_hook (struct gdbpy_breakpoint_object *bp_obj)
{
- TRY
+ try
{
/* Can't delete it here, but it will be removed at the next stop. */
disable_breakpoint (bp_obj->bp);
gdb_assert (bp_obj->bp->disposition == disp_del);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
gdbpy_convert_exception (except);
gdbpy_print_stack ();
}
- END_CATCH
}
/* Python function to create a new breakpoint. */
@@ -172,7 +170,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
&frame_obj, &internal))
return -1;
- TRY
+ try
{
/* Default frame to newest frame if necessary. */
if (frame_obj == NULL)
@@ -210,12 +208,11 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
}
}
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
gdbpy_convert_exception (except);
return -1;
}
- END_CATCH
if (PyErr_Occurred ())
return -1;
@@ -244,7 +241,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
self_bpfinish->return_type = NULL;
self_bpfinish->function_value = NULL;
- TRY
+ try
{
if (get_frame_pc_if_available (frame, &pc))
{
@@ -270,12 +267,11 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
}
}
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
/* Just swallow. Either the return type or the function value
remain NULL. */
}
- END_CATCH
if (self_bpfinish->return_type == NULL || self_bpfinish->function_value == NULL)
{
@@ -291,7 +287,7 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
bppy_pending_object->number = -1;
bppy_pending_object->bp = NULL;
- TRY
+ try
{
/* Set a breakpoint on the return address. */
event_location_up location
@@ -306,11 +302,10 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
&bkpt_breakpoint_ops,
0, 1, internal_bp, 0);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
GDB_PY_SET_HANDLE_EXCEPTION (except);
}
- END_CATCH
self_bpfinish->py_bp.bp->frame_id = frame_id;
self_bpfinish->py_bp.is_finish_bp = 1;
@@ -362,19 +357,18 @@ bpfinishpy_detect_out_scope_cb (struct breakpoint *b, void *args)
/* Check scope if not currently stopped at the FinishBreakpoint. */
if (b != bp_stopped)
{
- TRY
+ try
{
if (b->pspace == current_inferior ()->pspace
&& (!target_has_registers
|| frame_find_by_id (b->frame_id) == NULL))
bpfinishpy_out_of_scope (finish_bp);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception_RETURN_MASK_ALL &except)
{
gdbpy_convert_exception (except);
gdbpy_print_stack ();
}
- END_CATCH
}
}