]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/python] Eliminate catch(...) in type_to_type_object
authorTom de Vries <tdevries@suse.de>
Thu, 22 Aug 2024 07:49:53 +0000 (09:49 +0200)
committerTom de Vries <tdevries@suse.de>
Thu, 22 Aug 2024 07:49:53 +0000 (09:49 +0200)
In type_to_type_object we have:
...
  try
    {
      if (type->is_stub ())
type = check_typedef (type);
    }
  catch (...)
    {
      /* Just ignore failures in check_typedef.  */
    }
...

The catch is supposed to ignore gdb_exception_error, but it ignores any
exception.

Fix that by only ignoring gdb_exception_error, and handling
gdb_exception_quit / gdb_exception_forced_quit using GDB_PY_HANDLE_EXCEPTION.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/python/py-type.c

index 863e6f6175fc0466017bc41c2b770be450b46f8b..c13b8610d37bc8ddee60e613989554409a5a7ac8 100644 (file)
@@ -1465,10 +1465,14 @@ type_to_type_object (struct type *type)
       if (type->is_stub ())
        type = check_typedef (type);
     }
-  catch (...)
+  catch (const gdb_exception_error &)
     {
       /* Just ignore failures in check_typedef.  */
     }
+  catch (const gdb_exception &except)
+    {
+      GDB_PY_HANDLE_EXCEPTION (except);
+    }
 
   type_obj = PyObject_New (type_object, &type_object_type);
   if (type_obj)