/* Scheme interface to types.
- Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Copyright (C) 2008-2019 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbtypes.h"
#include "objfiles.h"
#include "language.h"
-#include "vec.h"
#include "bcache.h"
#include "dwarf2loc.h"
#include "typeprint.h"
static std::string
tyscm_type_name (struct type *type)
{
- TRY
+ SCM excp;
+ try
{
string_file stb;
LA_PRINT_TYPE (type, "", &stb, -1, 0, &type_print_raw_options);
return std::move (stb.string ());
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- SCM excp = gdbscm_scm_from_gdb_exception (except);
- gdbscm_throw (excp);
+ excp = gdbscm_scm_from_gdb_exception (unpack (except));
}
- END_CATCH
- gdb_assert_not_reached ("no way to get here");
+ gdbscm_throw (excp);
}
\f
/* Administrivia for type smobs. */
type1 = type1_smob->type;
type2 = type2_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
result = types_deeply_equal (type1, type2);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return scm_from_bool (result);
}
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ try
{
check_typedef (type);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
}
- END_CATCH
/* Ignore exceptions. */
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = check_typedef (type);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (type);
}
for (;;)
{
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = check_typedef (type);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
if (TYPE_CODE (type) != TYPE_CODE_PTR
&& TYPE_CODE (type) != TYPE_CODE_REF)
break;
_("Array length must not be negative"));
}
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
array = lookup_array_range_type (type, n1, n2);
if (is_vector)
make_vector_type (array);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (array);
}
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = lookup_pointer_type (type);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (type);
}
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = lookup_lvalue_reference_type (type);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (type);
}
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = make_cv_type (1, 0, type, NULL);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (type);
}
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = make_cv_type (0, 1, type, NULL);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (type);
}
= tyscm_get_type_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct type *type = t_smob->type;
- TRY
+ gdbscm_gdb_exception exc {};
+ try
{
type = make_cv_type (0, 0, type, NULL);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ exc = unpack (except);
}
- END_CATCH
+ GDBSCM_HANDLE_GDB_EXCEPTION (exc);
return tyscm_scm_from_type (type);
}
\f
{
struct type *type = NULL;
- TRY
+ try
{
if (startswith (type_name, "struct "))
type = lookup_struct (type_name + 7, NULL);
type = lookup_typename (current_language, get_current_arch (),
type_name, block, 0);
}
- CATCH (except, RETURN_MASK_ALL)
+ catch (const gdb_exception &except)
{
return NULL;
}
- END_CATCH
return type;
}