This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Python: fetch value when building gdb.Value object
- From: Phil Muldoon <pmuldoon at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: Paul Koning <paulkoning at comcast dot net>, gdb-patches at sourceware dot org
- Date: Mon, 03 Oct 2011 11:22:04 +0100
- Subject: Re: Python: fetch value when building gdb.Value object
- References: <36B29E9D-F2B3-446F-AF8A-97254A3AAEE2@comcast.net> <m3ipocii6a.fsf@redhat.com> <D9AC6973-91CF-42D4-AD81-0C4A41D3DD2A@comcast.net> <20111001090443.GA11227@host1.jankratochvil.net>
- Reply-to: pmuldoon at redhat dot com
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> On Wed, 28 Sep 2011 22:40:50 +0200, Paul Koning wrote:
>> If I use RETURN_MASK_ERROR and control/C is hit, does that mean the
>> currently running code aborts and the outer handler that does have
>> RETURN_MASK_ALL is entered?
>
> Yes.
>
>> If so, most of the Python code seems to be a candidate for
>> RETURN_MASK_ERROR.
>
> In fact I do not know, it is a Python thing.
>
> RETURN_MASK_ALL is right if returned PyExc_KeyboardInterrupt will really abort
> any execution of Python code. It is probably so, as suggested by:
> http://docs.python.org/library/exceptions.html#exceptions.KeyboardInterrupt
>
> RETURN_MASK_ERROR is right otherwise, but only if it is safe to longjmp out
> from a code called by Python. This may not be true. Python may be C++
> exceptions throwing safe but it cannot be safe for the GDB longjmp exceptions.
> But this case would mean Python is buggy for CTRL-C on its own so
> RETURN_MASK_ERROR probably is not right.
Jan asked me to look at all the cases. I just have not had time to do
it yet. Too me, the RETURN_MASK in many cases in the Python code is far
too liberal, and should, as Jan notes, be reduced to RETURN_MASK_ERROR.
I am not sure it is just a mechanical change as each scenario has to be
carefully reviewed to understand if in fact an interrupt should be
allowed according to the Python API.
Cheers,
Phil