]> Git Repo - binutils.git/blobdiff - gdb/guile/scm-lazy-string.c
Automatic date update in version.in
[binutils.git] / gdb / guile / scm-lazy-string.c
index 75757c80ba6851888c2d859af33a940bf4a6b2dc..d260e09b91decdb2ae9856a7e3a4d63240b1aaf0 100644 (file)
@@ -1,6 +1,6 @@
 /* Scheme interface to lazy strings.
 
-   Copyright (C) 2010-2018 Free Software Foundation, Inc.
+   Copyright (C) 2010-2022 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -29,7 +29,7 @@
 
 /* The <gdb:lazy-string> smob.  */
 
-typedef struct
+struct lazy_string_smob
 {
   /* This always appears first.  */
   gdb_smob base;
@@ -58,7 +58,7 @@ typedef struct
      This is recorded as an SCM object so that we take advantage of support for
      preserving the type should its owning objfile go away.  */
   SCM type;
-} lazy_string_smob;
+};
 
 static const char lazy_string_smob_name[] = "gdb:lazy-string";
 
@@ -201,11 +201,11 @@ lsscm_elt_type (lazy_string_smob *ls_smob)
 
   realtype = check_typedef (type);
 
-  switch (TYPE_CODE (realtype))
+  switch (realtype->code ())
     {
     case TYPE_CODE_PTR:
     case TYPE_CODE_ARRAY:
-      return TYPE_TARGET_TYPE (realtype);
+      return realtype->target_type ();
     default:
       /* This is done to preserve existing behaviour.  PR 20769.
         E.g., gdb.parse_and_eval("my_int_variable").lazy_string().type.  */
@@ -309,12 +309,12 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
       return NULL;
     }
 
-  TRY
+  try
     {
       struct type *type = tyscm_scm_to_type (ls_smob->type);
       struct type *realtype = check_typedef (type);
 
-      switch (TYPE_CODE (realtype))
+      switch (realtype->code ())
        {
        case TYPE_CODE_PTR:
          /* If a length is specified we need to convert this to an array
@@ -324,7 +324,7 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
              /* PR 20786: There's no way to specify an array of length zero.
                 Record a length of [0,-1] which is how Ada does it.  Anything
                 we do is broken, but this one possible solution.  */
-             type = lookup_array_range_type (TYPE_TARGET_TYPE (realtype),
+             type = lookup_array_range_type (realtype->target_type (),
                                              0, ls_smob->length - 1);
              value = value_at_lazy (type, ls_smob->address);
            }
@@ -336,12 +336,11 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos,
          break;
        }
     }
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception &except)
     {
-      *except_scmp = gdbscm_scm_from_gdb_exception (except);
+      *except_scmp = gdbscm_scm_from_gdb_exception (unpack (except));
       return NULL;
     }
-  END_CATCH
 
   return value;
 }
This page took 0.028057 seconds and 4 git commands to generate.