mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-11-23 12:09:49 +00:00
Use gdbpy_ref in gdbpy_breakpoint_cond_says_stop
This changes gdbpy_breakpoint_cond_says_stop to use gdbpy_ref rather than explicit reference management. 2017-01-10 Tom Tromey <tom@tromey.com> * python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use gdbpy_ref.
This commit is contained in:
parent
59e9e83119
commit
64081434cc
@ -1,3 +1,8 @@
|
||||
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* python/py-breakpoint.c (gdbpy_breakpoint_cond_says_stop): Use
|
||||
gdbpy_ref.
|
||||
|
||||
2017-01-10 Tom Tromey <tom@tromey.com>
|
||||
|
||||
* python/py-arch.c (archpy_disassemble): Use gdbpy_ref. Don't
|
||||
|
@ -805,12 +805,12 @@ gdbpy_breakpoint_cond_says_stop (const struct extension_language_defn *extlang,
|
||||
|
||||
if (PyObject_HasAttrString (py_bp, stop_func))
|
||||
{
|
||||
PyObject *result = PyObject_CallMethod (py_bp, stop_func, NULL);
|
||||
gdbpy_ref result (PyObject_CallMethod (py_bp, stop_func, NULL));
|
||||
|
||||
stop = 1;
|
||||
if (result)
|
||||
if (result != NULL)
|
||||
{
|
||||
int evaluate = PyObject_IsTrue (result);
|
||||
int evaluate = PyObject_IsTrue (result.get ());
|
||||
|
||||
if (evaluate == -1)
|
||||
gdbpy_print_stack ();
|
||||
@ -819,8 +819,6 @@ gdbpy_breakpoint_cond_says_stop (const struct extension_language_defn *extlang,
|
||||
the Python breakpoint wants GDB to continue. */
|
||||
if (! evaluate)
|
||||
stop = 0;
|
||||
|
||||
Py_DECREF (result);
|
||||
}
|
||||
else
|
||||
gdbpy_print_stack ();
|
||||
|
Loading…
Reference in New Issue
Block a user