X-Git-Url: https://repo.jachan.dev/binutils.git/blobdiff_plain/230d2906b9d1d009b22fd526181bf43e1084ed59..HEAD:/gdb/guile/scm-lazy-string.c diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c index 4d69b234bb..d260e09b91 100644 --- a/gdb/guile/scm-lazy-string.c +++ b/gdb/guile/scm-lazy-string.c @@ -1,6 +1,6 @@ /* Scheme interface to lazy strings. - Copyright (C) 2010-2019 Free Software Foundation, Inc. + Copyright (C) 2010-2022 Free Software Foundation, Inc. This file is part of GDB. @@ -29,7 +29,7 @@ /* The 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. */ @@ -314,7 +314,7 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos, 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); } @@ -338,7 +338,7 @@ lsscm_safe_lazy_string_to_value (SCM string, int arg_pos, } catch (const gdb_exception &except) { - *except_scmp = gdbscm_scm_from_gdb_exception (except); + *except_scmp = gdbscm_scm_from_gdb_exception (unpack (except)); return NULL; }