This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/4]: Handle SIGINT under Python by raising KeyboardInterrupt
Hi,
On Jul 26, 2012, at 4:52 PM, Tom Tromey wrote:
>>>>>> "Yit" == Khoo Yit Phang <khooyp@cs.umd.edu> writes:
>
> I'm thinking now that we should perhaps have paired macros like:
>
> #define PY_ENTER_GDB \
> { struct cleanup *try_cleanup = use_gdb_signals();
>
> #define PY_LEAVE_GDB \
> do_cleanups (try_cleanup); }
>
>
> Then just bracket all existing TRY_CATCH calls in python/*.c with those.
> Then this can just be a rule for future hacking on the python layer.
This turns out the be way more involved than it seems. In particular, convert_value_from_python (and it's callers) have nested TRY_CATCHs and interleaves calls to Python and calls to GDB. I haven't gone through every TRY_CATCH yet, but using these macros won't be that simple. I'm inclined to just wrap long-running calls for now.
Yit
July 28, 2012