Commit | Line | Data |
---|---|---|
3aee8918 | 1 | /* Target description definitions for remote server for GDB. |
42a4f53d | 2 | Copyright (C) 2012-2019 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 | ||
1a5c2598 TT |
19 | #ifndef GDBSERVER_TDESC_H |
20 | #define GDBSERVER_TDESC_H | |
3aee8918 | 21 | |
f46cd62a | 22 | #include "common/tdesc.h" |
f49ff000 | 23 | |
0a188386 | 24 | #include "regdef.h" |
c4dfafab | 25 | #include <vector> |
f7000548 | 26 | |
f49ff000 YQ |
27 | /* A target description. Inherit from tdesc_feature so that target_desc |
28 | can be used as tdesc_feature. */ | |
3aee8918 | 29 | |
e98577a9 | 30 | struct target_desc : tdesc_element |
3aee8918 | 31 | { |
f7000548 | 32 | /* A vector of elements of register definitions that |
3aee8918 | 33 | describe the inferior's register set. */ |
5cd3e386 | 34 | std::vector<struct reg> reg_defs; |
3aee8918 PA |
35 | |
36 | /* The register cache size, in bytes. */ | |
37 | int registers_size; | |
38 | ||
82ec9bc7 AH |
39 | /* XML features in this target description. */ |
40 | std::vector<tdesc_feature_up> features; | |
41 | ||
adc764e7 | 42 | #ifndef IN_PROCESS_AGENT |
3aee8918 PA |
43 | /* An array of register names. These are the "expedite" registers: |
44 | registers whose values are sent along with stop replies. */ | |
f49ff000 | 45 | const char **expedite_regs = NULL; |
3aee8918 PA |
46 | |
47 | /* Defines what to return when looking for the "target.xml" file in | |
48 | response to qXfer:features:read. Its contents can either be | |
49 | verbatim XML code (prefixed with a '@') or else the name of the | |
0abe8a89 YQ |
50 | actual XML file to be used in place of "target.xml". |
51 | ||
e98577a9 AH |
52 | If NULL then its content will be generated by parsing the target |
53 | description into xml. */ | |
54 | mutable const char *xmltarget = NULL; | |
f49ff000 | 55 | |
0abe8a89 YQ |
56 | /* The value of <architecture> element in the XML, replying GDB. */ |
57 | const char *arch = NULL; | |
58 | ||
59 | /* The value of <osabi> element in the XML, replying GDB. */ | |
60 | const char *osabi = NULL; | |
61 | ||
f49ff000 YQ |
62 | public: |
63 | target_desc () | |
c4dfafab | 64 | : registers_size (0) |
f49ff000 YQ |
65 | {} |
66 | ||
d80e5242 | 67 | ~target_desc (); |
0abe8a89 | 68 | |
d80e5242 | 69 | bool operator== (const target_desc &other) const; |
0a188386 YQ |
70 | |
71 | bool operator!= (const target_desc &other) const | |
72 | { | |
73 | return !(*this == other); | |
74 | } | |
adc764e7 | 75 | #endif |
e98577a9 AH |
76 | |
77 | void accept (tdesc_element_visitor &v) const override; | |
3aee8918 PA |
78 | }; |
79 | ||
80 | /* Copy target description SRC to DEST. */ | |
81 | ||
82 | void copy_target_description (struct target_desc *dest, | |
83 | const struct target_desc *src); | |
84 | ||
190852c8 JB |
85 | /* Initialize TDESC, and then set its expedite_regs field to |
86 | EXPEDITE_REGS. */ | |
3aee8918 | 87 | |
190852c8 JB |
88 | void init_target_desc (struct target_desc *tdesc, |
89 | const char **expedite_regs); | |
3aee8918 PA |
90 | |
91 | /* Return the current inferior's target description. Never returns | |
92 | NULL. */ | |
93 | ||
94 | const struct target_desc *current_target_desc (void); | |
95 | ||
1a5c2598 | 96 | #endif /* GDBSERVER_TDESC_H */ |