RFC: Make iterator printers fail more gracefully

Jonathan Wakely jwakely@redhat.com
Fri Dec 16 13:50:00 GMT 2016


On 15/12/16 18:29 +0000, Jonathan Wakely wrote:
>On 15/12/16 13:11 -0500, David Malcolm wrote:
>>BTW, is it always a ValueError exception?
>>
>>(I'm a little wary of naked "except:" in Python, as it can catch
>>*anything*, including syntax errors in the try/except-guarded code).
>
>Good point. As far as I know, the gdb.lookup_type method will throw a
>ValueError in the case I'm trying to fix. If it can throw other things
>we can deal with them later by adding other handlers.

One case gets a ValueError from the find_type helper, and one case
gets a gdb.error (which is derived from RuntimeError) because it uses
gdb.lookup_type directly.

Here's a new patch without naked "except:"

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 2586 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20161216/0f6894da/attachment.bin>


More information about the Gcc-patches mailing list