aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-breakpoint.c10
-rw-r--r--gdb/python/py-finishbreakpoint.c10
-rw-r--r--gdb/python/python.c9
3 files changed, 8 insertions, 21 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 6bf517c..d63f458 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -680,22 +680,16 @@ bppy_init (PyObject *self, PyObject *args, PyObject *kwargs)
{
case bp_breakpoint:
{
- struct event_location *location;
- struct cleanup *cleanup;
-
- location
+ event_location_up location
= string_to_event_location_basic (&copy, current_language);
- cleanup = make_cleanup_delete_event_location (location);
create_breakpoint (python_gdbarch,
- location, NULL, -1, NULL,
+ location.get (), NULL, -1, NULL,
0,
temporary_bp, bp_breakpoint,
0,
AUTO_BOOLEAN_TRUE,
&bkpt_breakpoint_ops,
0, 1, internal_bp, 0);
-
- do_cleanups (cleanup);
break;
}
case bp_watchpoint:
diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
index 797ca84..204d818 100644
--- a/gdb/python/py-finishbreakpoint.c
+++ b/gdb/python/py-finishbreakpoint.c
@@ -293,14 +293,11 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
TRY
{
- struct event_location *location;
- struct cleanup *back_to;
-
/* Set a breakpoint on the return address. */
- location = new_address_location (get_frame_pc (prev_frame), NULL, 0);
- back_to = make_cleanup_delete_event_location (location);
+ event_location_up location
+ = new_address_location (get_frame_pc (prev_frame), NULL, 0);
create_breakpoint (python_gdbarch,
- location, NULL, thread, NULL,
+ location.get (), NULL, thread, NULL,
0,
1 /*temp_flag*/,
bp_breakpoint,
@@ -308,7 +305,6 @@ bpfinishpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
AUTO_BOOLEAN_TRUE,
&bkpt_breakpoint_ops,
0, 1, internal_bp, 0);
- do_cleanups (back_to);
}
CATCH (except, RETURN_MASK_ALL)
{
diff --git a/gdb/python/python.c b/gdb/python/python.c
index e0e24ac..ec202de 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -672,7 +672,7 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
struct cleanup *cleanups;
gdbpy_ref<> result;
gdbpy_ref<> unparsed;
- struct event_location *location = NULL;
+ event_location_up location;
if (! PyArg_ParseTuple (args, "|s", &arg))
return NULL;
@@ -682,15 +682,12 @@ gdbpy_decode_line (PyObject *self, PyObject *args)
sals.sals = NULL;
if (arg != NULL)
- {
- location = string_to_event_location_basic (&arg, python_language);
- make_cleanup_delete_event_location (location);
- }
+ location = string_to_event_location_basic (&arg, python_language);
TRY
{
if (location != NULL)
- sals = decode_line_1 (location, 0, NULL, NULL, 0);
+ sals = decode_line_1 (location.get (), 0, NULL, NULL, 0);
else
{
set_default_source_symtab_and_line ();