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: RFC: merged python exception handling patch


On Fri, Aug 10, 2012 at 12:42 PM, Tom Tromey <tromey@redhat.com> wrote:
>
> This patch merges my various python exception handling patches into one.
>
> The parts of the patch have been discussed at some length in other
> threads, but to recap, the idea is to make C-c work both when gdb is
> executing gdb code, as well as when it is executing python code.
>
> Built and regtested on x86-64 Fedora 16.
>
> Tom
>
>         * defs.h (quit_flag): Conditionally declare.
>         (clear_quit_flag, check_quit_flag, set_quit_flag): New
>         macros.
>         (QUIT): Use them.
>         * event-top.c (command_handler): Use clear_quit_flag.
>         (handle_sigint): Use set_quit_flag.
>         (async_request_quit): Use check_quit_flag.  Don't check
>         immediate_quit.
>         * exceptions.c (throw_exception): Use clear_quit_flag.
>         * main.c (captured_main): Use clear_quit_flag.
>         * python/python.c (clear_quit_flag, set_quit_flag)
>         (check_quit_flag): New functions.
>         * remote-sim.c (gdb_os_poll_quit): Use check_quit_flag,
>         clear_quit_flag.
>         * remote.c (remote_wait_as): Use check_quit_flag,
>         clear_quit_flag.
>         (remote_start_remote): Call QUIT.
>         * symfile.c (load_progress): Use check_quit_flag.
>         * top.c (command_loop): Use clear_quit_flag.
>         (command_line_input): Call QUIT.
>         * utils.c (quit_flag): Conditionally define.
>         (prompt_for_continue): Call QUIT.  Use quit, not
>         async_request_quit.
>         * remote-mips.c (mips_expect_timeout): Call QUIT.
>         * monitor.c (monitor_expect): Call QUIT.


[Apologies for the repeat!
gmail sent my previous reply out as rich text.]

Hi.  It's fine with me with one nit.

I'd move the ifndef HAVE_PYTHON into check_quit_flag, etc.
It's odd to have them sometimes be macros and sometimes be functions.
This could involve having, e.g., check_quit_flag calling
py_check_quit_flag, but it's not *that* much extra code. :-)


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