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;
26 struct tdesc_reg;
27 struct target_desc;
28 
29 /* Allocate a new target_desc. */
31 
32 /* Set TARGET_DESC's architecture by NAME. */
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. */
58  const char *name);
59 
60 /* Return the created union tdesc_type named NAME in FEATURE. */
62  const char *name);
63 
64 /* Return the created flags tdesc_type named NAME in 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. */
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. */
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. */
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. */
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 */
void tdesc_add_flag(tdesc_type_with_fields *type, int start, const char *flag_name)
void set_tdesc_osabi(target_desc *target_desc, const char *name)
void set_tdesc_architecture(target_desc *target_desc, const char *name)
void tdesc_create_reg(struct tdesc_feature *feature, const char *name, int regnum, int save_restore, const char *group, int bitsize, const char *type)
const char *const name
Definition: aarch64-tdep.c:76
Definition: gdbtypes.h:749
void tdesc_add_bitfield(tdesc_type_with_fields *type, const char *field_name, int start, int end)
int regnum
Definition: aarch64-tdep.c:77
tdesc_type_with_fields * tdesc_create_union(struct tdesc_feature *feature, const char *name)
struct tdesc_feature * tdesc_create_feature(struct target_desc *tdesc, const char *name, const char *xml=nullptr)
tdesc_type_with_fields * tdesc_create_struct(struct tdesc_feature *feature, const char *name)
target_desc * allocate_target_description(void)
static PyObject * field_name(struct type *type, int field)
Definition: py-type.c:267
struct tdesc_type * tdesc_create_vector(struct tdesc_feature *feature, const char *name, struct tdesc_type *field_type, int count)
struct tdesc_type * tdesc_named_type(const struct tdesc_feature *feature, const char *id)
void tdesc_add_field(tdesc_type_with_fields *type, const char *field_name, struct tdesc_type *field_type)
size_t size
Definition: go32-nat.c:242
tdesc_type_with_fields * tdesc_create_flags(struct tdesc_feature *feature, const char *name, int size)
void tdesc_set_struct_size(tdesc_type_with_fields *type, int size)