This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add an evaluation function hook to Python breakpoints.


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]