/* Target-dependent code for s390.
- Copyright (C) 2001-2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2023 Free Software Foundation, Inc.
This file is part of GDB.
return true;
}
-/* Allocate and initialize new gdbarch_tdep. Caller is responsible to free
- memory after use. */
+/* Allocate and initialize new gdbarch_tdep. */
-static s390_gdbarch_tdep *
+static s390_gdbarch_tdep_up
s390_gdbarch_tdep_alloc ()
{
- s390_gdbarch_tdep *tdep = new s390_gdbarch_tdep;
+ s390_gdbarch_tdep_up tdep (new s390_gdbarch_tdep);
tdep->tdesc = NULL;
static const char *const stap_register_indirection_suffixes[] = { ")",
NULL };
- s390_gdbarch_tdep *tdep = s390_gdbarch_tdep_alloc ();
- struct gdbarch *gdbarch = gdbarch_alloc (&info, tdep);
+ gdbarch *gdbarch = gdbarch_alloc (&info, s390_gdbarch_tdep_alloc ());
+ s390_gdbarch_tdep *tdep = gdbarch_tdep<s390_gdbarch_tdep> (gdbarch);
tdesc_arch_data_up tdesc_data = tdesc_data_alloc ();
info.tdesc_data = tdesc_data.get ();
/* Check any target description for validity. */
if (!s390_tdesc_valid (tdep, tdesc_data.get ()))
{
- delete tdep;
gdbarch_free (gdbarch);
return NULL;
}
if (tmp->vector_abi != tdep->vector_abi)
continue;
- delete tdep;
gdbarch_free (gdbarch);
return arches->gdbarch;
}