This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]
- From: Tom Tromey <tromey at redhat dot com>
- To: Doug Evans <xdje42 at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 23 Dec 2013 14:57:53 -0700
- Subject: Re: [PATCH v2 02/13] script language API for GDB: extension.[ch]
- Authentication-results: sourceware.org; auth=none
- References: <52a7f3e8 dot e7ed440a dot 1c58 dot 020f at mx dot google dot com>
>>>>> "Doug" == Doug Evans <xdje42@gmail.com> writes:
Doug> +void
Doug> +clear_quit_flag (void)
Doug> +{
Doug> + int i;
Doug> + const struct extension_language_defn *extlang;
Doug> +
Doug> + ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang)
Doug> + {
Doug> + if (extlang->ops->clear_quit_flag != NULL)
Doug> + extlang->ops->clear_quit_flag (extlang);
Doug> + }
Doug> +
Doug> + quit_flag = 0;
Doug> +}
I don't think this will work properly. It seems to me that a given
interrupt may be processed multiple times -- once by each extension
language.
The way it works right now, if Python handles the "quit", then Python
clears the flag -- which also clears gdb's notion of the flag, because
the two are identical.
With the above it seems that Python could clear its flag -- but leave
other extension languages unaware that the interrupt was handled. So, a
subsequent call into Guile will presumably erroneously throw an
exception.
Tom