add target method delegation
[deliverable/binutils-gdb.git] / gdb / target-delegates.c
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 */
6 static void
7 delegate_resume (struct target_ops *self, ptid_t arg1, int arg2, enum gdb_signal arg3)
8 {
9 self = self->beneath;
10 self->to_resume (self, arg1, arg2, arg3);
11 }
12
13 static void
14 tdefault_resume (struct target_ops *self, ptid_t arg1, int arg2, enum gdb_signal arg3)
15 {
16 noprocess ();
17 }
18
19 static ptid_t
20 delegate_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2, int arg3)
21 {
22 self = self->beneath;
23 return self->to_wait (self, arg1, arg2, arg3);
24 }
25
26 static ptid_t
27 tdefault_wait (struct target_ops *self, ptid_t arg1, struct target_waitstatus *arg2, int arg3)
28 {
29 noprocess ();
30 }
31
32 static void
33 delegate_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
34 {
35 self = self->beneath;
36 self->to_store_registers (self, arg1, arg2);
37 }
38
39 static void
40 tdefault_store_registers (struct target_ops *self, struct regcache *arg1, int arg2)
41 {
42 noprocess ();
43 }
44
45 static int
46 delegate_insert_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
47 {
48 self = self->beneath;
49 return self->to_insert_breakpoint (self, arg1, arg2);
50 }
51
52 static int
53 delegate_remove_breakpoint (struct target_ops *self, struct gdbarch *arg1, struct bp_target_info *arg2)
54 {
55 self = self->beneath;
56 return self->to_remove_breakpoint (self, arg1, arg2);
57 }
58
59 static int
60 delegate_stopped_by_watchpoint (struct target_ops *self)
61 {
62 self = self->beneath;
63 return self->to_stopped_by_watchpoint (self);
64 }
65
66 static int
67 tdefault_stopped_by_watchpoint (struct target_ops *self)
68 {
69 return 0;
70 }
71
72 static int
73 delegate_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
74 {
75 self = self->beneath;
76 return self->to_stopped_data_address (self, arg1);
77 }
78
79 static int
80 tdefault_stopped_data_address (struct target_ops *self, CORE_ADDR *arg1)
81 {
82 return 0;
83 }
84
85 static int
86 delegate_can_async_p (struct target_ops *self)
87 {
88 self = self->beneath;
89 return self->to_can_async_p (self);
90 }
91
92 static int
93 delegate_is_async_p (struct target_ops *self)
94 {
95 self = self->beneath;
96 return self->to_is_async_p (self);
97 }
98
99 static void
100 delegate_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
101 {
102 self = self->beneath;
103 self->to_async (self, arg1, arg2);
104 }
105
106 static void
107 tdefault_async (struct target_ops *self, async_callback_ftype *arg1, void *arg2)
108 {
109 tcomplain ();
110 }
111
112 static enum target_xfer_status
113 delegate_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)
114 {
115 self = self->beneath;
116 return self->to_xfer_partial (self, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
117 }
118
119 static enum target_xfer_status
120 tdefault_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)
121 {
122 return TARGET_XFER_E_IO;
123 }
124
125 static void
126 install_delegators (struct target_ops *ops)
127 {
128 if (ops->to_resume == NULL)
129 ops->to_resume = delegate_resume;
130 if (ops->to_wait == NULL)
131 ops->to_wait = delegate_wait;
132 if (ops->to_store_registers == NULL)
133 ops->to_store_registers = delegate_store_registers;
134 if (ops->to_insert_breakpoint == NULL)
135 ops->to_insert_breakpoint = delegate_insert_breakpoint;
136 if (ops->to_remove_breakpoint == NULL)
137 ops->to_remove_breakpoint = delegate_remove_breakpoint;
138 if (ops->to_stopped_by_watchpoint == NULL)
139 ops->to_stopped_by_watchpoint = delegate_stopped_by_watchpoint;
140 if (ops->to_stopped_data_address == NULL)
141 ops->to_stopped_data_address = delegate_stopped_data_address;
142 if (ops->to_can_async_p == NULL)
143 ops->to_can_async_p = delegate_can_async_p;
144 if (ops->to_is_async_p == NULL)
145 ops->to_is_async_p = delegate_is_async_p;
146 if (ops->to_async == NULL)
147 ops->to_async = delegate_async;
148 if (ops->to_xfer_partial == NULL)
149 ops->to_xfer_partial = delegate_xfer_partial;
150 }
151
152 static void
153 install_dummy_methods (struct target_ops *ops)
154 {
155 ops->to_resume = tdefault_resume;
156 ops->to_wait = tdefault_wait;
157 ops->to_store_registers = tdefault_store_registers;
158 ops->to_insert_breakpoint = memory_insert_breakpoint;
159 ops->to_remove_breakpoint = memory_remove_breakpoint;
160 ops->to_stopped_by_watchpoint = tdefault_stopped_by_watchpoint;
161 ops->to_stopped_data_address = tdefault_stopped_data_address;
162 ops->to_can_async_p = find_default_can_async_p;
163 ops->to_is_async_p = find_default_is_async_p;
164 ops->to_async = tdefault_async;
165 ops->to_xfer_partial = tdefault_xfer_partial;
166 }
This page took 0.034587 seconds and 5 git commands to generate.