/* Scheme interface to types.
- Copyright (C) 2008-2017 Free Software Foundation, Inc.
+ Copyright (C) 2008-2018 Free Software Foundation, Inc.
This file is part of GDB.
{
TRY
{
- struct cleanup *old_chain;
- struct ui_file *stb;
+ string_file stb;
- stb = mem_fileopen ();
- old_chain = make_cleanup_ui_file_delete (stb);
-
- LA_PRINT_TYPE (type, "", stb, -1, 0, &type_print_raw_options);
-
- std::string name = ui_file_as_string (stb);
- do_cleanups (old_chain);
-
- return name;
+ LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
+ return std::move (stb.string ());
}
CATCH (except, RETURN_MASK_ALL)
{
{
type_smob *type1_smob, *type2_smob;
struct type *type1, *type2;
- int result = 0;
+ bool result = false;
SCM_ASSERT_TYPE (tyscm_is_type (type1_scm), type1_scm, SCM_ARG1, FUNC_NAME,
type_smob_name);
return t_smob;
}
+/* Return the type field of T_SCM, an object of type <gdb:type>.
+ This exists so that we don't have to export the struct's contents. */
+
+struct type *
+tyscm_scm_to_type (SCM t_scm)
+{
+ type_smob *t_smob;
+
+ gdb_assert (tyscm_is_type (t_scm));
+ t_smob = (type_smob *) SCM_SMOB_DATA (t_scm);
+ return t_smob->type;
+}
+
/* Helper function for save_objfile_types to make a deep copy of the type. */
static int
TRY
{
- type = lookup_reference_type (type);
+ type = lookup_lvalue_reference_type (type);
}
CATCH (except, RETURN_MASK_ALL)
{
type_smob *t_smob;
struct type *type;
SCM it_scm, result, progress, object;
- int field, rc;
+ int field;
it_scm = itscm_get_iterator_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
i_smob = (iterator_smob *) SCM_SMOB_DATA (it_scm);