]>
git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/arch/tdesc.h
1 /* Copyright (C) 2006-2017 Free Software Foundation, Inc.
3 This file is part of GDB.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 #define ARCH_TDESC_H 1
26 /* Return the type associated with ID in the context of FEATURE, or
28 struct tdesc_type
*tdesc_named_type (const struct tdesc_feature
*feature
,
31 /* Return the created feature named NAME in target description TDESC. */
32 struct tdesc_feature
*tdesc_create_feature (struct target_desc
*tdesc
,
34 const char *xml
= nullptr);
37 /* Return the created vector tdesc_type named NAME in FEATURE. */
38 struct tdesc_type
*tdesc_create_vector (struct tdesc_feature
*feature
,
40 struct tdesc_type
*field_type
,
43 /* Return the created struct tdesc_type named NAME in FEATURE. */
44 struct tdesc_type
*tdesc_create_struct (struct tdesc_feature
*feature
,
47 /* Return the created union tdesc_type named NAME in FEATURE. */
48 struct tdesc_type
*tdesc_create_union (struct tdesc_feature
*feature
,
51 /* Return the created flags tdesc_type named NAME in FEATURE. */
52 struct tdesc_type
*tdesc_create_flags (struct tdesc_feature
*feature
,
56 /* Add a new field to TYPE. FIELD_NAME is its name, and FIELD_TYPE is
58 void tdesc_add_field (struct tdesc_type
*type
, const char *field_name
,
59 struct tdesc_type
*field_type
);
61 /* Set the total length of TYPE. Structs which contain bitfields may
62 omit the reserved bits, so the end of the last field may not
64 void tdesc_set_struct_size (struct tdesc_type
*type
, int size
);
66 /* Add a new untyped bitfield to TYPE.
67 Untyped bitfields become either uint32 or uint64 depending on the size
68 of the underlying type. */
69 void tdesc_add_bitfield (struct tdesc_type
*type
, const char *field_name
,
72 /* A flag is just a typed(bool) single-bit bitfield.
73 This function is kept to minimize changes in generated files. */
74 void tdesc_add_flag (struct tdesc_type
*type
, int start
,
75 const char *flag_name
);
77 /* Create a register in feature FEATURE. */
78 void tdesc_create_reg (struct tdesc_feature
*feature
, const char *name
,
79 int regnum
, int save_restore
, const char *group
,
80 int bitsize
, const char *type
);
82 #endif /* ARCH_TDESC_H */