convert to_rcmd
[deliverable/binutils-gdb.git] / gdb / target-delegates.c
CommitLineData
1101cb7b
TT
1/* THIS FILE IS GENERATED -*- buffer-read-only: t -*- */
2/* vi:set ro: */
3
4/* To regenerate this file, run:*/
5/* make-target-delegates target.h > target-delegates.c */
e9a29200
TT
6static void
7delegate_attach (struct target_ops *self, char *arg1, int arg2)
8{
9 self = self->beneath;
10 self->to_attach (self, arg1, arg2);
11}
12
09da0d0a
TT
13static void
14delegate_detach (struct target_ops *self, const char *arg1, int arg2)
15{
16 self = self->beneath;
17 self->to_detach (self, arg1, arg2);
18}
19
20static void
21tdefault_detach (struct target_ops *self, const char *arg1, int arg2)
22{
23}
24
6b84065d
TT
25static void
26delegate_resume (struct target_ops *self, ptid_t arg1, int arg2, enum gdb_signal arg3)
27{
28 self = self->beneath;
29 self->to_resume (self, arg1, arg2, arg3);
30}
31
32static void
33tdefault_resume (struct target_ops *self, ptid_t arg1, int arg2, enum gdb_signal arg3)
34{
35 noprocess ();
36}
37
38static ptid_t
39delegate_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2, int arg3)
40{
41 self = self->beneath;
42 return self->to_wait (self, arg1, arg2, arg3);
43}
44
45static ptid_t
46tdefault_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2, int arg3)
47{
48 noprocess ();
49}
50
51static void
52delegate_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
53{
54 self = self->beneath;
55 self->to_store_registers (self, arg1, arg2);
56}
57
58static void
59tdefault_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
60{
61 noprocess ();
62}
63
64static int
65delegate_insert_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
66{
67 self = self->beneath;
68 return self->to_insert_breakpoint (self, arg1, arg2);
69}
70
71static int
72delegate_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
73{
74 self = self->beneath;
75 return self->to_remove_breakpoint (self, arg1, arg2);
76}
77
78static int
79delegate_stopped_by_watchpoint (struct target_ops *self)
80{
81 self = self->beneath;
82 return self->to_stopped_by_watchpoint (self);
83}
84
85static int
86tdefault_stopped_by_watchpoint (struct target_ops *self)
87{
88 return 0;
89}
90
91static int
92delegate_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
93{
94 self = self->beneath;
95 return self->to_stopped_data_address (self, arg1);
96}
97
98static int
99tdefault_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
100{
101 return 0;
102}
103
a53f3625
TT
104static void
105delegate_rcmd (struct target_ops *self, char *arg1, struct ui_file *arg2)
106{
107 self = self->beneath;
108 self->to_rcmd (self, arg1, arg2);
109}
110
6b84065d
TT
111static int
112delegate_can_async_p (struct target_ops *self)
113{
114 self = self->beneath;
115 return self->to_can_async_p (self);
116}
117
118static int
119delegate_is_async_p (struct target_ops *self)
120{
121 self = self->beneath;
122 return self->to_is_async_p (self);
123}
124
125static void
126delegate_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
127{
128 self = self->beneath;
129 self->to_async (self, arg1, arg2);
130}
131
132static void
133tdefault_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
134{
135 tcomplain ();
136}
137
138static enum target_xfer_status
139delegate_xfer_partial (struct target_ops *self, enum target_object arg1, const char *arg2, gdb_byte *arg3, const gdb_byte *arg4, ULONGEST arg5, ULONGEST arg6, ULONGEST *arg7)
140{
141 self = self->beneath;
142 return self->to_xfer_partial (self, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
143}
144
145static enum target_xfer_status
146tdefault_xfer_partial (struct target_ops *self, enum target_object arg1, const char *arg2, gdb_byte *arg3, const gdb_byte *arg4, ULONGEST arg5, ULONGEST arg6, ULONGEST *arg7)
147{
148 return TARGET_XFER_E_IO;
149}
150
46917d26
TT
151static int
152delegate_supports_btrace (struct target_ops *self)
153{
154 self = self->beneath;
155 return self->to_supports_btrace (self);
156}
157
158static int
159tdefault_supports_btrace (struct target_ops *self)
160{
161 return 0;
162}
163
1101cb7b
TT
164static void
165install_delegators (struct target_ops *ops)
166{
e9a29200
TT
167 if (ops->to_attach == NULL)
168 ops->to_attach = delegate_attach;
09da0d0a
TT
169 if (ops->to_detach == NULL)
170 ops->to_detach = delegate_detach;
6b84065d
TT
171 if (ops->to_resume == NULL)
172 ops->to_resume = delegate_resume;
173 if (ops->to_wait == NULL)
174 ops->to_wait = delegate_wait;
175 if (ops->to_store_registers == NULL)
176 ops->to_store_registers = delegate_store_registers;
177 if (ops->to_insert_breakpoint == NULL)
178 ops->to_insert_breakpoint = delegate_insert_breakpoint;
179 if (ops->to_remove_breakpoint == NULL)
180 ops->to_remove_breakpoint = delegate_remove_breakpoint;
181 if (ops->to_stopped_by_watchpoint == NULL)
182 ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
183 if (ops->to_stopped_data_address == NULL)
184 ops->to_stopped_data_address = delegate_stopped_data_address;
a53f3625
TT
185 if (ops->to_rcmd == NULL)
186 ops->to_rcmd = delegate_rcmd;
6b84065d
TT
187 if (ops->to_can_async_p == NULL)
188 ops->to_can_async_p = delegate_can_async_p;
189 if (ops->to_is_async_p == NULL)
190 ops->to_is_async_p = delegate_is_async_p;
191 if (ops->to_async == NULL)
192 ops->to_async = delegate_async;
193 if (ops->to_xfer_partial == NULL)
194 ops->to_xfer_partial = delegate_xfer_partial;
46917d26
TT
195 if (ops->to_supports_btrace == NULL)
196 ops->to_supports_btrace = delegate_supports_btrace;
1101cb7b
TT
197}
198
199static void
200install_dummy_methods (struct target_ops *ops)
201{
e9a29200 202 ops->to_attach = find_default_attach;
09da0d0a 203 ops->to_detach = tdefault_detach;
6b84065d
TT
204 ops->to_resume = tdefault_resume;
205 ops->to_wait = tdefault_wait;
206 ops->to_store_registers = tdefault_store_registers;
207 ops->to_insert_breakpoint = memory_insert_breakpoint;
208 ops->to_remove_breakpoint = memory_remove_breakpoint;
209 ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
210 ops->to_stopped_data_address = tdefault_stopped_data_address;
a53f3625 211 ops->to_rcmd = default_rcmd;
6b84065d
TT
212 ops->to_can_async_p = find_default_can_async_p;
213 ops->to_is_async_p = find_default_is_async_p;
214 ops->to_async = tdefault_async;
215 ops->to_xfer_partial = tdefault_xfer_partial;
46917d26 216 ops->to_supports_btrace = tdefault_supports_btrace;
1101cb7b 217}
This page took 0.056395 seconds and 4 git commands to generate.