This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add an evaluation function hook to Python breakpoints.
- From: Tom Tromey <tromey at redhat dot com>
- To: pmuldoon at redhat dot com
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 14 Dec 2010 09:35:48 -0700
- Subject: Re: [patch] Add an evaluation function hook to Python breakpoints.
- References: <m38vztlr2r.fsf@redhat.com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> + PyObject *gdbpy_bp_eval = PyString_FromString ("evaluate");
This is leaked. However...
Phil> + if (PyObject_HasAttr (py_bp, gdbpy_bp_eval))
Phil> + {
Phil> + PyObject *result = PyObject_CallMethodObjArgs (py_bp,
Phil> + gdbpy_bp_eval,
Phil> + NULL);
You can just use PyObject_HasAttrString and PyObject_CallMethod instead.
Phil> +gdb_py_test_silent_cmd "python eval_bp1 = bp_eval(\"$bp_location2\")" "Set breakpoint" 0
Phil> +gdb_py_test_silent_cmd "python also_eval_bp1 = bp_also_eval(\"$bp_location2\")" "Set breakpoint" 0
I think there should also be a test for the case where there is an
ordinary user breakpoint at the same location as the Python breakpoints.
In this case, the user breakpoint should stop, but all the Python
methods should be invoked first.
Tom