This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] [python] Implement stop_p for gdb.Breakpoint
- From: Tom Tromey <tromey at redhat dot com>
- To: pmuldoon at redhat dot com
- Cc: gdb-patches at sourceware dot org, dje at google dot com
- Date: Mon, 07 Mar 2011 13:56:19 -0700
- Subject: Re: [patch] [python] Implement stop_p for gdb.Breakpoint
- References: <m31v2y4x64.fsf@redhat.com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> +#if HAVE_PYTHON
Phil> +#include "python/python.h"
Phil> +#endif
You can include this header without the #if.
It is designed to work properly even if Python support is not enabled.
Phil> +#if HAVE_PYTHON
Phil> + /* Evaluate Python breakpoints that have a "condition"
Phil> + method implemented. */
Phil> + if (b->py_bp_object)
Phil> + bs->stop = gdbpy_stop_p (b->py_bp_object);
Phil> +#endif
I think you should remove the #if here and have a second implementation
of gdbpy_stop_p that just calls internal_error. The idea here is that
py_bp_object can only be non-NULL if Python support was actually enabled.
Per the other message, just drop the log-printf stuff from the
submission for now. We can submit it, or not, later on. (I think we
should still put it in Fedora though.)
The rest of the code bits look good to me.
Tom