This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: merged python exception handling patch
On Mon, Aug 13, 2012 at 11:02 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Doug" == Doug Evans <dje@google.com> writes:
>
> Doug> I'd move the ifndef HAVE_PYTHON into check_quit_flag, etc.
> Doug> It's odd to have them sometimes be macros and sometimes be functions.
> Doug> This could involve having, e.g., check_quit_flag calling
> Doug> py_check_quit_flag, but it's not *that* much extra code. :-)
>
> Here's an updated patch.
> Built and regtested both with and without Python.
I like my suggestion better, but ok. :-)
> +/* Return true if the quit flag has been set, false otherwise. */
> +
> +int
> +check_quit_flag (void)
> +{
> + int result = quit_flag;
> +
> + quit_flag = 0;
> + return result;
> +}
It's too bad '!' isn't a valid symbol character, if this were Scheme I
might name it "quit?!". 1/2 :-)
[there isn't an equivalent simple convention here for explicitly
denoting functions with side-effects]
I think the function comment needs to point out that quit_flag is reset.
[I realize the comment at the declaration says this.]
Also, I think you need to temporarily block SIGINT between fetching
quit_flag and resetting it.