Use gdbpy_ref in bpfinishpy_out_of_scope
This changes bpfinishpy_out_of_scope to use gdbpy_ref. 2017-01-10 Tom Tromey <tom@tromey.com> * python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use gdbpy_ref.
This commit is contained in:
parent
905f2ccab1
commit
16361ffbd1
|
@ -1,3 +1,8 @@
|
||||||
|
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* python/py-finishbreakpoint.c (bpfinishpy_out_of_scope): Use
|
||||||
|
gdbpy_ref.
|
||||||
|
|
||||||
2017-01-10 Tom Tromey <tom@tromey.com>
|
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* python/py-cmd.c (cmdpy_completer_helper): Use gdbpy_ref. Remove
|
* python/py-cmd.c (cmdpy_completer_helper): Use gdbpy_ref. Remove
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "inferior.h"
|
#include "inferior.h"
|
||||||
#include "block.h"
|
#include "block.h"
|
||||||
#include "location.h"
|
#include "location.h"
|
||||||
|
#include "py-ref.h"
|
||||||
|
|
||||||
/* Function that is called when a Python finish bp is found out of scope. */
|
/* Function that is called when a Python finish bp is found out of scope. */
|
||||||
static char * const outofscope_func = "out_of_scope";
|
static char * const outofscope_func = "out_of_scope";
|
||||||
|
@ -337,12 +338,10 @@ bpfinishpy_out_of_scope (struct finish_breakpoint_object *bpfinish_obj)
|
||||||
if (bpfinish_obj->py_bp.bp->enable_state == bp_enabled
|
if (bpfinish_obj->py_bp.bp->enable_state == bp_enabled
|
||||||
&& PyObject_HasAttrString (py_obj, outofscope_func))
|
&& PyObject_HasAttrString (py_obj, outofscope_func))
|
||||||
{
|
{
|
||||||
PyObject *meth_result;
|
gdbpy_ref meth_result (PyObject_CallMethod (py_obj, outofscope_func,
|
||||||
|
NULL));
|
||||||
meth_result = PyObject_CallMethod (py_obj, outofscope_func, NULL);
|
|
||||||
if (meth_result == NULL)
|
if (meth_result == NULL)
|
||||||
gdbpy_print_stack ();
|
gdbpy_print_stack ();
|
||||||
Py_XDECREF (meth_result);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_breakpoint (bpfinish_obj->py_bp.bp);
|
delete_breakpoint (bpfinish_obj->py_bp.bp);
|
||||||
|
|
Loading…
Reference in New Issue