gdb: Remove vec.{c,h} and update code to not include vec.h
[deliverable/binutils-gdb.git] / gdb / guile / scm-type.c
index ee0bfa7e1a358bb32c02180d3120b99b8644e59d..953e17bf0e413b2a93d8fa078fe5ccd160e73c2c 100644 (file)
@@ -26,7 +26,6 @@
 #include "gdbtypes.h"
 #include "objfiles.h"
 #include "language.h"
-#include "common/vec.h"
 #include "bcache.h"
 #include "dwarf2loc.h"
 #include "typeprint.h"
@@ -105,6 +104,7 @@ tyscm_type_smob_type (type_smob *t_smob)
 static std::string
 tyscm_type_name (struct type *type)
 {
+  SCM excp;
   try
     {
       string_file stb;
@@ -112,13 +112,12 @@ tyscm_type_name (struct type *type)
       LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
       return std::move (stb.string ());
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      SCM excp = gdbscm_scm_from_gdb_exception (except);
-      gdbscm_throw (excp);
+      excp = gdbscm_scm_from_gdb_exception (unpack (except));
     }
 
-  gdb_assert_not_reached ("no way to get here");
+  gdbscm_throw (excp);
 }
 \f
 /* Administrivia for type smobs.  */
@@ -234,15 +233,17 @@ tyscm_equal_p_type_smob (SCM type1_scm, SCM type2_scm)
   type1 = type1_smob->type;
   type2 = type2_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       result = types_deeply_equal (type1, type2);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return scm_from_bool (result);
 }
 
@@ -631,7 +632,7 @@ gdbscm_type_sizeof (SCM self)
     {
       check_typedef (type);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
     }
 
@@ -650,15 +651,17 @@ gdbscm_type_strip_typedefs (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       type = check_typedef (type);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (type);
 }
 
@@ -671,15 +674,17 @@ tyscm_get_composite (struct type *type)
 
   for (;;)
     {
+      gdbscm_gdb_exception exc {};
       try
        {
          type = check_typedef (type);
        }
-      catch (const gdb_exception_RETURN_MASK_ALL &except)
+      catch (const gdb_exception &except)
        {
-         GDBSCM_HANDLE_GDB_EXCEPTION (except);
+         exc = unpack (except);
        }
 
+      GDBSCM_HANDLE_GDB_EXCEPTION (exc);
       if (TYPE_CODE (type) != TYPE_CODE_PTR
          && TYPE_CODE (type) != TYPE_CODE_REF)
        break;
@@ -725,17 +730,19 @@ tyscm_array_1 (SCM self, SCM n1_scm, SCM n2_scm, int is_vector,
                                 _("Array length must not be negative"));
     }
 
+  gdbscm_gdb_exception exc {};
   try
     {
       array = lookup_array_range_type (type, n1, n2);
       if (is_vector)
        make_vector_type (array);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (array);
 }
 
@@ -781,15 +788,17 @@ gdbscm_type_pointer (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       type = lookup_pointer_type (type);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (type);
 }
 
@@ -842,15 +851,17 @@ gdbscm_type_reference (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       type = lookup_lvalue_reference_type (type);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (type);
 }
 
@@ -879,15 +890,17 @@ gdbscm_type_const (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       type = make_cv_type (1, 0, type, NULL);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (type);
 }
 
@@ -901,15 +914,17 @@ gdbscm_type_volatile (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       type = make_cv_type (0, 1, type, NULL);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (type);
 }
 
@@ -923,15 +938,17 @@ gdbscm_type_unqualified (SCM self)
     = tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   struct type *type = t_smob->type;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       type = make_cv_type (0, 0, type, NULL);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
 
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
   return tyscm_scm_from_type (type);
 }
 \f
@@ -1231,7 +1248,7 @@ tyscm_lookup_typename (const char *type_name, const struct block *block)
        type = lookup_typename (current_language, get_current_arch (),
                                type_name, block, 0);
     }
-  catch (const gdb_exception_RETURN_MASK_ALL &except)
+  catch (const gdb_exception &except)
     {
       return NULL;
     }
This page took 0.02817 seconds and 4 git commands to generate.