]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/target-delegates.c
convert to_terminal_ours_for_output
[thirdparty/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
bebd3233
TT
13static void
14delegate_post_attach (struct target_ops *self, int arg1)
15{
16 self = self->beneath;
17 self->to_post_attach (self, arg1);
18}
19
20static void
21tdefault_post_attach (struct target_ops *self, int arg1)
22{
23}
24
09da0d0a
TT
25static void
26delegate_detach (struct target_ops *self, const char *arg1, int arg2)
27{
28 self = self->beneath;
29 self->to_detach (self, arg1, arg2);
30}
31
32static void
33tdefault_detach (struct target_ops *self, const char *arg1, int arg2)
34{
35}
36
6b84065d
TT
37static void
38delegate_resume (struct target_ops *self, ptid_t arg1, int arg2, enum gdb_signal arg3)
39{
40 self = self->beneath;
41 self->to_resume (self, arg1, arg2, arg3);
42}
43
44static void
45tdefault_resume (struct target_ops *self, ptid_t arg1, int arg2, enum gdb_signal arg3)
46{
47 noprocess ();
48}
49
50static ptid_t
51delegate_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2, int arg3)
52{
53 self = self->beneath;
54 return self->to_wait (self, arg1, arg2, arg3);
55}
56
57static ptid_t
58tdefault_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2, int arg3)
59{
60 noprocess ();
61}
62
63static void
64delegate_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
65{
66 self = self->beneath;
67 self->to_store_registers (self, arg1, arg2);
68}
69
70static void
71tdefault_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
72{
73 noprocess ();
74}
75
6c628163
TT
76static void
77delegate_prepare_to_store (struct target_ops *self, struct regcache *arg1)
78{
79 self = self->beneath;
80 self->to_prepare_to_store (self, arg1);
81}
82
83static void
84tdefault_prepare_to_store (struct target_ops *self, struct regcache *arg1)
85{
86 noprocess ();
87}
88
f86e59b2
TT
89static void
90delegate_files_info (struct target_ops *self)
91{
92 self = self->beneath;
93 self->to_files_info (self);
94}
95
96static void
97tdefault_files_info (struct target_ops *self)
98{
99}
100
6b84065d
TT
101static int
102delegate_insert_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
103{
104 self = self->beneath;
105 return self->to_insert_breakpoint (self, arg1, arg2);
106}
107
108static int
109delegate_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
110{
111 self = self->beneath;
112 return self->to_remove_breakpoint (self, arg1, arg2);
113}
114
52b51d06
TT
115static int
116delegate_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
117{
118 self = self->beneath;
119 return self->to_can_use_hw_breakpoint (self, arg1, arg2, arg3);
120}
121
122static int
123tdefault_can_use_hw_breakpoint (struct target_ops *self, int arg1, int arg2, int arg3)
124{
125 return 0;
126}
127
61b371f9
TT
128static int
129delegate_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
130{
131 self = self->beneath;
132 return self->to_insert_hw_breakpoint (self, arg1, arg2);
133}
134
135static int
136tdefault_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
137{
138 return -1;
139}
140
418dabac
TT
141static int
142delegate_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
143{
144 self = self->beneath;
145 return self->to_remove_hw_breakpoint (self, arg1, arg2);
146}
147
148static int
149tdefault_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
150{
151 return -1;
152}
153
61dd109f
TT
154static int
155delegate_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
156{
157 self = self->beneath;
158 return self->to_remove_watchpoint (self, arg1, arg2, arg3, arg4);
159}
160
161static int
162tdefault_remove_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
163{
164 return -1;
165}
166
016facd4
TT
167static int
168delegate_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
169{
170 self = self->beneath;
171 return self->to_insert_watchpoint (self, arg1, arg2, arg3, arg4);
172}
173
174static int
175tdefault_insert_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
176{
177 return -1;
178}
179
6b84065d
TT
180static int
181delegate_stopped_by_watchpoint (struct target_ops *self)
182{
183 self = self->beneath;
184 return self->to_stopped_by_watchpoint (self);
185}
186
187static int
188tdefault_stopped_by_watchpoint (struct target_ops *self)
189{
190 return 0;
191}
192
193static int
194delegate_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
195{
196 self = self->beneath;
197 return self->to_stopped_data_address (self, arg1);
198}
199
200static int
201tdefault_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
202{
203 return 0;
204}
205
65f160a9
TT
206static int
207delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3)
208{
209 self = self->beneath;
210 return self->to_watchpoint_addr_within_range (self, arg1, arg2, arg3);
211}
212
d03655e4
TT
213static int
214delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2)
215{
216 self = self->beneath;
217 return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2);
218}
219
77cdffe9
TT
220static int
221delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
222{
223 self = self->beneath;
224 return self->to_can_accel_watchpoint_condition (self, arg1, arg2, arg3, arg4);
225}
226
227static int
228tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4)
229{
230 return 0;
231}
232
0343661d
TT
233static void
234delegate_terminal_init (struct target_ops *self)
235{
236 self = self->beneath;
237 self->to_terminal_init (self);
238}
239
240static void
241tdefault_terminal_init (struct target_ops *self)
242{
243}
244
ddeaacc9
TT
245static void
246delegate_terminal_inferior (struct target_ops *self)
247{
248 self = self->beneath;
249 self->to_terminal_inferior (self);
250}
251
252static void
253tdefault_terminal_inferior (struct target_ops *self)
254{
255}
256
74fcbef9
TT
257static void
258delegate_terminal_ours_for_output (struct target_ops *self)
259{
260 self = self->beneath;
261 self->to_terminal_ours_for_output (self);
262}
263
264static void
265tdefault_terminal_ours_for_output (struct target_ops *self)
266{
267}
268
a53f3625
TT
269static void
270delegate_rcmd (struct target_ops *self, char *arg1, struct ui_file *arg2)
271{
272 self = self->beneath;
273 self->to_rcmd (self, arg1, arg2);
274}
275
6b84065d
TT
276static int
277delegate_can_async_p (struct target_ops *self)
278{
279 self = self->beneath;
280 return self->to_can_async_p (self);
281}
282
283static int
284delegate_is_async_p (struct target_ops *self)
285{
286 self = self->beneath;
287 return self->to_is_async_p (self);
288}
289
290static void
291delegate_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
292{
293 self = self->beneath;
294 self->to_async (self, arg1, arg2);
295}
296
297static void
298tdefault_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
299{
300 tcomplain ();
301}
302
303static enum target_xfer_status
304delegate_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)
305{
306 self = self->beneath;
307 return self->to_xfer_partial (self, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
308}
309
310static enum target_xfer_status
311tdefault_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)
312{
313 return TARGET_XFER_E_IO;
314}
315
46917d26
TT
316static int
317delegate_supports_btrace (struct target_ops *self)
318{
319 self = self->beneath;
320 return self->to_supports_btrace (self);
321}
322
323static int
324tdefault_supports_btrace (struct target_ops *self)
325{
326 return 0;
327}
328
1101cb7b
TT
329static void
330install_delegators (struct target_ops *ops)
331{
e9a29200
TT
332 if (ops->to_attach == NULL)
333 ops->to_attach = delegate_attach;
bebd3233
TT
334 if (ops->to_post_attach == NULL)
335 ops->to_post_attach = delegate_post_attach;
09da0d0a
TT
336 if (ops->to_detach == NULL)
337 ops->to_detach = delegate_detach;
6b84065d
TT
338 if (ops->to_resume == NULL)
339 ops->to_resume = delegate_resume;
340 if (ops->to_wait == NULL)
341 ops->to_wait = delegate_wait;
342 if (ops->to_store_registers == NULL)
343 ops->to_store_registers = delegate_store_registers;
6c628163
TT
344 if (ops->to_prepare_to_store == NULL)
345 ops->to_prepare_to_store = delegate_prepare_to_store;
f86e59b2
TT
346 if (ops->to_files_info == NULL)
347 ops->to_files_info = delegate_files_info;
6b84065d
TT
348 if (ops->to_insert_breakpoint == NULL)
349 ops->to_insert_breakpoint = delegate_insert_breakpoint;
350 if (ops->to_remove_breakpoint == NULL)
351 ops->to_remove_breakpoint = delegate_remove_breakpoint;
52b51d06
TT
352 if (ops->to_can_use_hw_breakpoint == NULL)
353 ops->to_can_use_hw_breakpoint = delegate_can_use_hw_breakpoint;
61b371f9
TT
354 if (ops->to_insert_hw_breakpoint == NULL)
355 ops->to_insert_hw_breakpoint = delegate_insert_hw_breakpoint;
418dabac
TT
356 if (ops->to_remove_hw_breakpoint == NULL)
357 ops->to_remove_hw_breakpoint = delegate_remove_hw_breakpoint;
61dd109f
TT
358 if (ops->to_remove_watchpoint == NULL)
359 ops->to_remove_watchpoint = delegate_remove_watchpoint;
016facd4
TT
360 if (ops->to_insert_watchpoint == NULL)
361 ops->to_insert_watchpoint = delegate_insert_watchpoint;
6b84065d
TT
362 if (ops->to_stopped_by_watchpoint == NULL)
363 ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
364 if (ops->to_stopped_data_address == NULL)
365 ops->to_stopped_data_address = delegate_stopped_data_address;
65f160a9
TT
366 if (ops->to_watchpoint_addr_within_range == NULL)
367 ops->to_watchpoint_addr_within_range = delegate_watchpoint_addr_within_range;
d03655e4
TT
368 if (ops->to_region_ok_for_hw_watchpoint == NULL)
369 ops->to_region_ok_for_hw_watchpoint = delegate_region_ok_for_hw_watchpoint;
77cdffe9
TT
370 if (ops->to_can_accel_watchpoint_condition == NULL)
371 ops->to_can_accel_watchpoint_condition = delegate_can_accel_watchpoint_condition;
0343661d
TT
372 if (ops->to_terminal_init == NULL)
373 ops->to_terminal_init = delegate_terminal_init;
ddeaacc9
TT
374 if (ops->to_terminal_inferior == NULL)
375 ops->to_terminal_inferior = delegate_terminal_inferior;
74fcbef9
TT
376 if (ops->to_terminal_ours_for_output == NULL)
377 ops->to_terminal_ours_for_output = delegate_terminal_ours_for_output;
a53f3625
TT
378 if (ops->to_rcmd == NULL)
379 ops->to_rcmd = delegate_rcmd;
6b84065d
TT
380 if (ops->to_can_async_p == NULL)
381 ops->to_can_async_p = delegate_can_async_p;
382 if (ops->to_is_async_p == NULL)
383 ops->to_is_async_p = delegate_is_async_p;
384 if (ops->to_async == NULL)
385 ops->to_async = delegate_async;
386 if (ops->to_xfer_partial == NULL)
387 ops->to_xfer_partial = delegate_xfer_partial;
46917d26
TT
388 if (ops->to_supports_btrace == NULL)
389 ops->to_supports_btrace = delegate_supports_btrace;
1101cb7b
TT
390}
391
392static void
393install_dummy_methods (struct target_ops *ops)
394{
e9a29200 395 ops->to_attach = find_default_attach;
bebd3233 396 ops->to_post_attach = tdefault_post_attach;
09da0d0a 397 ops->to_detach = tdefault_detach;
6b84065d
TT
398 ops->to_resume = tdefault_resume;
399 ops->to_wait = tdefault_wait;
400 ops->to_store_registers = tdefault_store_registers;
6c628163 401 ops->to_prepare_to_store = tdefault_prepare_to_store;
f86e59b2 402 ops->to_files_info = tdefault_files_info;
6b84065d
TT
403 ops->to_insert_breakpoint = memory_insert_breakpoint;
404 ops->to_remove_breakpoint = memory_remove_breakpoint;
52b51d06 405 ops->to_can_use_hw_breakpoint = tdefault_can_use_hw_breakpoint;
61b371f9 406 ops->to_insert_hw_breakpoint = tdefault_insert_hw_breakpoint;
418dabac 407 ops->to_remove_hw_breakpoint = tdefault_remove_hw_breakpoint;
61dd109f 408 ops->to_remove_watchpoint = tdefault_remove_watchpoint;
016facd4 409 ops->to_insert_watchpoint = tdefault_insert_watchpoint;
6b84065d
TT
410 ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
411 ops->to_stopped_data_address = tdefault_stopped_data_address;
65f160a9 412 ops->to_watchpoint_addr_within_range = default_watchpoint_addr_within_range;
d03655e4 413 ops->to_region_ok_for_hw_watchpoint = default_region_ok_for_hw_watchpoint;
77cdffe9 414 ops->to_can_accel_watchpoint_condition = tdefault_can_accel_watchpoint_condition;
0343661d 415 ops->to_terminal_init = tdefault_terminal_init;
ddeaacc9 416 ops->to_terminal_inferior = tdefault_terminal_inferior;
74fcbef9 417 ops->to_terminal_ours_for_output = tdefault_terminal_ours_for_output;
a53f3625 418 ops->to_rcmd = default_rcmd;
6b84065d
TT
419 ops->to_can_async_p = find_default_can_async_p;
420 ops->to_is_async_p = find_default_is_async_p;
421 ops->to_async = tdefault_async;
422 ops->to_xfer_partial = tdefault_xfer_partial;
46917d26 423 ops->to_supports_btrace = tdefault_supports_btrace;
1101cb7b 424}