GDB (xrefs)

tdesc.h
Go to the documentation of this file.
1 /* Copyright (C) 2006-2018 Free Software Foundation, Inc.
2
3 This file is part of GDB.
4
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.
9
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.
14
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/>. */
17
18 #ifndef ARCH_TDESC_H
19 #define ARCH_TDESC_H 1
20
21 struct tdesc_feature;
22 struct tdesc_type;
23 struct tdesc_type_builtin;
24 struct tdesc_type_vector;
25 struct tdesc_type_with_fields;
26 struct tdesc_reg;
27 struct target_desc;
28
29 /* Allocate a new target_desc. */
30 target_desc *allocate_target_description (void);
31
32 /* Set TARGET_DESC's architecture by NAME. */
33 void set_tdesc_architecture (target_desc *target_desc,
34 const char *name);
35
36 /* Set TARGET_DESC's osabi by NAME. */
37 void set_tdesc_osabi (target_desc *target_desc, const char *name);
38
39 /* Return the type associated with ID in the context of FEATURE, or
40 NULL if none. */
41 struct tdesc_type *tdesc_named_type (const struct tdesc_feature *feature,
42 const char *id);
43
44 /* Return the created feature named NAME in target description TDESC. */
45 struct tdesc_feature *tdesc_create_feature (struct target_desc *tdesc,
46 const char *name,
47 const char *xml = nullptr);
48
49
50 /* Return the created vector tdesc_type named NAME in FEATURE. */
51 struct tdesc_type *tdesc_create_vector (struct tdesc_feature *feature,
52 const char *name,
53 struct tdesc_type *field_type,
54 int count);
55
56 /* Return the created struct tdesc_type named NAME in FEATURE. */
57 tdesc_type_with_fields *tdesc_create_struct (struct tdesc_feature *feature,
58 const char *name);
59
60 /* Return the created union tdesc_type named NAME in FEATURE. */
61 tdesc_type_with_fields *tdesc_create_union (struct tdesc_feature *feature,
62 const char *name);
63
64 /* Return the created flags tdesc_type named NAME in FEATURE. */
65 tdesc_type_with_fields *tdesc_create_flags (struct tdesc_feature *feature,
66 const char *name,
67 int size);
68
69 /* Add a new field to TYPE. FIELD_NAME is its name, and FIELD_TYPE is
70 its type. */
71 void tdesc_add_field (tdesc_type_with_fields *type, const char *field_name,
72 struct tdesc_type *field_type);
73
74 /* Set the total length of TYPE. Structs which contain bitfields may
75 omit the reserved bits, so the end of the last field may not
76 suffice. */
77 void tdesc_set_struct_size (tdesc_type_with_fields *type, int size);
78
79 /* Add a new untyped bitfield to TYPE.
80 Untyped bitfields become either uint32 or uint64 depending on the size
81 of the underlying type. */
82 void tdesc_add_bitfield (tdesc_type_with_fields *type, const char *field_name,
83 int start, int end);
84
85 /* A flag is just a typed(bool) single-bit bitfield.
86 This function is kept to minimize changes in generated files. */
87 void tdesc_add_flag (tdesc_type_with_fields *type, int start,
88 const char *flag_name);
89
90 /* Create a register in feature FEATURE. */
91 void tdesc_create_reg (struct tdesc_feature *feature, const char *name,
92 int regnum, int save_restore, const char *group,
93 int bitsize, const char *type);
94
95 #endif /* ARCH_TDESC_H */
tdesc_type_with_fields
Definition: target-descriptions.c:355
tdesc_type_builtin
Definition: target-descriptions.c:235
tdesc_add_flag
void tdesc_add_flag(tdesc_type_with_fields *type, int start, const char *flag_name)
Definition: target-descriptions.c:1578
set_tdesc_osabi
void set_tdesc_osabi(target_desc *target_desc, const char *name)
Definition: target-descriptions.c:1684
set_tdesc_architecture
void set_tdesc_architecture(target_desc *target_desc, const char *name)
Definition: target-descriptions.c:1668
tdesc_create_reg
void tdesc_create_reg(struct tdesc_feature *feature, const char *name, int regnum, int save_restore, const char *group, int bitsize, const char *type)
Definition: target-descriptions.c:1448
tdesc_type_vector
Definition: target-descriptions.c:324
name
const char *const name
Definition: aarch64-tdep.c:76
tdesc_type
Definition: target-descriptions.c:201
type
Definition: gdbtypes.h:749
tdesc_add_bitfield
void tdesc_add_bitfield(tdesc_type_with_fields *type, const char *field_name, int start, int end)
Definition: target-descriptions.c:1560
tdesc_reg
Definition: target-descriptions.c:79
tdesc_feature
Definition: target-descriptions.c:516
regnum
int regnum
Definition: aarch64-tdep.c:77
tdesc_create_union
tdesc_type_with_fields * tdesc_create_union(struct tdesc_feature *feature, const char *name)
Definition: target-descriptions.c:1495
target_desc
Definition: target-descriptions.c:591
tdesc_create_feature
struct tdesc_feature * tdesc_create_feature(struct target_desc *tdesc, const char *name, const char *xml=nullptr)
Definition: target-descriptions.c:1602
tdesc_create_struct
tdesc_type_with_fields * tdesc_create_struct(struct tdesc_feature *feature, const char *name)
Definition: target-descriptions.c:1473
allocate_target_description
target_desc * allocate_target_description(void)
Definition: target-descriptions.c:1613
field_name
static PyObject * field_name(struct type *type, int field)
Definition: py-type.c:267
tdesc_create_vector
struct tdesc_type * tdesc_create_vector(struct tdesc_feature *feature, const char *name, struct tdesc_type *field_type, int count)
Definition: target-descriptions.c:1461
tdesc_named_type
struct tdesc_type * tdesc_named_type(const struct tdesc_feature *feature, const char *id)
Definition: target-descriptions.c:997
tdesc_add_field
void tdesc_add_field(tdesc_type_with_fields *type, const char *field_name, struct tdesc_type *field_type)
Definition: target-descriptions.c:1535
size
size_t size
Definition: go32-nat.c:242
tdesc_create_flags
tdesc_type_with_fields * tdesc_create_flags(struct tdesc_feature *feature, const char *name, int size)
Definition: target-descriptions.c:1507
tdesc_set_struct_size
void tdesc_set_struct_size(tdesc_type_with_fields *type, int size)
Definition: target-descriptions.c:1485