/* Target description support for GDB.
- Copyright (C) 2006-2013 Free Software Foundation, Inc.
+ Copyright (C) 2006-2015 Free Software Foundation, Inc.
Contributed by CodeSourcery.
#include "xml-tdesc.h"
#include "osabi.h"
-#include "gdb_assert.h"
#include "gdb_obstack.h"
#include "hashtab.h"
#include "inferior.h"
} tdesc_type_flag;
DEF_VEC_O(tdesc_type_flag);
+enum tdesc_type_kind
+{
+ /* Predefined types. */
+ TDESC_TYPE_INT8,
+ TDESC_TYPE_INT16,
+ TDESC_TYPE_INT32,
+ TDESC_TYPE_INT64,
+ TDESC_TYPE_INT128,
+ TDESC_TYPE_UINT8,
+ TDESC_TYPE_UINT16,
+ TDESC_TYPE_UINT32,
+ TDESC_TYPE_UINT64,
+ TDESC_TYPE_UINT128,
+ TDESC_TYPE_CODE_PTR,
+ TDESC_TYPE_DATA_PTR,
+ TDESC_TYPE_IEEE_SINGLE,
+ TDESC_TYPE_IEEE_DOUBLE,
+ TDESC_TYPE_ARM_FPA_EXT,
+ TDESC_TYPE_I387_EXT,
+
+ /* Types defined by a target feature. */
+ TDESC_TYPE_VECTOR,
+ TDESC_TYPE_STRUCT,
+ TDESC_TYPE_UNION,
+ TDESC_TYPE_FLAGS
+};
+
typedef struct tdesc_type
{
/* The name of this type. */
char *name;
/* Identify the kind of this type. */
- enum
- {
- /* Predefined types. */
- TDESC_TYPE_INT8,
- TDESC_TYPE_INT16,
- TDESC_TYPE_INT32,
- TDESC_TYPE_INT64,
- TDESC_TYPE_INT128,
- TDESC_TYPE_UINT8,
- TDESC_TYPE_UINT16,
- TDESC_TYPE_UINT32,
- TDESC_TYPE_UINT64,
- TDESC_TYPE_UINT128,
- TDESC_TYPE_CODE_PTR,
- TDESC_TYPE_DATA_PTR,
- TDESC_TYPE_IEEE_SINGLE,
- TDESC_TYPE_IEEE_DOUBLE,
- TDESC_TYPE_ARM_FPA_EXT,
- TDESC_TYPE_I387_EXT,
-
- /* Types defined by a target feature. */
- TDESC_TYPE_VECTOR,
- TDESC_TYPE_STRUCT,
- TDESC_TYPE_UNION,
- TDESC_TYPE_FLAGS
- } kind;
+ enum tdesc_type_kind kind;
/* Kind-specific data. */
union
struct tdesc_arch_data *
tdesc_data_alloc (void)
{
- return XZALLOC (struct tdesc_arch_data);
+ return XCNEW (struct tdesc_arch_data);
}
/* Free something allocated by tdesc_data_alloc, if it is not going
int regnum, int save_restore, const char *group,
int bitsize, const char *type)
{
- struct tdesc_reg *reg = XZALLOC (struct tdesc_reg);
+ struct tdesc_reg *reg = XCNEW (struct tdesc_reg);
reg->name = xstrdup (name);
reg->target_regnum = regnum;
tdesc_create_vector (struct tdesc_feature *feature, const char *name,
struct tdesc_type *field_type, int count)
{
- struct tdesc_type *type = XZALLOC (struct tdesc_type);
+ struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name);
type->kind = TDESC_TYPE_VECTOR;
struct tdesc_type *
tdesc_create_struct (struct tdesc_feature *feature, const char *name)
{
- struct tdesc_type *type = XZALLOC (struct tdesc_type);
+ struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name);
type->kind = TDESC_TYPE_STRUCT;
struct tdesc_type *
tdesc_create_union (struct tdesc_feature *feature, const char *name)
{
- struct tdesc_type *type = XZALLOC (struct tdesc_type);
+ struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name);
type->kind = TDESC_TYPE_UNION;
tdesc_create_flags (struct tdesc_feature *feature, const char *name,
LONGEST size)
{
- struct tdesc_type *type = XZALLOC (struct tdesc_type);
+ struct tdesc_type *type = XCNEW (struct tdesc_type);
type->name = xstrdup (name);
type->kind = TDESC_TYPE_FLAGS;
struct tdesc_feature *
tdesc_create_feature (struct target_desc *tdesc, const char *name)
{
- struct tdesc_feature *new_feature = XZALLOC (struct tdesc_feature);
+ struct tdesc_feature *new_feature = XCNEW (struct tdesc_feature);
new_feature->name = xstrdup (name);
struct target_desc *
allocate_target_description (void)
{
- return XZALLOC (struct target_desc);
+ return XCNEW (struct target_desc);
}
static void
static void
set_tdesc_cmd (char *args, int from_tty)
{
- help_list (tdesc_set_cmdlist, "set tdesc ", -1, gdb_stdout);
+ help_list (tdesc_set_cmdlist, "set tdesc ", all_commands, gdb_stdout);
}
static void
static void
unset_tdesc_cmd (char *args, int from_tty)
{
- help_list (tdesc_unset_cmdlist, "unset tdesc ", -1, gdb_stdout);
+ help_list (tdesc_unset_cmdlist, "unset tdesc ", all_commands, gdb_stdout);
}
static void