/* 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.
/* The <gdb:lazy-string> smob. */
-typedef struct
+struct lazy_string_smob
{
/* This always appears first. */
gdb_smob base;
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";
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. */
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
/* 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);
}
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;
}