observer.inc revision 1.4 1 1.1 christos /* This file is automatically generated. DO NOT EDIT! */
2 1.3 mrg /* Generated from: NetBSD: mknative-gdb,v 1.6 2013/10/03 18:58:37 christos Exp */
3 1.3 mrg /* Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp */
4 1.1 christos
5 1.1 christos /* GDB Notifications to Observers.
6 1.1 christos
7 1.4 christos Copyright (C) 2004-2015 Free Software Foundation, Inc.
8 1.1 christos
9 1.1 christos This file is part of GDB.
10 1.1 christos
11 1.1 christos This program is free software; you can redistribute it and/or modify
12 1.1 christos it under the terms of the GNU General Public License as published by
13 1.1 christos the Free Software Foundation; either version 3 of the License, or
14 1.1 christos (at your option) any later version.
15 1.1 christos
16 1.1 christos This program is distributed in the hope that it will be useful,
17 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
18 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 1.1 christos GNU General Public License for more details.
20 1.1 christos
21 1.1 christos You should have received a copy of the GNU General Public License
22 1.1 christos along with this program. If not, see <http://www.gnu.org/licenses/>.
23 1.1 christos
24 1.1 christos --
25 1.1 christos
26 1.1 christos This file was generated using observer.sh and observer.texi. */
27 1.1 christos
28 1.1 christos
29 1.1 christos /* normal_stop notifications. */
30 1.1 christos
31 1.1 christos static struct observer_list *normal_stop_subject = NULL;
32 1.1 christos
33 1.1 christos struct normal_stop_args { struct bpstats *bs; int print_frame; };
34 1.1 christos
35 1.1 christos static void
36 1.1 christos observer_normal_stop_notification_stub (const void *data, const void *args_data)
37 1.1 christos {
38 1.1 christos observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data;
39 1.1 christos const struct normal_stop_args *args = args_data;
40 1.1 christos notify (args->bs, args->print_frame);
41 1.1 christos }
42 1.1 christos
43 1.1 christos struct observer *
44 1.1 christos observer_attach_normal_stop (observer_normal_stop_ftype *f)
45 1.1 christos {
46 1.1 christos return generic_observer_attach (&normal_stop_subject,
47 1.1 christos &observer_normal_stop_notification_stub,
48 1.1 christos (void *) f);
49 1.1 christos }
50 1.1 christos
51 1.1 christos void
52 1.1 christos observer_detach_normal_stop (struct observer *observer)
53 1.1 christos {
54 1.1 christos generic_observer_detach (&normal_stop_subject, observer);
55 1.1 christos }
56 1.1 christos
57 1.1 christos void
58 1.1 christos observer_notify_normal_stop (struct bpstats *bs, int print_frame)
59 1.1 christos {
60 1.1 christos struct normal_stop_args args;
61 1.1 christos args.bs = bs, args.print_frame = print_frame;
62 1.1 christos
63 1.1 christos if (observer_debug)
64 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n");
65 1.1 christos generic_observer_notify (normal_stop_subject, &args);
66 1.1 christos }
67 1.1 christos
68 1.4 christos /* signal_received notifications. */
69 1.4 christos
70 1.4 christos static struct observer_list *signal_received_subject = NULL;
71 1.4 christos
72 1.4 christos struct signal_received_args { enum gdb_signal siggnal; };
73 1.4 christos
74 1.4 christos static void
75 1.4 christos observer_signal_received_notification_stub (const void *data, const void *args_data)
76 1.4 christos {
77 1.4 christos observer_signal_received_ftype *notify = (observer_signal_received_ftype *) data;
78 1.4 christos const struct signal_received_args *args = args_data;
79 1.4 christos notify (args->siggnal);
80 1.4 christos }
81 1.4 christos
82 1.4 christos struct observer *
83 1.4 christos observer_attach_signal_received (observer_signal_received_ftype *f)
84 1.4 christos {
85 1.4 christos return generic_observer_attach (&signal_received_subject,
86 1.4 christos &observer_signal_received_notification_stub,
87 1.4 christos (void *) f);
88 1.4 christos }
89 1.4 christos
90 1.4 christos void
91 1.4 christos observer_detach_signal_received (struct observer *observer)
92 1.4 christos {
93 1.4 christos generic_observer_detach (&signal_received_subject, observer);
94 1.4 christos }
95 1.4 christos
96 1.4 christos void
97 1.4 christos observer_notify_signal_received (enum gdb_signal siggnal)
98 1.4 christos {
99 1.4 christos struct signal_received_args args;
100 1.4 christos args.siggnal = siggnal;
101 1.4 christos
102 1.4 christos if (observer_debug)
103 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_signal_received() called\n");
104 1.4 christos generic_observer_notify (signal_received_subject, &args);
105 1.4 christos }
106 1.4 christos
107 1.4 christos /* end_stepping_range notifications. */
108 1.4 christos
109 1.4 christos static struct observer_list *end_stepping_range_subject = NULL;
110 1.4 christos
111 1.4 christos static void
112 1.4 christos observer_end_stepping_range_notification_stub (const void *data, const void *args_data)
113 1.4 christos {
114 1.4 christos observer_end_stepping_range_ftype *notify = (observer_end_stepping_range_ftype *) data;
115 1.4 christos notify ();
116 1.4 christos }
117 1.4 christos
118 1.4 christos struct observer *
119 1.4 christos observer_attach_end_stepping_range (observer_end_stepping_range_ftype *f)
120 1.4 christos {
121 1.4 christos return generic_observer_attach (&end_stepping_range_subject,
122 1.4 christos &observer_end_stepping_range_notification_stub,
123 1.4 christos (void *) f);
124 1.4 christos }
125 1.4 christos
126 1.4 christos void
127 1.4 christos observer_detach_end_stepping_range (struct observer *observer)
128 1.4 christos {
129 1.4 christos generic_observer_detach (&end_stepping_range_subject, observer);
130 1.4 christos }
131 1.4 christos
132 1.4 christos void
133 1.4 christos observer_notify_end_stepping_range (void)
134 1.4 christos {
135 1.4 christos char *args = NULL;
136 1.4 christos if (observer_debug)
137 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_end_stepping_range() called\n");
138 1.4 christos generic_observer_notify (end_stepping_range_subject, &args);
139 1.4 christos }
140 1.4 christos
141 1.4 christos /* signal_exited notifications. */
142 1.4 christos
143 1.4 christos static struct observer_list *signal_exited_subject = NULL;
144 1.4 christos
145 1.4 christos struct signal_exited_args { enum gdb_signal siggnal; };
146 1.4 christos
147 1.4 christos static void
148 1.4 christos observer_signal_exited_notification_stub (const void *data, const void *args_data)
149 1.4 christos {
150 1.4 christos observer_signal_exited_ftype *notify = (observer_signal_exited_ftype *) data;
151 1.4 christos const struct signal_exited_args *args = args_data;
152 1.4 christos notify (args->siggnal);
153 1.4 christos }
154 1.4 christos
155 1.4 christos struct observer *
156 1.4 christos observer_attach_signal_exited (observer_signal_exited_ftype *f)
157 1.4 christos {
158 1.4 christos return generic_observer_attach (&signal_exited_subject,
159 1.4 christos &observer_signal_exited_notification_stub,
160 1.4 christos (void *) f);
161 1.4 christos }
162 1.4 christos
163 1.4 christos void
164 1.4 christos observer_detach_signal_exited (struct observer *observer)
165 1.4 christos {
166 1.4 christos generic_observer_detach (&signal_exited_subject, observer);
167 1.4 christos }
168 1.4 christos
169 1.4 christos void
170 1.4 christos observer_notify_signal_exited (enum gdb_signal siggnal)
171 1.4 christos {
172 1.4 christos struct signal_exited_args args;
173 1.4 christos args.siggnal = siggnal;
174 1.4 christos
175 1.4 christos if (observer_debug)
176 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_signal_exited() called\n");
177 1.4 christos generic_observer_notify (signal_exited_subject, &args);
178 1.4 christos }
179 1.4 christos
180 1.4 christos /* exited notifications. */
181 1.4 christos
182 1.4 christos static struct observer_list *exited_subject = NULL;
183 1.4 christos
184 1.4 christos struct exited_args { int exitstatus; };
185 1.4 christos
186 1.4 christos static void
187 1.4 christos observer_exited_notification_stub (const void *data, const void *args_data)
188 1.4 christos {
189 1.4 christos observer_exited_ftype *notify = (observer_exited_ftype *) data;
190 1.4 christos const struct exited_args *args = args_data;
191 1.4 christos notify (args->exitstatus);
192 1.4 christos }
193 1.4 christos
194 1.4 christos struct observer *
195 1.4 christos observer_attach_exited (observer_exited_ftype *f)
196 1.4 christos {
197 1.4 christos return generic_observer_attach (&exited_subject,
198 1.4 christos &observer_exited_notification_stub,
199 1.4 christos (void *) f);
200 1.4 christos }
201 1.4 christos
202 1.4 christos void
203 1.4 christos observer_detach_exited (struct observer *observer)
204 1.4 christos {
205 1.4 christos generic_observer_detach (&exited_subject, observer);
206 1.4 christos }
207 1.4 christos
208 1.4 christos void
209 1.4 christos observer_notify_exited (int exitstatus)
210 1.4 christos {
211 1.4 christos struct exited_args args;
212 1.4 christos args.exitstatus = exitstatus;
213 1.4 christos
214 1.4 christos if (observer_debug)
215 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_exited() called\n");
216 1.4 christos generic_observer_notify (exited_subject, &args);
217 1.4 christos }
218 1.4 christos
219 1.4 christos /* no_history notifications. */
220 1.4 christos
221 1.4 christos static struct observer_list *no_history_subject = NULL;
222 1.4 christos
223 1.4 christos static void
224 1.4 christos observer_no_history_notification_stub (const void *data, const void *args_data)
225 1.4 christos {
226 1.4 christos observer_no_history_ftype *notify = (observer_no_history_ftype *) data;
227 1.4 christos notify ();
228 1.4 christos }
229 1.4 christos
230 1.4 christos struct observer *
231 1.4 christos observer_attach_no_history (observer_no_history_ftype *f)
232 1.4 christos {
233 1.4 christos return generic_observer_attach (&no_history_subject,
234 1.4 christos &observer_no_history_notification_stub,
235 1.4 christos (void *) f);
236 1.4 christos }
237 1.4 christos
238 1.4 christos void
239 1.4 christos observer_detach_no_history (struct observer *observer)
240 1.4 christos {
241 1.4 christos generic_observer_detach (&no_history_subject, observer);
242 1.4 christos }
243 1.4 christos
244 1.4 christos void
245 1.4 christos observer_notify_no_history (void)
246 1.4 christos {
247 1.4 christos char *args = NULL;
248 1.4 christos if (observer_debug)
249 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_no_history() called\n");
250 1.4 christos generic_observer_notify (no_history_subject, &args);
251 1.4 christos }
252 1.4 christos
253 1.4 christos /* sync_execution_done notifications. */
254 1.4 christos
255 1.4 christos static struct observer_list *sync_execution_done_subject = NULL;
256 1.4 christos
257 1.4 christos static void
258 1.4 christos observer_sync_execution_done_notification_stub (const void *data, const void *args_data)
259 1.4 christos {
260 1.4 christos observer_sync_execution_done_ftype *notify = (observer_sync_execution_done_ftype *) data;
261 1.4 christos notify ();
262 1.4 christos }
263 1.4 christos
264 1.4 christos struct observer *
265 1.4 christos observer_attach_sync_execution_done (observer_sync_execution_done_ftype *f)
266 1.4 christos {
267 1.4 christos return generic_observer_attach (&sync_execution_done_subject,
268 1.4 christos &observer_sync_execution_done_notification_stub,
269 1.4 christos (void *) f);
270 1.4 christos }
271 1.4 christos
272 1.4 christos void
273 1.4 christos observer_detach_sync_execution_done (struct observer *observer)
274 1.4 christos {
275 1.4 christos generic_observer_detach (&sync_execution_done_subject, observer);
276 1.4 christos }
277 1.4 christos
278 1.4 christos void
279 1.4 christos observer_notify_sync_execution_done (void)
280 1.4 christos {
281 1.4 christos char *args = NULL;
282 1.4 christos if (observer_debug)
283 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_sync_execution_done() called\n");
284 1.4 christos generic_observer_notify (sync_execution_done_subject, &args);
285 1.4 christos }
286 1.4 christos
287 1.4 christos /* command_error notifications. */
288 1.4 christos
289 1.4 christos static struct observer_list *command_error_subject = NULL;
290 1.4 christos
291 1.4 christos static void
292 1.4 christos observer_command_error_notification_stub (const void *data, const void *args_data)
293 1.4 christos {
294 1.4 christos observer_command_error_ftype *notify = (observer_command_error_ftype *) data;
295 1.4 christos notify ();
296 1.4 christos }
297 1.4 christos
298 1.4 christos struct observer *
299 1.4 christos observer_attach_command_error (observer_command_error_ftype *f)
300 1.4 christos {
301 1.4 christos return generic_observer_attach (&command_error_subject,
302 1.4 christos &observer_command_error_notification_stub,
303 1.4 christos (void *) f);
304 1.4 christos }
305 1.4 christos
306 1.4 christos void
307 1.4 christos observer_detach_command_error (struct observer *observer)
308 1.4 christos {
309 1.4 christos generic_observer_detach (&command_error_subject, observer);
310 1.4 christos }
311 1.4 christos
312 1.4 christos void
313 1.4 christos observer_notify_command_error (void)
314 1.4 christos {
315 1.4 christos char *args = NULL;
316 1.4 christos if (observer_debug)
317 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_command_error() called\n");
318 1.4 christos generic_observer_notify (command_error_subject, &args);
319 1.4 christos }
320 1.4 christos
321 1.1 christos /* target_changed notifications. */
322 1.1 christos
323 1.1 christos static struct observer_list *target_changed_subject = NULL;
324 1.1 christos
325 1.1 christos struct target_changed_args { struct target_ops *target; };
326 1.1 christos
327 1.1 christos static void
328 1.1 christos observer_target_changed_notification_stub (const void *data, const void *args_data)
329 1.1 christos {
330 1.1 christos observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data;
331 1.1 christos const struct target_changed_args *args = args_data;
332 1.1 christos notify (args->target);
333 1.1 christos }
334 1.1 christos
335 1.1 christos struct observer *
336 1.1 christos observer_attach_target_changed (observer_target_changed_ftype *f)
337 1.1 christos {
338 1.1 christos return generic_observer_attach (&target_changed_subject,
339 1.1 christos &observer_target_changed_notification_stub,
340 1.1 christos (void *) f);
341 1.1 christos }
342 1.1 christos
343 1.1 christos void
344 1.1 christos observer_detach_target_changed (struct observer *observer)
345 1.1 christos {
346 1.1 christos generic_observer_detach (&target_changed_subject, observer);
347 1.1 christos }
348 1.1 christos
349 1.1 christos void
350 1.1 christos observer_notify_target_changed (struct target_ops *target)
351 1.1 christos {
352 1.1 christos struct target_changed_args args;
353 1.1 christos args.target = target;
354 1.1 christos
355 1.1 christos if (observer_debug)
356 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n");
357 1.1 christos generic_observer_notify (target_changed_subject, &args);
358 1.1 christos }
359 1.1 christos
360 1.1 christos /* executable_changed notifications. */
361 1.1 christos
362 1.1 christos static struct observer_list *executable_changed_subject = NULL;
363 1.1 christos
364 1.1 christos static void
365 1.1 christos observer_executable_changed_notification_stub (const void *data, const void *args_data)
366 1.1 christos {
367 1.1 christos observer_executable_changed_ftype *notify = (observer_executable_changed_ftype *) data;
368 1.1 christos notify ();
369 1.1 christos }
370 1.1 christos
371 1.1 christos struct observer *
372 1.1 christos observer_attach_executable_changed (observer_executable_changed_ftype *f)
373 1.1 christos {
374 1.1 christos return generic_observer_attach (&executable_changed_subject,
375 1.1 christos &observer_executable_changed_notification_stub,
376 1.1 christos (void *) f);
377 1.1 christos }
378 1.1 christos
379 1.1 christos void
380 1.1 christos observer_detach_executable_changed (struct observer *observer)
381 1.1 christos {
382 1.1 christos generic_observer_detach (&executable_changed_subject, observer);
383 1.1 christos }
384 1.1 christos
385 1.1 christos void
386 1.1 christos observer_notify_executable_changed (void)
387 1.1 christos {
388 1.1 christos char *args = NULL;
389 1.1 christos if (observer_debug)
390 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_executable_changed() called\n");
391 1.1 christos generic_observer_notify (executable_changed_subject, &args);
392 1.1 christos }
393 1.1 christos
394 1.1 christos /* inferior_created notifications. */
395 1.1 christos
396 1.1 christos static struct observer_list *inferior_created_subject = NULL;
397 1.1 christos
398 1.1 christos struct inferior_created_args { struct target_ops *objfile; int from_tty; };
399 1.1 christos
400 1.1 christos static void
401 1.1 christos observer_inferior_created_notification_stub (const void *data, const void *args_data)
402 1.1 christos {
403 1.1 christos observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data;
404 1.1 christos const struct inferior_created_args *args = args_data;
405 1.1 christos notify (args->objfile, args->from_tty);
406 1.1 christos }
407 1.1 christos
408 1.1 christos struct observer *
409 1.1 christos observer_attach_inferior_created (observer_inferior_created_ftype *f)
410 1.1 christos {
411 1.1 christos return generic_observer_attach (&inferior_created_subject,
412 1.1 christos &observer_inferior_created_notification_stub,
413 1.1 christos (void *) f);
414 1.1 christos }
415 1.1 christos
416 1.1 christos void
417 1.1 christos observer_detach_inferior_created (struct observer *observer)
418 1.1 christos {
419 1.1 christos generic_observer_detach (&inferior_created_subject, observer);
420 1.1 christos }
421 1.1 christos
422 1.1 christos void
423 1.1 christos observer_notify_inferior_created (struct target_ops *objfile, int from_tty)
424 1.1 christos {
425 1.1 christos struct inferior_created_args args;
426 1.1 christos args.objfile = objfile, args.from_tty = from_tty;
427 1.1 christos
428 1.1 christos if (observer_debug)
429 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n");
430 1.1 christos generic_observer_notify (inferior_created_subject, &args);
431 1.1 christos }
432 1.1 christos
433 1.2 christos /* record_changed notifications. */
434 1.2 christos
435 1.2 christos static struct observer_list *record_changed_subject = NULL;
436 1.2 christos
437 1.2 christos struct record_changed_args { struct inferior *inferior; int started; };
438 1.2 christos
439 1.2 christos static void
440 1.2 christos observer_record_changed_notification_stub (const void *data, const void *args_data)
441 1.2 christos {
442 1.2 christos observer_record_changed_ftype *notify = (observer_record_changed_ftype *) data;
443 1.2 christos const struct record_changed_args *args = args_data;
444 1.2 christos notify (args->inferior, args->started);
445 1.2 christos }
446 1.2 christos
447 1.2 christos struct observer *
448 1.2 christos observer_attach_record_changed (observer_record_changed_ftype *f)
449 1.2 christos {
450 1.2 christos return generic_observer_attach (&record_changed_subject,
451 1.2 christos &observer_record_changed_notification_stub,
452 1.2 christos (void *) f);
453 1.2 christos }
454 1.2 christos
455 1.2 christos void
456 1.2 christos observer_detach_record_changed (struct observer *observer)
457 1.2 christos {
458 1.2 christos generic_observer_detach (&record_changed_subject, observer);
459 1.2 christos }
460 1.2 christos
461 1.2 christos void
462 1.2 christos observer_notify_record_changed (struct inferior *inferior, int started)
463 1.2 christos {
464 1.2 christos struct record_changed_args args;
465 1.2 christos args.inferior = inferior, args.started = started;
466 1.2 christos
467 1.2 christos if (observer_debug)
468 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_record_changed() called\n");
469 1.2 christos generic_observer_notify (record_changed_subject, &args);
470 1.2 christos }
471 1.2 christos
472 1.1 christos /* solib_loaded notifications. */
473 1.1 christos
474 1.1 christos static struct observer_list *solib_loaded_subject = NULL;
475 1.1 christos
476 1.1 christos struct solib_loaded_args { struct so_list *solib; };
477 1.1 christos
478 1.1 christos static void
479 1.1 christos observer_solib_loaded_notification_stub (const void *data, const void *args_data)
480 1.1 christos {
481 1.1 christos observer_solib_loaded_ftype *notify = (observer_solib_loaded_ftype *) data;
482 1.1 christos const struct solib_loaded_args *args = args_data;
483 1.1 christos notify (args->solib);
484 1.1 christos }
485 1.1 christos
486 1.1 christos struct observer *
487 1.1 christos observer_attach_solib_loaded (observer_solib_loaded_ftype *f)
488 1.1 christos {
489 1.1 christos return generic_observer_attach (&solib_loaded_subject,
490 1.1 christos &observer_solib_loaded_notification_stub,
491 1.1 christos (void *) f);
492 1.1 christos }
493 1.1 christos
494 1.1 christos void
495 1.1 christos observer_detach_solib_loaded (struct observer *observer)
496 1.1 christos {
497 1.1 christos generic_observer_detach (&solib_loaded_subject, observer);
498 1.1 christos }
499 1.1 christos
500 1.1 christos void
501 1.1 christos observer_notify_solib_loaded (struct so_list *solib)
502 1.1 christos {
503 1.1 christos struct solib_loaded_args args;
504 1.1 christos args.solib = solib;
505 1.1 christos
506 1.1 christos if (observer_debug)
507 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_loaded() called\n");
508 1.1 christos generic_observer_notify (solib_loaded_subject, &args);
509 1.1 christos }
510 1.1 christos
511 1.1 christos /* solib_unloaded notifications. */
512 1.1 christos
513 1.1 christos static struct observer_list *solib_unloaded_subject = NULL;
514 1.1 christos
515 1.1 christos struct solib_unloaded_args { struct so_list *solib; };
516 1.1 christos
517 1.1 christos static void
518 1.1 christos observer_solib_unloaded_notification_stub (const void *data, const void *args_data)
519 1.1 christos {
520 1.1 christos observer_solib_unloaded_ftype *notify = (observer_solib_unloaded_ftype *) data;
521 1.1 christos const struct solib_unloaded_args *args = args_data;
522 1.1 christos notify (args->solib);
523 1.1 christos }
524 1.1 christos
525 1.1 christos struct observer *
526 1.1 christos observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f)
527 1.1 christos {
528 1.1 christos return generic_observer_attach (&solib_unloaded_subject,
529 1.1 christos &observer_solib_unloaded_notification_stub,
530 1.1 christos (void *) f);
531 1.1 christos }
532 1.1 christos
533 1.1 christos void
534 1.1 christos observer_detach_solib_unloaded (struct observer *observer)
535 1.1 christos {
536 1.1 christos generic_observer_detach (&solib_unloaded_subject, observer);
537 1.1 christos }
538 1.1 christos
539 1.1 christos void
540 1.1 christos observer_notify_solib_unloaded (struct so_list *solib)
541 1.1 christos {
542 1.1 christos struct solib_unloaded_args args;
543 1.1 christos args.solib = solib;
544 1.1 christos
545 1.1 christos if (observer_debug)
546 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_unloaded() called\n");
547 1.1 christos generic_observer_notify (solib_unloaded_subject, &args);
548 1.1 christos }
549 1.1 christos
550 1.1 christos /* new_objfile notifications. */
551 1.1 christos
552 1.1 christos static struct observer_list *new_objfile_subject = NULL;
553 1.1 christos
554 1.1 christos struct new_objfile_args { struct objfile *objfile; };
555 1.1 christos
556 1.1 christos static void
557 1.1 christos observer_new_objfile_notification_stub (const void *data, const void *args_data)
558 1.1 christos {
559 1.1 christos observer_new_objfile_ftype *notify = (observer_new_objfile_ftype *) data;
560 1.1 christos const struct new_objfile_args *args = args_data;
561 1.1 christos notify (args->objfile);
562 1.1 christos }
563 1.1 christos
564 1.1 christos struct observer *
565 1.1 christos observer_attach_new_objfile (observer_new_objfile_ftype *f)
566 1.1 christos {
567 1.1 christos return generic_observer_attach (&new_objfile_subject,
568 1.1 christos &observer_new_objfile_notification_stub,
569 1.1 christos (void *) f);
570 1.1 christos }
571 1.1 christos
572 1.1 christos void
573 1.1 christos observer_detach_new_objfile (struct observer *observer)
574 1.1 christos {
575 1.1 christos generic_observer_detach (&new_objfile_subject, observer);
576 1.1 christos }
577 1.1 christos
578 1.1 christos void
579 1.1 christos observer_notify_new_objfile (struct objfile *objfile)
580 1.1 christos {
581 1.1 christos struct new_objfile_args args;
582 1.1 christos args.objfile = objfile;
583 1.1 christos
584 1.1 christos if (observer_debug)
585 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_new_objfile() called\n");
586 1.1 christos generic_observer_notify (new_objfile_subject, &args);
587 1.1 christos }
588 1.1 christos
589 1.3 mrg /* free_objfile notifications. */
590 1.3 mrg
591 1.3 mrg static struct observer_list *free_objfile_subject = NULL;
592 1.3 mrg
593 1.3 mrg struct free_objfile_args { struct objfile *objfile; };
594 1.3 mrg
595 1.3 mrg static void
596 1.3 mrg observer_free_objfile_notification_stub (const void *data, const void *args_data)
597 1.3 mrg {
598 1.3 mrg observer_free_objfile_ftype *notify = (observer_free_objfile_ftype *) data;
599 1.3 mrg const struct free_objfile_args *args = args_data;
600 1.3 mrg notify (args->objfile);
601 1.3 mrg }
602 1.3 mrg
603 1.3 mrg struct observer *
604 1.3 mrg observer_attach_free_objfile (observer_free_objfile_ftype *f)
605 1.3 mrg {
606 1.3 mrg return generic_observer_attach (&free_objfile_subject,
607 1.3 mrg &observer_free_objfile_notification_stub,
608 1.3 mrg (void *) f);
609 1.3 mrg }
610 1.3 mrg
611 1.3 mrg void
612 1.3 mrg observer_detach_free_objfile (struct observer *observer)
613 1.3 mrg {
614 1.3 mrg generic_observer_detach (&free_objfile_subject, observer);
615 1.3 mrg }
616 1.3 mrg
617 1.3 mrg void
618 1.3 mrg observer_notify_free_objfile (struct objfile *objfile)
619 1.3 mrg {
620 1.3 mrg struct free_objfile_args args;
621 1.3 mrg args.objfile = objfile;
622 1.3 mrg
623 1.3 mrg if (observer_debug)
624 1.3 mrg fprintf_unfiltered (gdb_stdlog, "observer_notify_free_objfile() called\n");
625 1.3 mrg generic_observer_notify (free_objfile_subject, &args);
626 1.3 mrg }
627 1.3 mrg
628 1.1 christos /* new_thread notifications. */
629 1.1 christos
630 1.1 christos static struct observer_list *new_thread_subject = NULL;
631 1.1 christos
632 1.1 christos struct new_thread_args { struct thread_info *t; };
633 1.1 christos
634 1.1 christos static void
635 1.1 christos observer_new_thread_notification_stub (const void *data, const void *args_data)
636 1.1 christos {
637 1.1 christos observer_new_thread_ftype *notify = (observer_new_thread_ftype *) data;
638 1.1 christos const struct new_thread_args *args = args_data;
639 1.1 christos notify (args->t);
640 1.1 christos }
641 1.1 christos
642 1.1 christos struct observer *
643 1.1 christos observer_attach_new_thread (observer_new_thread_ftype *f)
644 1.1 christos {
645 1.1 christos return generic_observer_attach (&new_thread_subject,
646 1.1 christos &observer_new_thread_notification_stub,
647 1.1 christos (void *) f);
648 1.1 christos }
649 1.1 christos
650 1.1 christos void
651 1.1 christos observer_detach_new_thread (struct observer *observer)
652 1.1 christos {
653 1.1 christos generic_observer_detach (&new_thread_subject, observer);
654 1.1 christos }
655 1.1 christos
656 1.1 christos void
657 1.1 christos observer_notify_new_thread (struct thread_info *t)
658 1.1 christos {
659 1.1 christos struct new_thread_args args;
660 1.1 christos args.t = t;
661 1.1 christos
662 1.1 christos if (observer_debug)
663 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_new_thread() called\n");
664 1.1 christos generic_observer_notify (new_thread_subject, &args);
665 1.1 christos }
666 1.1 christos
667 1.1 christos /* thread_exit notifications. */
668 1.1 christos
669 1.1 christos static struct observer_list *thread_exit_subject = NULL;
670 1.1 christos
671 1.1 christos struct thread_exit_args { struct thread_info *t; int silent; };
672 1.1 christos
673 1.1 christos static void
674 1.1 christos observer_thread_exit_notification_stub (const void *data, const void *args_data)
675 1.1 christos {
676 1.1 christos observer_thread_exit_ftype *notify = (observer_thread_exit_ftype *) data;
677 1.1 christos const struct thread_exit_args *args = args_data;
678 1.1 christos notify (args->t, args->silent);
679 1.1 christos }
680 1.1 christos
681 1.1 christos struct observer *
682 1.1 christos observer_attach_thread_exit (observer_thread_exit_ftype *f)
683 1.1 christos {
684 1.1 christos return generic_observer_attach (&thread_exit_subject,
685 1.1 christos &observer_thread_exit_notification_stub,
686 1.1 christos (void *) f);
687 1.1 christos }
688 1.1 christos
689 1.1 christos void
690 1.1 christos observer_detach_thread_exit (struct observer *observer)
691 1.1 christos {
692 1.1 christos generic_observer_detach (&thread_exit_subject, observer);
693 1.1 christos }
694 1.1 christos
695 1.1 christos void
696 1.1 christos observer_notify_thread_exit (struct thread_info *t, int silent)
697 1.1 christos {
698 1.1 christos struct thread_exit_args args;
699 1.1 christos args.t = t, args.silent = silent;
700 1.1 christos
701 1.1 christos if (observer_debug)
702 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_exit() called\n");
703 1.1 christos generic_observer_notify (thread_exit_subject, &args);
704 1.1 christos }
705 1.1 christos
706 1.1 christos /* thread_stop_requested notifications. */
707 1.1 christos
708 1.1 christos static struct observer_list *thread_stop_requested_subject = NULL;
709 1.1 christos
710 1.1 christos struct thread_stop_requested_args { ptid_t ptid; };
711 1.1 christos
712 1.1 christos static void
713 1.1 christos observer_thread_stop_requested_notification_stub (const void *data, const void *args_data)
714 1.1 christos {
715 1.1 christos observer_thread_stop_requested_ftype *notify = (observer_thread_stop_requested_ftype *) data;
716 1.1 christos const struct thread_stop_requested_args *args = args_data;
717 1.1 christos notify (args->ptid);
718 1.1 christos }
719 1.1 christos
720 1.1 christos struct observer *
721 1.1 christos observer_attach_thread_stop_requested (observer_thread_stop_requested_ftype *f)
722 1.1 christos {
723 1.1 christos return generic_observer_attach (&thread_stop_requested_subject,
724 1.1 christos &observer_thread_stop_requested_notification_stub,
725 1.1 christos (void *) f);
726 1.1 christos }
727 1.1 christos
728 1.1 christos void
729 1.1 christos observer_detach_thread_stop_requested (struct observer *observer)
730 1.1 christos {
731 1.1 christos generic_observer_detach (&thread_stop_requested_subject, observer);
732 1.1 christos }
733 1.1 christos
734 1.1 christos void
735 1.1 christos observer_notify_thread_stop_requested (ptid_t ptid)
736 1.1 christos {
737 1.1 christos struct thread_stop_requested_args args;
738 1.1 christos args.ptid = ptid;
739 1.1 christos
740 1.1 christos if (observer_debug)
741 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_stop_requested() called\n");
742 1.1 christos generic_observer_notify (thread_stop_requested_subject, &args);
743 1.1 christos }
744 1.1 christos
745 1.1 christos /* target_resumed notifications. */
746 1.1 christos
747 1.1 christos static struct observer_list *target_resumed_subject = NULL;
748 1.1 christos
749 1.1 christos struct target_resumed_args { ptid_t ptid; };
750 1.1 christos
751 1.1 christos static void
752 1.1 christos observer_target_resumed_notification_stub (const void *data, const void *args_data)
753 1.1 christos {
754 1.1 christos observer_target_resumed_ftype *notify = (observer_target_resumed_ftype *) data;
755 1.1 christos const struct target_resumed_args *args = args_data;
756 1.1 christos notify (args->ptid);
757 1.1 christos }
758 1.1 christos
759 1.1 christos struct observer *
760 1.1 christos observer_attach_target_resumed (observer_target_resumed_ftype *f)
761 1.1 christos {
762 1.1 christos return generic_observer_attach (&target_resumed_subject,
763 1.1 christos &observer_target_resumed_notification_stub,
764 1.1 christos (void *) f);
765 1.1 christos }
766 1.1 christos
767 1.1 christos void
768 1.1 christos observer_detach_target_resumed (struct observer *observer)
769 1.1 christos {
770 1.1 christos generic_observer_detach (&target_resumed_subject, observer);
771 1.1 christos }
772 1.1 christos
773 1.1 christos void
774 1.1 christos observer_notify_target_resumed (ptid_t ptid)
775 1.1 christos {
776 1.1 christos struct target_resumed_args args;
777 1.1 christos args.ptid = ptid;
778 1.1 christos
779 1.1 christos if (observer_debug)
780 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_target_resumed() called\n");
781 1.1 christos generic_observer_notify (target_resumed_subject, &args);
782 1.1 christos }
783 1.1 christos
784 1.1 christos /* about_to_proceed notifications. */
785 1.1 christos
786 1.1 christos static struct observer_list *about_to_proceed_subject = NULL;
787 1.1 christos
788 1.1 christos static void
789 1.1 christos observer_about_to_proceed_notification_stub (const void *data, const void *args_data)
790 1.1 christos {
791 1.1 christos observer_about_to_proceed_ftype *notify = (observer_about_to_proceed_ftype *) data;
792 1.1 christos notify ();
793 1.1 christos }
794 1.1 christos
795 1.1 christos struct observer *
796 1.1 christos observer_attach_about_to_proceed (observer_about_to_proceed_ftype *f)
797 1.1 christos {
798 1.1 christos return generic_observer_attach (&about_to_proceed_subject,
799 1.1 christos &observer_about_to_proceed_notification_stub,
800 1.1 christos (void *) f);
801 1.1 christos }
802 1.1 christos
803 1.1 christos void
804 1.1 christos observer_detach_about_to_proceed (struct observer *observer)
805 1.1 christos {
806 1.1 christos generic_observer_detach (&about_to_proceed_subject, observer);
807 1.1 christos }
808 1.1 christos
809 1.1 christos void
810 1.1 christos observer_notify_about_to_proceed (void)
811 1.1 christos {
812 1.1 christos char *args = NULL;
813 1.1 christos if (observer_debug)
814 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_about_to_proceed() called\n");
815 1.1 christos generic_observer_notify (about_to_proceed_subject, &args);
816 1.1 christos }
817 1.1 christos
818 1.1 christos /* breakpoint_created notifications. */
819 1.1 christos
820 1.1 christos static struct observer_list *breakpoint_created_subject = NULL;
821 1.1 christos
822 1.2 christos struct breakpoint_created_args { struct breakpoint *b; };
823 1.1 christos
824 1.1 christos static void
825 1.1 christos observer_breakpoint_created_notification_stub (const void *data, const void *args_data)
826 1.1 christos {
827 1.1 christos observer_breakpoint_created_ftype *notify = (observer_breakpoint_created_ftype *) data;
828 1.1 christos const struct breakpoint_created_args *args = args_data;
829 1.2 christos notify (args->b);
830 1.1 christos }
831 1.1 christos
832 1.1 christos struct observer *
833 1.1 christos observer_attach_breakpoint_created (observer_breakpoint_created_ftype *f)
834 1.1 christos {
835 1.1 christos return generic_observer_attach (&breakpoint_created_subject,
836 1.1 christos &observer_breakpoint_created_notification_stub,
837 1.1 christos (void *) f);
838 1.1 christos }
839 1.1 christos
840 1.1 christos void
841 1.1 christos observer_detach_breakpoint_created (struct observer *observer)
842 1.1 christos {
843 1.1 christos generic_observer_detach (&breakpoint_created_subject, observer);
844 1.1 christos }
845 1.1 christos
846 1.1 christos void
847 1.2 christos observer_notify_breakpoint_created (struct breakpoint *b)
848 1.1 christos {
849 1.1 christos struct breakpoint_created_args args;
850 1.2 christos args.b = b;
851 1.1 christos
852 1.1 christos if (observer_debug)
853 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_created() called\n");
854 1.1 christos generic_observer_notify (breakpoint_created_subject, &args);
855 1.1 christos }
856 1.1 christos
857 1.1 christos /* breakpoint_deleted notifications. */
858 1.1 christos
859 1.1 christos static struct observer_list *breakpoint_deleted_subject = NULL;
860 1.1 christos
861 1.2 christos struct breakpoint_deleted_args { struct breakpoint *b; };
862 1.1 christos
863 1.1 christos static void
864 1.1 christos observer_breakpoint_deleted_notification_stub (const void *data, const void *args_data)
865 1.1 christos {
866 1.1 christos observer_breakpoint_deleted_ftype *notify = (observer_breakpoint_deleted_ftype *) data;
867 1.1 christos const struct breakpoint_deleted_args *args = args_data;
868 1.2 christos notify (args->b);
869 1.1 christos }
870 1.1 christos
871 1.1 christos struct observer *
872 1.1 christos observer_attach_breakpoint_deleted (observer_breakpoint_deleted_ftype *f)
873 1.1 christos {
874 1.1 christos return generic_observer_attach (&breakpoint_deleted_subject,
875 1.1 christos &observer_breakpoint_deleted_notification_stub,
876 1.1 christos (void *) f);
877 1.1 christos }
878 1.1 christos
879 1.1 christos void
880 1.1 christos observer_detach_breakpoint_deleted (struct observer *observer)
881 1.1 christos {
882 1.1 christos generic_observer_detach (&breakpoint_deleted_subject, observer);
883 1.1 christos }
884 1.1 christos
885 1.1 christos void
886 1.2 christos observer_notify_breakpoint_deleted (struct breakpoint *b)
887 1.1 christos {
888 1.1 christos struct breakpoint_deleted_args args;
889 1.2 christos args.b = b;
890 1.1 christos
891 1.1 christos if (observer_debug)
892 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_deleted() called\n");
893 1.1 christos generic_observer_notify (breakpoint_deleted_subject, &args);
894 1.1 christos }
895 1.1 christos
896 1.1 christos /* breakpoint_modified notifications. */
897 1.1 christos
898 1.1 christos static struct observer_list *breakpoint_modified_subject = NULL;
899 1.1 christos
900 1.2 christos struct breakpoint_modified_args { struct breakpoint *b; };
901 1.1 christos
902 1.1 christos static void
903 1.1 christos observer_breakpoint_modified_notification_stub (const void *data, const void *args_data)
904 1.1 christos {
905 1.1 christos observer_breakpoint_modified_ftype *notify = (observer_breakpoint_modified_ftype *) data;
906 1.1 christos const struct breakpoint_modified_args *args = args_data;
907 1.2 christos notify (args->b);
908 1.1 christos }
909 1.1 christos
910 1.1 christos struct observer *
911 1.1 christos observer_attach_breakpoint_modified (observer_breakpoint_modified_ftype *f)
912 1.1 christos {
913 1.1 christos return generic_observer_attach (&breakpoint_modified_subject,
914 1.1 christos &observer_breakpoint_modified_notification_stub,
915 1.1 christos (void *) f);
916 1.1 christos }
917 1.1 christos
918 1.1 christos void
919 1.1 christos observer_detach_breakpoint_modified (struct observer *observer)
920 1.1 christos {
921 1.1 christos generic_observer_detach (&breakpoint_modified_subject, observer);
922 1.1 christos }
923 1.1 christos
924 1.1 christos void
925 1.2 christos observer_notify_breakpoint_modified (struct breakpoint *b)
926 1.1 christos {
927 1.1 christos struct breakpoint_modified_args args;
928 1.2 christos args.b = b;
929 1.1 christos
930 1.1 christos if (observer_debug)
931 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_modified() called\n");
932 1.1 christos generic_observer_notify (breakpoint_modified_subject, &args);
933 1.1 christos }
934 1.1 christos
935 1.2 christos /* traceframe_changed notifications. */
936 1.1 christos
937 1.2 christos static struct observer_list *traceframe_changed_subject = NULL;
938 1.1 christos
939 1.2 christos struct traceframe_changed_args { int tfnum; int tpnum; };
940 1.1 christos
941 1.1 christos static void
942 1.2 christos observer_traceframe_changed_notification_stub (const void *data, const void *args_data)
943 1.1 christos {
944 1.2 christos observer_traceframe_changed_ftype *notify = (observer_traceframe_changed_ftype *) data;
945 1.2 christos const struct traceframe_changed_args *args = args_data;
946 1.2 christos notify (args->tfnum, args->tpnum);
947 1.1 christos }
948 1.1 christos
949 1.1 christos struct observer *
950 1.2 christos observer_attach_traceframe_changed (observer_traceframe_changed_ftype *f)
951 1.1 christos {
952 1.2 christos return generic_observer_attach (&traceframe_changed_subject,
953 1.2 christos &observer_traceframe_changed_notification_stub,
954 1.1 christos (void *) f);
955 1.1 christos }
956 1.1 christos
957 1.1 christos void
958 1.2 christos observer_detach_traceframe_changed (struct observer *observer)
959 1.1 christos {
960 1.2 christos generic_observer_detach (&traceframe_changed_subject, observer);
961 1.1 christos }
962 1.1 christos
963 1.1 christos void
964 1.2 christos observer_notify_traceframe_changed (int tfnum, int tpnum)
965 1.1 christos {
966 1.2 christos struct traceframe_changed_args args;
967 1.2 christos args.tfnum = tfnum, args.tpnum = tpnum;
968 1.1 christos
969 1.1 christos if (observer_debug)
970 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_traceframe_changed() called\n");
971 1.2 christos generic_observer_notify (traceframe_changed_subject, &args);
972 1.1 christos }
973 1.1 christos
974 1.1 christos /* architecture_changed notifications. */
975 1.1 christos
976 1.1 christos static struct observer_list *architecture_changed_subject = NULL;
977 1.1 christos
978 1.1 christos struct architecture_changed_args { struct gdbarch *newarch; };
979 1.1 christos
980 1.1 christos static void
981 1.1 christos observer_architecture_changed_notification_stub (const void *data, const void *args_data)
982 1.1 christos {
983 1.1 christos observer_architecture_changed_ftype *notify = (observer_architecture_changed_ftype *) data;
984 1.1 christos const struct architecture_changed_args *args = args_data;
985 1.1 christos notify (args->newarch);
986 1.1 christos }
987 1.1 christos
988 1.1 christos struct observer *
989 1.1 christos observer_attach_architecture_changed (observer_architecture_changed_ftype *f)
990 1.1 christos {
991 1.1 christos return generic_observer_attach (&architecture_changed_subject,
992 1.1 christos &observer_architecture_changed_notification_stub,
993 1.1 christos (void *) f);
994 1.1 christos }
995 1.1 christos
996 1.1 christos void
997 1.1 christos observer_detach_architecture_changed (struct observer *observer)
998 1.1 christos {
999 1.1 christos generic_observer_detach (&architecture_changed_subject, observer);
1000 1.1 christos }
1001 1.1 christos
1002 1.1 christos void
1003 1.1 christos observer_notify_architecture_changed (struct gdbarch *newarch)
1004 1.1 christos {
1005 1.1 christos struct architecture_changed_args args;
1006 1.1 christos args.newarch = newarch;
1007 1.1 christos
1008 1.1 christos if (observer_debug)
1009 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_architecture_changed() called\n");
1010 1.1 christos generic_observer_notify (architecture_changed_subject, &args);
1011 1.1 christos }
1012 1.1 christos
1013 1.1 christos /* thread_ptid_changed notifications. */
1014 1.1 christos
1015 1.1 christos static struct observer_list *thread_ptid_changed_subject = NULL;
1016 1.1 christos
1017 1.1 christos struct thread_ptid_changed_args { ptid_t old_ptid; ptid_t new_ptid; };
1018 1.1 christos
1019 1.1 christos static void
1020 1.1 christos observer_thread_ptid_changed_notification_stub (const void *data, const void *args_data)
1021 1.1 christos {
1022 1.1 christos observer_thread_ptid_changed_ftype *notify = (observer_thread_ptid_changed_ftype *) data;
1023 1.1 christos const struct thread_ptid_changed_args *args = args_data;
1024 1.1 christos notify (args->old_ptid, args->new_ptid);
1025 1.1 christos }
1026 1.1 christos
1027 1.1 christos struct observer *
1028 1.1 christos observer_attach_thread_ptid_changed (observer_thread_ptid_changed_ftype *f)
1029 1.1 christos {
1030 1.1 christos return generic_observer_attach (&thread_ptid_changed_subject,
1031 1.1 christos &observer_thread_ptid_changed_notification_stub,
1032 1.1 christos (void *) f);
1033 1.1 christos }
1034 1.1 christos
1035 1.1 christos void
1036 1.1 christos observer_detach_thread_ptid_changed (struct observer *observer)
1037 1.1 christos {
1038 1.1 christos generic_observer_detach (&thread_ptid_changed_subject, observer);
1039 1.1 christos }
1040 1.1 christos
1041 1.1 christos void
1042 1.1 christos observer_notify_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid)
1043 1.1 christos {
1044 1.1 christos struct thread_ptid_changed_args args;
1045 1.1 christos args.old_ptid = old_ptid, args.new_ptid = new_ptid;
1046 1.1 christos
1047 1.1 christos if (observer_debug)
1048 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_ptid_changed() called\n");
1049 1.1 christos generic_observer_notify (thread_ptid_changed_subject, &args);
1050 1.1 christos }
1051 1.1 christos
1052 1.1 christos /* inferior_added notifications. */
1053 1.1 christos
1054 1.1 christos static struct observer_list *inferior_added_subject = NULL;
1055 1.1 christos
1056 1.1 christos struct inferior_added_args { struct inferior *inf; };
1057 1.1 christos
1058 1.1 christos static void
1059 1.1 christos observer_inferior_added_notification_stub (const void *data, const void *args_data)
1060 1.1 christos {
1061 1.1 christos observer_inferior_added_ftype *notify = (observer_inferior_added_ftype *) data;
1062 1.1 christos const struct inferior_added_args *args = args_data;
1063 1.1 christos notify (args->inf);
1064 1.1 christos }
1065 1.1 christos
1066 1.1 christos struct observer *
1067 1.1 christos observer_attach_inferior_added (observer_inferior_added_ftype *f)
1068 1.1 christos {
1069 1.1 christos return generic_observer_attach (&inferior_added_subject,
1070 1.1 christos &observer_inferior_added_notification_stub,
1071 1.1 christos (void *) f);
1072 1.1 christos }
1073 1.1 christos
1074 1.1 christos void
1075 1.1 christos observer_detach_inferior_added (struct observer *observer)
1076 1.1 christos {
1077 1.1 christos generic_observer_detach (&inferior_added_subject, observer);
1078 1.1 christos }
1079 1.1 christos
1080 1.1 christos void
1081 1.1 christos observer_notify_inferior_added (struct inferior *inf)
1082 1.1 christos {
1083 1.1 christos struct inferior_added_args args;
1084 1.1 christos args.inf = inf;
1085 1.1 christos
1086 1.1 christos if (observer_debug)
1087 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_added() called\n");
1088 1.1 christos generic_observer_notify (inferior_added_subject, &args);
1089 1.1 christos }
1090 1.1 christos
1091 1.1 christos /* inferior_appeared notifications. */
1092 1.1 christos
1093 1.1 christos static struct observer_list *inferior_appeared_subject = NULL;
1094 1.1 christos
1095 1.1 christos struct inferior_appeared_args { struct inferior *inf; };
1096 1.1 christos
1097 1.1 christos static void
1098 1.1 christos observer_inferior_appeared_notification_stub (const void *data, const void *args_data)
1099 1.1 christos {
1100 1.1 christos observer_inferior_appeared_ftype *notify = (observer_inferior_appeared_ftype *) data;
1101 1.1 christos const struct inferior_appeared_args *args = args_data;
1102 1.1 christos notify (args->inf);
1103 1.1 christos }
1104 1.1 christos
1105 1.1 christos struct observer *
1106 1.1 christos observer_attach_inferior_appeared (observer_inferior_appeared_ftype *f)
1107 1.1 christos {
1108 1.1 christos return generic_observer_attach (&inferior_appeared_subject,
1109 1.1 christos &observer_inferior_appeared_notification_stub,
1110 1.1 christos (void *) f);
1111 1.1 christos }
1112 1.1 christos
1113 1.1 christos void
1114 1.1 christos observer_detach_inferior_appeared (struct observer *observer)
1115 1.1 christos {
1116 1.1 christos generic_observer_detach (&inferior_appeared_subject, observer);
1117 1.1 christos }
1118 1.1 christos
1119 1.1 christos void
1120 1.1 christos observer_notify_inferior_appeared (struct inferior *inf)
1121 1.1 christos {
1122 1.1 christos struct inferior_appeared_args args;
1123 1.1 christos args.inf = inf;
1124 1.1 christos
1125 1.1 christos if (observer_debug)
1126 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_appeared() called\n");
1127 1.1 christos generic_observer_notify (inferior_appeared_subject, &args);
1128 1.1 christos }
1129 1.1 christos
1130 1.1 christos /* inferior_exit notifications. */
1131 1.1 christos
1132 1.1 christos static struct observer_list *inferior_exit_subject = NULL;
1133 1.1 christos
1134 1.1 christos struct inferior_exit_args { struct inferior *inf; };
1135 1.1 christos
1136 1.1 christos static void
1137 1.1 christos observer_inferior_exit_notification_stub (const void *data, const void *args_data)
1138 1.1 christos {
1139 1.1 christos observer_inferior_exit_ftype *notify = (observer_inferior_exit_ftype *) data;
1140 1.1 christos const struct inferior_exit_args *args = args_data;
1141 1.1 christos notify (args->inf);
1142 1.1 christos }
1143 1.1 christos
1144 1.1 christos struct observer *
1145 1.1 christos observer_attach_inferior_exit (observer_inferior_exit_ftype *f)
1146 1.1 christos {
1147 1.1 christos return generic_observer_attach (&inferior_exit_subject,
1148 1.1 christos &observer_inferior_exit_notification_stub,
1149 1.1 christos (void *) f);
1150 1.1 christos }
1151 1.1 christos
1152 1.1 christos void
1153 1.1 christos observer_detach_inferior_exit (struct observer *observer)
1154 1.1 christos {
1155 1.1 christos generic_observer_detach (&inferior_exit_subject, observer);
1156 1.1 christos }
1157 1.1 christos
1158 1.1 christos void
1159 1.1 christos observer_notify_inferior_exit (struct inferior *inf)
1160 1.1 christos {
1161 1.1 christos struct inferior_exit_args args;
1162 1.1 christos args.inf = inf;
1163 1.1 christos
1164 1.1 christos if (observer_debug)
1165 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_exit() called\n");
1166 1.1 christos generic_observer_notify (inferior_exit_subject, &args);
1167 1.1 christos }
1168 1.1 christos
1169 1.1 christos /* inferior_removed notifications. */
1170 1.1 christos
1171 1.1 christos static struct observer_list *inferior_removed_subject = NULL;
1172 1.1 christos
1173 1.1 christos struct inferior_removed_args { struct inferior *inf; };
1174 1.1 christos
1175 1.1 christos static void
1176 1.1 christos observer_inferior_removed_notification_stub (const void *data, const void *args_data)
1177 1.1 christos {
1178 1.1 christos observer_inferior_removed_ftype *notify = (observer_inferior_removed_ftype *) data;
1179 1.1 christos const struct inferior_removed_args *args = args_data;
1180 1.1 christos notify (args->inf);
1181 1.1 christos }
1182 1.1 christos
1183 1.1 christos struct observer *
1184 1.1 christos observer_attach_inferior_removed (observer_inferior_removed_ftype *f)
1185 1.1 christos {
1186 1.1 christos return generic_observer_attach (&inferior_removed_subject,
1187 1.1 christos &observer_inferior_removed_notification_stub,
1188 1.1 christos (void *) f);
1189 1.1 christos }
1190 1.1 christos
1191 1.1 christos void
1192 1.1 christos observer_detach_inferior_removed (struct observer *observer)
1193 1.1 christos {
1194 1.1 christos generic_observer_detach (&inferior_removed_subject, observer);
1195 1.1 christos }
1196 1.1 christos
1197 1.1 christos void
1198 1.1 christos observer_notify_inferior_removed (struct inferior *inf)
1199 1.1 christos {
1200 1.1 christos struct inferior_removed_args args;
1201 1.1 christos args.inf = inf;
1202 1.1 christos
1203 1.1 christos if (observer_debug)
1204 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_removed() called\n");
1205 1.1 christos generic_observer_notify (inferior_removed_subject, &args);
1206 1.1 christos }
1207 1.1 christos
1208 1.1 christos /* memory_changed notifications. */
1209 1.1 christos
1210 1.1 christos static struct observer_list *memory_changed_subject = NULL;
1211 1.1 christos
1212 1.2 christos struct memory_changed_args { struct inferior *inferior; CORE_ADDR addr; ssize_t len; const bfd_byte *data; };
1213 1.1 christos
1214 1.1 christos static void
1215 1.1 christos observer_memory_changed_notification_stub (const void *data, const void *args_data)
1216 1.1 christos {
1217 1.1 christos observer_memory_changed_ftype *notify = (observer_memory_changed_ftype *) data;
1218 1.1 christos const struct memory_changed_args *args = args_data;
1219 1.2 christos notify (args->inferior, args->addr, args->len, args->data);
1220 1.1 christos }
1221 1.1 christos
1222 1.1 christos struct observer *
1223 1.1 christos observer_attach_memory_changed (observer_memory_changed_ftype *f)
1224 1.1 christos {
1225 1.1 christos return generic_observer_attach (&memory_changed_subject,
1226 1.1 christos &observer_memory_changed_notification_stub,
1227 1.1 christos (void *) f);
1228 1.1 christos }
1229 1.1 christos
1230 1.1 christos void
1231 1.1 christos observer_detach_memory_changed (struct observer *observer)
1232 1.1 christos {
1233 1.1 christos generic_observer_detach (&memory_changed_subject, observer);
1234 1.1 christos }
1235 1.1 christos
1236 1.1 christos void
1237 1.2 christos observer_notify_memory_changed (struct inferior *inferior, CORE_ADDR addr, ssize_t len, const bfd_byte *data)
1238 1.1 christos {
1239 1.1 christos struct memory_changed_args args;
1240 1.2 christos args.inferior = inferior, args.addr = addr, args.len = len, args.data = data;
1241 1.1 christos
1242 1.1 christos if (observer_debug)
1243 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_memory_changed() called\n");
1244 1.1 christos generic_observer_notify (memory_changed_subject, &args);
1245 1.1 christos }
1246 1.1 christos
1247 1.2 christos /* before_prompt notifications. */
1248 1.2 christos
1249 1.2 christos static struct observer_list *before_prompt_subject = NULL;
1250 1.2 christos
1251 1.2 christos struct before_prompt_args { const char *current_prompt; };
1252 1.2 christos
1253 1.2 christos static void
1254 1.2 christos observer_before_prompt_notification_stub (const void *data, const void *args_data)
1255 1.2 christos {
1256 1.2 christos observer_before_prompt_ftype *notify = (observer_before_prompt_ftype *) data;
1257 1.2 christos const struct before_prompt_args *args = args_data;
1258 1.2 christos notify (args->current_prompt);
1259 1.2 christos }
1260 1.2 christos
1261 1.2 christos struct observer *
1262 1.2 christos observer_attach_before_prompt (observer_before_prompt_ftype *f)
1263 1.2 christos {
1264 1.2 christos return generic_observer_attach (&before_prompt_subject,
1265 1.2 christos &observer_before_prompt_notification_stub,
1266 1.2 christos (void *) f);
1267 1.2 christos }
1268 1.2 christos
1269 1.2 christos void
1270 1.2 christos observer_detach_before_prompt (struct observer *observer)
1271 1.2 christos {
1272 1.2 christos generic_observer_detach (&before_prompt_subject, observer);
1273 1.2 christos }
1274 1.2 christos
1275 1.2 christos void
1276 1.2 christos observer_notify_before_prompt (const char *current_prompt)
1277 1.2 christos {
1278 1.2 christos struct before_prompt_args args;
1279 1.2 christos args.current_prompt = current_prompt;
1280 1.2 christos
1281 1.2 christos if (observer_debug)
1282 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_before_prompt() called\n");
1283 1.2 christos generic_observer_notify (before_prompt_subject, &args);
1284 1.2 christos }
1285 1.2 christos
1286 1.2 christos /* gdb_datadir_changed notifications. */
1287 1.2 christos
1288 1.2 christos static struct observer_list *gdb_datadir_changed_subject = NULL;
1289 1.2 christos
1290 1.2 christos static void
1291 1.2 christos observer_gdb_datadir_changed_notification_stub (const void *data, const void *args_data)
1292 1.2 christos {
1293 1.2 christos observer_gdb_datadir_changed_ftype *notify = (observer_gdb_datadir_changed_ftype *) data;
1294 1.2 christos notify ();
1295 1.2 christos }
1296 1.2 christos
1297 1.2 christos struct observer *
1298 1.2 christos observer_attach_gdb_datadir_changed (observer_gdb_datadir_changed_ftype *f)
1299 1.2 christos {
1300 1.2 christos return generic_observer_attach (&gdb_datadir_changed_subject,
1301 1.2 christos &observer_gdb_datadir_changed_notification_stub,
1302 1.2 christos (void *) f);
1303 1.2 christos }
1304 1.2 christos
1305 1.2 christos void
1306 1.2 christos observer_detach_gdb_datadir_changed (struct observer *observer)
1307 1.2 christos {
1308 1.2 christos generic_observer_detach (&gdb_datadir_changed_subject, observer);
1309 1.2 christos }
1310 1.2 christos
1311 1.2 christos void
1312 1.2 christos observer_notify_gdb_datadir_changed (void)
1313 1.2 christos {
1314 1.2 christos char *args = NULL;
1315 1.2 christos if (observer_debug)
1316 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_gdb_datadir_changed() called\n");
1317 1.2 christos generic_observer_notify (gdb_datadir_changed_subject, &args);
1318 1.2 christos }
1319 1.2 christos
1320 1.2 christos /* command_param_changed notifications. */
1321 1.2 christos
1322 1.2 christos static struct observer_list *command_param_changed_subject = NULL;
1323 1.2 christos
1324 1.2 christos struct command_param_changed_args { const char *param; const char *value; };
1325 1.2 christos
1326 1.2 christos static void
1327 1.2 christos observer_command_param_changed_notification_stub (const void *data, const void *args_data)
1328 1.2 christos {
1329 1.2 christos observer_command_param_changed_ftype *notify = (observer_command_param_changed_ftype *) data;
1330 1.2 christos const struct command_param_changed_args *args = args_data;
1331 1.2 christos notify (args->param, args->value);
1332 1.2 christos }
1333 1.2 christos
1334 1.2 christos struct observer *
1335 1.2 christos observer_attach_command_param_changed (observer_command_param_changed_ftype *f)
1336 1.2 christos {
1337 1.2 christos return generic_observer_attach (&command_param_changed_subject,
1338 1.2 christos &observer_command_param_changed_notification_stub,
1339 1.2 christos (void *) f);
1340 1.2 christos }
1341 1.2 christos
1342 1.2 christos void
1343 1.2 christos observer_detach_command_param_changed (struct observer *observer)
1344 1.2 christos {
1345 1.2 christos generic_observer_detach (&command_param_changed_subject, observer);
1346 1.2 christos }
1347 1.2 christos
1348 1.2 christos void
1349 1.2 christos observer_notify_command_param_changed (const char *param, const char *value)
1350 1.2 christos {
1351 1.2 christos struct command_param_changed_args args;
1352 1.2 christos args.param = param, args.value = value;
1353 1.2 christos
1354 1.2 christos if (observer_debug)
1355 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_command_param_changed() called\n");
1356 1.2 christos generic_observer_notify (command_param_changed_subject, &args);
1357 1.2 christos }
1358 1.2 christos
1359 1.2 christos /* tsv_created notifications. */
1360 1.2 christos
1361 1.2 christos static struct observer_list *tsv_created_subject = NULL;
1362 1.2 christos
1363 1.2 christos struct tsv_created_args { const struct trace_state_variable *tsv; };
1364 1.2 christos
1365 1.2 christos static void
1366 1.2 christos observer_tsv_created_notification_stub (const void *data, const void *args_data)
1367 1.2 christos {
1368 1.2 christos observer_tsv_created_ftype *notify = (observer_tsv_created_ftype *) data;
1369 1.2 christos const struct tsv_created_args *args = args_data;
1370 1.2 christos notify (args->tsv);
1371 1.2 christos }
1372 1.2 christos
1373 1.2 christos struct observer *
1374 1.2 christos observer_attach_tsv_created (observer_tsv_created_ftype *f)
1375 1.2 christos {
1376 1.2 christos return generic_observer_attach (&tsv_created_subject,
1377 1.2 christos &observer_tsv_created_notification_stub,
1378 1.2 christos (void *) f);
1379 1.2 christos }
1380 1.2 christos
1381 1.2 christos void
1382 1.2 christos observer_detach_tsv_created (struct observer *observer)
1383 1.2 christos {
1384 1.2 christos generic_observer_detach (&tsv_created_subject, observer);
1385 1.2 christos }
1386 1.2 christos
1387 1.2 christos void
1388 1.2 christos observer_notify_tsv_created (const struct trace_state_variable *tsv)
1389 1.2 christos {
1390 1.2 christos struct tsv_created_args args;
1391 1.2 christos args.tsv = tsv;
1392 1.2 christos
1393 1.2 christos if (observer_debug)
1394 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_tsv_created() called\n");
1395 1.2 christos generic_observer_notify (tsv_created_subject, &args);
1396 1.2 christos }
1397 1.2 christos
1398 1.2 christos /* tsv_deleted notifications. */
1399 1.2 christos
1400 1.2 christos static struct observer_list *tsv_deleted_subject = NULL;
1401 1.2 christos
1402 1.2 christos struct tsv_deleted_args { const struct trace_state_variable *tsv; };
1403 1.2 christos
1404 1.2 christos static void
1405 1.2 christos observer_tsv_deleted_notification_stub (const void *data, const void *args_data)
1406 1.2 christos {
1407 1.2 christos observer_tsv_deleted_ftype *notify = (observer_tsv_deleted_ftype *) data;
1408 1.2 christos const struct tsv_deleted_args *args = args_data;
1409 1.2 christos notify (args->tsv);
1410 1.2 christos }
1411 1.2 christos
1412 1.2 christos struct observer *
1413 1.2 christos observer_attach_tsv_deleted (observer_tsv_deleted_ftype *f)
1414 1.2 christos {
1415 1.2 christos return generic_observer_attach (&tsv_deleted_subject,
1416 1.2 christos &observer_tsv_deleted_notification_stub,
1417 1.2 christos (void *) f);
1418 1.2 christos }
1419 1.2 christos
1420 1.2 christos void
1421 1.2 christos observer_detach_tsv_deleted (struct observer *observer)
1422 1.2 christos {
1423 1.2 christos generic_observer_detach (&tsv_deleted_subject, observer);
1424 1.2 christos }
1425 1.2 christos
1426 1.2 christos void
1427 1.2 christos observer_notify_tsv_deleted (const struct trace_state_variable *tsv)
1428 1.2 christos {
1429 1.2 christos struct tsv_deleted_args args;
1430 1.2 christos args.tsv = tsv;
1431 1.2 christos
1432 1.2 christos if (observer_debug)
1433 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_tsv_deleted() called\n");
1434 1.2 christos generic_observer_notify (tsv_deleted_subject, &args);
1435 1.2 christos }
1436 1.2 christos
1437 1.2 christos /* tsv_modified notifications. */
1438 1.2 christos
1439 1.2 christos static struct observer_list *tsv_modified_subject = NULL;
1440 1.2 christos
1441 1.2 christos struct tsv_modified_args { const struct trace_state_variable *tsv; };
1442 1.2 christos
1443 1.2 christos static void
1444 1.2 christos observer_tsv_modified_notification_stub (const void *data, const void *args_data)
1445 1.2 christos {
1446 1.2 christos observer_tsv_modified_ftype *notify = (observer_tsv_modified_ftype *) data;
1447 1.2 christos const struct tsv_modified_args *args = args_data;
1448 1.2 christos notify (args->tsv);
1449 1.2 christos }
1450 1.2 christos
1451 1.2 christos struct observer *
1452 1.2 christos observer_attach_tsv_modified (observer_tsv_modified_ftype *f)
1453 1.2 christos {
1454 1.2 christos return generic_observer_attach (&tsv_modified_subject,
1455 1.2 christos &observer_tsv_modified_notification_stub,
1456 1.2 christos (void *) f);
1457 1.2 christos }
1458 1.2 christos
1459 1.2 christos void
1460 1.2 christos observer_detach_tsv_modified (struct observer *observer)
1461 1.2 christos {
1462 1.2 christos generic_observer_detach (&tsv_modified_subject, observer);
1463 1.2 christos }
1464 1.2 christos
1465 1.2 christos void
1466 1.2 christos observer_notify_tsv_modified (const struct trace_state_variable *tsv)
1467 1.2 christos {
1468 1.2 christos struct tsv_modified_args args;
1469 1.2 christos args.tsv = tsv;
1470 1.2 christos
1471 1.2 christos if (observer_debug)
1472 1.2 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_tsv_modified() called\n");
1473 1.2 christos generic_observer_notify (tsv_modified_subject, &args);
1474 1.2 christos }
1475 1.2 christos
1476 1.4 christos /* inferior_call_pre notifications. */
1477 1.4 christos
1478 1.4 christos static struct observer_list *inferior_call_pre_subject = NULL;
1479 1.4 christos
1480 1.4 christos struct inferior_call_pre_args { ptid_t thread; CORE_ADDR address; };
1481 1.4 christos
1482 1.4 christos static void
1483 1.4 christos observer_inferior_call_pre_notification_stub (const void *data, const void *args_data)
1484 1.4 christos {
1485 1.4 christos observer_inferior_call_pre_ftype *notify = (observer_inferior_call_pre_ftype *) data;
1486 1.4 christos const struct inferior_call_pre_args *args = args_data;
1487 1.4 christos notify (args->thread, args->address);
1488 1.4 christos }
1489 1.4 christos
1490 1.4 christos struct observer *
1491 1.4 christos observer_attach_inferior_call_pre (observer_inferior_call_pre_ftype *f)
1492 1.4 christos {
1493 1.4 christos return generic_observer_attach (&inferior_call_pre_subject,
1494 1.4 christos &observer_inferior_call_pre_notification_stub,
1495 1.4 christos (void *) f);
1496 1.4 christos }
1497 1.4 christos
1498 1.4 christos void
1499 1.4 christos observer_detach_inferior_call_pre (struct observer *observer)
1500 1.4 christos {
1501 1.4 christos generic_observer_detach (&inferior_call_pre_subject, observer);
1502 1.4 christos }
1503 1.4 christos
1504 1.4 christos void
1505 1.4 christos observer_notify_inferior_call_pre (ptid_t thread, CORE_ADDR address)
1506 1.4 christos {
1507 1.4 christos struct inferior_call_pre_args args;
1508 1.4 christos args.thread = thread, args.address = address;
1509 1.4 christos
1510 1.4 christos if (observer_debug)
1511 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_call_pre() called\n");
1512 1.4 christos generic_observer_notify (inferior_call_pre_subject, &args);
1513 1.4 christos }
1514 1.4 christos
1515 1.4 christos /* inferior_call_post notifications. */
1516 1.4 christos
1517 1.4 christos static struct observer_list *inferior_call_post_subject = NULL;
1518 1.4 christos
1519 1.4 christos struct inferior_call_post_args { ptid_t thread; CORE_ADDR address; };
1520 1.4 christos
1521 1.4 christos static void
1522 1.4 christos observer_inferior_call_post_notification_stub (const void *data, const void *args_data)
1523 1.4 christos {
1524 1.4 christos observer_inferior_call_post_ftype *notify = (observer_inferior_call_post_ftype *) data;
1525 1.4 christos const struct inferior_call_post_args *args = args_data;
1526 1.4 christos notify (args->thread, args->address);
1527 1.4 christos }
1528 1.4 christos
1529 1.4 christos struct observer *
1530 1.4 christos observer_attach_inferior_call_post (observer_inferior_call_post_ftype *f)
1531 1.4 christos {
1532 1.4 christos return generic_observer_attach (&inferior_call_post_subject,
1533 1.4 christos &observer_inferior_call_post_notification_stub,
1534 1.4 christos (void *) f);
1535 1.4 christos }
1536 1.4 christos
1537 1.4 christos void
1538 1.4 christos observer_detach_inferior_call_post (struct observer *observer)
1539 1.4 christos {
1540 1.4 christos generic_observer_detach (&inferior_call_post_subject, observer);
1541 1.4 christos }
1542 1.4 christos
1543 1.4 christos void
1544 1.4 christos observer_notify_inferior_call_post (ptid_t thread, CORE_ADDR address)
1545 1.4 christos {
1546 1.4 christos struct inferior_call_post_args args;
1547 1.4 christos args.thread = thread, args.address = address;
1548 1.4 christos
1549 1.4 christos if (observer_debug)
1550 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_call_post() called\n");
1551 1.4 christos generic_observer_notify (inferior_call_post_subject, &args);
1552 1.4 christos }
1553 1.4 christos
1554 1.4 christos /* register_changed notifications. */
1555 1.4 christos
1556 1.4 christos static struct observer_list *register_changed_subject = NULL;
1557 1.4 christos
1558 1.4 christos struct register_changed_args { struct frame_info *frame; int regnum; };
1559 1.4 christos
1560 1.4 christos static void
1561 1.4 christos observer_register_changed_notification_stub (const void *data, const void *args_data)
1562 1.4 christos {
1563 1.4 christos observer_register_changed_ftype *notify = (observer_register_changed_ftype *) data;
1564 1.4 christos const struct register_changed_args *args = args_data;
1565 1.4 christos notify (args->frame, args->regnum);
1566 1.4 christos }
1567 1.4 christos
1568 1.4 christos struct observer *
1569 1.4 christos observer_attach_register_changed (observer_register_changed_ftype *f)
1570 1.4 christos {
1571 1.4 christos return generic_observer_attach (®ister_changed_subject,
1572 1.4 christos &observer_register_changed_notification_stub,
1573 1.4 christos (void *) f);
1574 1.4 christos }
1575 1.4 christos
1576 1.4 christos void
1577 1.4 christos observer_detach_register_changed (struct observer *observer)
1578 1.4 christos {
1579 1.4 christos generic_observer_detach (®ister_changed_subject, observer);
1580 1.4 christos }
1581 1.4 christos
1582 1.4 christos void
1583 1.4 christos observer_notify_register_changed (struct frame_info *frame, int regnum)
1584 1.4 christos {
1585 1.4 christos struct register_changed_args args;
1586 1.4 christos args.frame = frame, args.regnum = regnum;
1587 1.4 christos
1588 1.4 christos if (observer_debug)
1589 1.4 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_register_changed() called\n");
1590 1.4 christos generic_observer_notify (register_changed_subject, &args);
1591 1.4 christos }
1592 1.4 christos
1593 1.1 christos /* test_notification notifications. */
1594 1.1 christos
1595 1.1 christos static struct observer_list *test_notification_subject = NULL;
1596 1.1 christos
1597 1.1 christos struct test_notification_args { int somearg; };
1598 1.1 christos
1599 1.1 christos static void
1600 1.1 christos observer_test_notification_notification_stub (const void *data, const void *args_data)
1601 1.1 christos {
1602 1.1 christos observer_test_notification_ftype *notify = (observer_test_notification_ftype *) data;
1603 1.1 christos const struct test_notification_args *args = args_data;
1604 1.1 christos notify (args->somearg);
1605 1.1 christos }
1606 1.1 christos
1607 1.1 christos struct observer *
1608 1.1 christos observer_attach_test_notification (observer_test_notification_ftype *f)
1609 1.1 christos {
1610 1.1 christos return generic_observer_attach (&test_notification_subject,
1611 1.1 christos &observer_test_notification_notification_stub,
1612 1.1 christos (void *) f);
1613 1.1 christos }
1614 1.1 christos
1615 1.1 christos void
1616 1.1 christos observer_detach_test_notification (struct observer *observer)
1617 1.1 christos {
1618 1.1 christos generic_observer_detach (&test_notification_subject, observer);
1619 1.1 christos }
1620 1.1 christos
1621 1.1 christos void
1622 1.1 christos observer_notify_test_notification (int somearg)
1623 1.1 christos {
1624 1.1 christos struct test_notification_args args;
1625 1.1 christos args.somearg = somearg;
1626 1.1 christos
1627 1.1 christos if (observer_debug)
1628 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_test_notification() called\n");
1629 1.1 christos generic_observer_notify (test_notification_subject, &args);
1630 1.1 christos }
1631