Commit | Line | Data |
---|---|---|
3aee8918 | 1 | /* Target description definitions for remote server for GDB. |
61baf725 | 2 | Copyright (C) 2012-2017 Free Software Foundation, Inc. |
3aee8918 PA |
3 | |
4 | This file is part of GDB. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 3 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | |
18 | ||
19 | #ifndef TDESC_H | |
20 | #define TDESC_H | |
21 | ||
f49ff000 YQ |
22 | #include "arch/tdesc.h" |
23 | ||
3aee8918 PA |
24 | struct reg; |
25 | ||
f7000548 YQ |
26 | typedef struct reg *tdesc_reg_p; |
27 | DEF_VEC_P(tdesc_reg_p); | |
28 | ||
f49ff000 YQ |
29 | struct tdesc_feature |
30 | {}; | |
31 | ||
32 | /* A target description. Inherit from tdesc_feature so that target_desc | |
33 | can be used as tdesc_feature. */ | |
3aee8918 | 34 | |
f49ff000 | 35 | struct target_desc : tdesc_feature |
3aee8918 | 36 | { |
f7000548 | 37 | /* A vector of elements of register definitions that |
3aee8918 | 38 | describe the inferior's register set. */ |
f7000548 | 39 | VEC(tdesc_reg_p) *reg_defs; |
3aee8918 PA |
40 | |
41 | /* The register cache size, in bytes. */ | |
42 | int registers_size; | |
43 | ||
adc764e7 | 44 | #ifndef IN_PROCESS_AGENT |
3aee8918 PA |
45 | /* An array of register names. These are the "expedite" registers: |
46 | registers whose values are sent along with stop replies. */ | |
f49ff000 | 47 | const char **expedite_regs = NULL; |
3aee8918 PA |
48 | |
49 | /* Defines what to return when looking for the "target.xml" file in | |
50 | response to qXfer:features:read. Its contents can either be | |
51 | verbatim XML code (prefixed with a '@') or else the name of the | |
52 | actual XML file to be used in place of "target.xml". */ | |
f49ff000 YQ |
53 | const char *xmltarget = NULL; |
54 | ||
55 | public: | |
56 | target_desc () | |
57 | : reg_defs (NULL), registers_size (0) | |
58 | {} | |
59 | ||
60 | ~target_desc () | |
61 | { | |
62 | int i; | |
63 | struct reg *reg; | |
64 | ||
65 | for (i = 0; VEC_iterate (tdesc_reg_p, reg_defs, i, reg); i++) | |
66 | xfree (reg); | |
67 | VEC_free (tdesc_reg_p, reg_defs); | |
68 | } | |
adc764e7 | 69 | #endif |
3aee8918 PA |
70 | }; |
71 | ||
72 | /* Copy target description SRC to DEST. */ | |
73 | ||
74 | void copy_target_description (struct target_desc *dest, | |
75 | const struct target_desc *src); | |
76 | ||
77 | /* Initialize TDESC. */ | |
78 | ||
79 | void init_target_desc (struct target_desc *tdesc); | |
80 | ||
81 | /* Return the current inferior's target description. Never returns | |
82 | NULL. */ | |
83 | ||
84 | const struct target_desc *current_target_desc (void); | |
85 | ||
86 | #endif /* TDESC_H */ |