Share i386-linux target description between GDB and GDBserver
[deliverable/binutils-gdb.git] / gdb / arch / tdesc.h
CommitLineData
f49ff000
YQ
1/* Copyright (C) 2006-2017 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
21struct tdesc_feature;
22struct tdesc_type;
23struct tdesc_reg;
24struct target_desc;
25
5f035c07
YQ
26/* Allocate a new target_desc. */
27target_desc *allocate_target_description (void);
28
29/* Set TARGET_DESC's architecture by NAME. */
30void set_tdesc_architecture (target_desc *target_desc,
31 const char *name);
32
33/* Set TARGET_DESC's osabi by NAME. */
34void set_tdesc_osabi (target_desc *target_desc, const char *name);
35
f49ff000
YQ
36/* Return the type associated with ID in the context of FEATURE, or
37 NULL if none. */
38struct tdesc_type *tdesc_named_type (const struct tdesc_feature *feature,
39 const char *id);
40
41/* Return the created feature named NAME in target description TDESC. */
42struct tdesc_feature *tdesc_create_feature (struct target_desc *tdesc,
0abe8a89
YQ
43 const char *name,
44 const char *xml = nullptr);
45
f49ff000
YQ
46
47/* Return the created vector tdesc_type named NAME in FEATURE. */
48struct tdesc_type *tdesc_create_vector (struct tdesc_feature *feature,
49 const char *name,
50 struct tdesc_type *field_type,
51 int count);
52
53/* Return the created struct tdesc_type named NAME in FEATURE. */
54struct tdesc_type *tdesc_create_struct (struct tdesc_feature *feature,
55 const char *name);
56
57/* Return the created union tdesc_type named NAME in FEATURE. */
58struct tdesc_type *tdesc_create_union (struct tdesc_feature *feature,
59 const char *name);
60
61/* Return the created flags tdesc_type named NAME in FEATURE. */
62struct tdesc_type *tdesc_create_flags (struct tdesc_feature *feature,
63 const char *name,
64 int size);
65
66/* Add a new field to TYPE. FIELD_NAME is its name, and FIELD_TYPE is
67 its type. */
68void tdesc_add_field (struct tdesc_type *type, const char *field_name,
69 struct tdesc_type *field_type);
70
71/* Set the total length of TYPE. Structs which contain bitfields may
72 omit the reserved bits, so the end of the last field may not
73 suffice. */
74void tdesc_set_struct_size (struct tdesc_type *type, int size);
75
76/* Add a new untyped bitfield to TYPE.
77 Untyped bitfields become either uint32 or uint64 depending on the size
78 of the underlying type. */
79void tdesc_add_bitfield (struct tdesc_type *type, const char *field_name,
80 int start, int end);
81
82/* A flag is just a typed(bool) single-bit bitfield.
83 This function is kept to minimize changes in generated files. */
84void tdesc_add_flag (struct tdesc_type *type, int start,
85 const char *flag_name);
86
87/* Create a register in feature FEATURE. */
88void tdesc_create_reg (struct tdesc_feature *feature, const char *name,
89 int regnum, int save_restore, const char *group,
90 int bitsize, const char *type);
91
92#endif /* ARCH_TDESC_H */
This page took 0.034464 seconds and 4 git commands to generate.