observer.inc revision 1.1 1 1.1 christos /* This file is automatically generated. DO NOT EDIT! */
2 1.1 christos /* Generated from: NetBSD: mknative-gdb,v 1.4 2011/10/09 02:03:30 christos Exp */
3 1.1 christos /* Generated from: NetBSD: mknative.common,v 1.9 2007/02/05 18:26:01 apb Exp */
4 1.1 christos
5 1.1 christos /* GDB Notifications to Observers.
6 1.1 christos
7 1.1 christos Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011
8 1.1 christos Free Software Foundation, Inc.
9 1.1 christos
10 1.1 christos This file is part of GDB.
11 1.1 christos
12 1.1 christos This program is free software; you can redistribute it and/or modify
13 1.1 christos it under the terms of the GNU General Public License as published by
14 1.1 christos the Free Software Foundation; either version 3 of the License, or
15 1.1 christos (at your option) any later version.
16 1.1 christos
17 1.1 christos This program is distributed in the hope that it will be useful,
18 1.1 christos but WITHOUT ANY WARRANTY; without even the implied warranty of
19 1.1 christos MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 1.1 christos GNU General Public License for more details.
21 1.1 christos
22 1.1 christos You should have received a copy of the GNU General Public License
23 1.1 christos along with this program. If not, see <http://www.gnu.org/licenses/>.
24 1.1 christos
25 1.1 christos --
26 1.1 christos
27 1.1 christos This file was generated using observer.sh and observer.texi. */
28 1.1 christos
29 1.1 christos
30 1.1 christos /* normal_stop notifications. */
31 1.1 christos
32 1.1 christos static struct observer_list *normal_stop_subject = NULL;
33 1.1 christos
34 1.1 christos struct normal_stop_args { struct bpstats *bs; int print_frame; };
35 1.1 christos
36 1.1 christos static void
37 1.1 christos observer_normal_stop_notification_stub (const void *data, const void *args_data)
38 1.1 christos {
39 1.1 christos observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data;
40 1.1 christos const struct normal_stop_args *args = args_data;
41 1.1 christos notify (args->bs, args->print_frame);
42 1.1 christos }
43 1.1 christos
44 1.1 christos struct observer *
45 1.1 christos observer_attach_normal_stop (observer_normal_stop_ftype *f)
46 1.1 christos {
47 1.1 christos return generic_observer_attach (&normal_stop_subject,
48 1.1 christos &observer_normal_stop_notification_stub,
49 1.1 christos (void *) f);
50 1.1 christos }
51 1.1 christos
52 1.1 christos void
53 1.1 christos observer_detach_normal_stop (struct observer *observer)
54 1.1 christos {
55 1.1 christos generic_observer_detach (&normal_stop_subject, observer);
56 1.1 christos }
57 1.1 christos
58 1.1 christos void
59 1.1 christos observer_notify_normal_stop (struct bpstats *bs, int print_frame)
60 1.1 christos {
61 1.1 christos struct normal_stop_args args;
62 1.1 christos args.bs = bs, args.print_frame = print_frame;
63 1.1 christos
64 1.1 christos if (observer_debug)
65 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n");
66 1.1 christos generic_observer_notify (normal_stop_subject, &args);
67 1.1 christos }
68 1.1 christos
69 1.1 christos /* target_changed notifications. */
70 1.1 christos
71 1.1 christos static struct observer_list *target_changed_subject = NULL;
72 1.1 christos
73 1.1 christos struct target_changed_args { struct target_ops *target; };
74 1.1 christos
75 1.1 christos static void
76 1.1 christos observer_target_changed_notification_stub (const void *data, const void *args_data)
77 1.1 christos {
78 1.1 christos observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data;
79 1.1 christos const struct target_changed_args *args = args_data;
80 1.1 christos notify (args->target);
81 1.1 christos }
82 1.1 christos
83 1.1 christos struct observer *
84 1.1 christos observer_attach_target_changed (observer_target_changed_ftype *f)
85 1.1 christos {
86 1.1 christos return generic_observer_attach (&target_changed_subject,
87 1.1 christos &observer_target_changed_notification_stub,
88 1.1 christos (void *) f);
89 1.1 christos }
90 1.1 christos
91 1.1 christos void
92 1.1 christos observer_detach_target_changed (struct observer *observer)
93 1.1 christos {
94 1.1 christos generic_observer_detach (&target_changed_subject, observer);
95 1.1 christos }
96 1.1 christos
97 1.1 christos void
98 1.1 christos observer_notify_target_changed (struct target_ops *target)
99 1.1 christos {
100 1.1 christos struct target_changed_args args;
101 1.1 christos args.target = target;
102 1.1 christos
103 1.1 christos if (observer_debug)
104 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n");
105 1.1 christos generic_observer_notify (target_changed_subject, &args);
106 1.1 christos }
107 1.1 christos
108 1.1 christos /* executable_changed notifications. */
109 1.1 christos
110 1.1 christos static struct observer_list *executable_changed_subject = NULL;
111 1.1 christos
112 1.1 christos static void
113 1.1 christos observer_executable_changed_notification_stub (const void *data, const void *args_data)
114 1.1 christos {
115 1.1 christos observer_executable_changed_ftype *notify = (observer_executable_changed_ftype *) data;
116 1.1 christos const struct executable_changed_args *args = args_data;
117 1.1 christos notify ();
118 1.1 christos }
119 1.1 christos
120 1.1 christos struct observer *
121 1.1 christos observer_attach_executable_changed (observer_executable_changed_ftype *f)
122 1.1 christos {
123 1.1 christos return generic_observer_attach (&executable_changed_subject,
124 1.1 christos &observer_executable_changed_notification_stub,
125 1.1 christos (void *) f);
126 1.1 christos }
127 1.1 christos
128 1.1 christos void
129 1.1 christos observer_detach_executable_changed (struct observer *observer)
130 1.1 christos {
131 1.1 christos generic_observer_detach (&executable_changed_subject, observer);
132 1.1 christos }
133 1.1 christos
134 1.1 christos void
135 1.1 christos observer_notify_executable_changed (void)
136 1.1 christos {
137 1.1 christos char *args = NULL;
138 1.1 christos if (observer_debug)
139 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_executable_changed() called\n");
140 1.1 christos generic_observer_notify (executable_changed_subject, &args);
141 1.1 christos }
142 1.1 christos
143 1.1 christos /* inferior_created notifications. */
144 1.1 christos
145 1.1 christos static struct observer_list *inferior_created_subject = NULL;
146 1.1 christos
147 1.1 christos struct inferior_created_args { struct target_ops *objfile; int from_tty; };
148 1.1 christos
149 1.1 christos static void
150 1.1 christos observer_inferior_created_notification_stub (const void *data, const void *args_data)
151 1.1 christos {
152 1.1 christos observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data;
153 1.1 christos const struct inferior_created_args *args = args_data;
154 1.1 christos notify (args->objfile, args->from_tty);
155 1.1 christos }
156 1.1 christos
157 1.1 christos struct observer *
158 1.1 christos observer_attach_inferior_created (observer_inferior_created_ftype *f)
159 1.1 christos {
160 1.1 christos return generic_observer_attach (&inferior_created_subject,
161 1.1 christos &observer_inferior_created_notification_stub,
162 1.1 christos (void *) f);
163 1.1 christos }
164 1.1 christos
165 1.1 christos void
166 1.1 christos observer_detach_inferior_created (struct observer *observer)
167 1.1 christos {
168 1.1 christos generic_observer_detach (&inferior_created_subject, observer);
169 1.1 christos }
170 1.1 christos
171 1.1 christos void
172 1.1 christos observer_notify_inferior_created (struct target_ops *objfile, int from_tty)
173 1.1 christos {
174 1.1 christos struct inferior_created_args args;
175 1.1 christos args.objfile = objfile, args.from_tty = from_tty;
176 1.1 christos
177 1.1 christos if (observer_debug)
178 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n");
179 1.1 christos generic_observer_notify (inferior_created_subject, &args);
180 1.1 christos }
181 1.1 christos
182 1.1 christos /* solib_loaded notifications. */
183 1.1 christos
184 1.1 christos static struct observer_list *solib_loaded_subject = NULL;
185 1.1 christos
186 1.1 christos struct solib_loaded_args { struct so_list *solib; };
187 1.1 christos
188 1.1 christos static void
189 1.1 christos observer_solib_loaded_notification_stub (const void *data, const void *args_data)
190 1.1 christos {
191 1.1 christos observer_solib_loaded_ftype *notify = (observer_solib_loaded_ftype *) data;
192 1.1 christos const struct solib_loaded_args *args = args_data;
193 1.1 christos notify (args->solib);
194 1.1 christos }
195 1.1 christos
196 1.1 christos struct observer *
197 1.1 christos observer_attach_solib_loaded (observer_solib_loaded_ftype *f)
198 1.1 christos {
199 1.1 christos return generic_observer_attach (&solib_loaded_subject,
200 1.1 christos &observer_solib_loaded_notification_stub,
201 1.1 christos (void *) f);
202 1.1 christos }
203 1.1 christos
204 1.1 christos void
205 1.1 christos observer_detach_solib_loaded (struct observer *observer)
206 1.1 christos {
207 1.1 christos generic_observer_detach (&solib_loaded_subject, observer);
208 1.1 christos }
209 1.1 christos
210 1.1 christos void
211 1.1 christos observer_notify_solib_loaded (struct so_list *solib)
212 1.1 christos {
213 1.1 christos struct solib_loaded_args args;
214 1.1 christos args.solib = solib;
215 1.1 christos
216 1.1 christos if (observer_debug)
217 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_loaded() called\n");
218 1.1 christos generic_observer_notify (solib_loaded_subject, &args);
219 1.1 christos }
220 1.1 christos
221 1.1 christos /* solib_unloaded notifications. */
222 1.1 christos
223 1.1 christos static struct observer_list *solib_unloaded_subject = NULL;
224 1.1 christos
225 1.1 christos struct solib_unloaded_args { struct so_list *solib; };
226 1.1 christos
227 1.1 christos static void
228 1.1 christos observer_solib_unloaded_notification_stub (const void *data, const void *args_data)
229 1.1 christos {
230 1.1 christos observer_solib_unloaded_ftype *notify = (observer_solib_unloaded_ftype *) data;
231 1.1 christos const struct solib_unloaded_args *args = args_data;
232 1.1 christos notify (args->solib);
233 1.1 christos }
234 1.1 christos
235 1.1 christos struct observer *
236 1.1 christos observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f)
237 1.1 christos {
238 1.1 christos return generic_observer_attach (&solib_unloaded_subject,
239 1.1 christos &observer_solib_unloaded_notification_stub,
240 1.1 christos (void *) f);
241 1.1 christos }
242 1.1 christos
243 1.1 christos void
244 1.1 christos observer_detach_solib_unloaded (struct observer *observer)
245 1.1 christos {
246 1.1 christos generic_observer_detach (&solib_unloaded_subject, observer);
247 1.1 christos }
248 1.1 christos
249 1.1 christos void
250 1.1 christos observer_notify_solib_unloaded (struct so_list *solib)
251 1.1 christos {
252 1.1 christos struct solib_unloaded_args args;
253 1.1 christos args.solib = solib;
254 1.1 christos
255 1.1 christos if (observer_debug)
256 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_unloaded() called\n");
257 1.1 christos generic_observer_notify (solib_unloaded_subject, &args);
258 1.1 christos }
259 1.1 christos
260 1.1 christos /* new_objfile notifications. */
261 1.1 christos
262 1.1 christos static struct observer_list *new_objfile_subject = NULL;
263 1.1 christos
264 1.1 christos struct new_objfile_args { struct objfile *objfile; };
265 1.1 christos
266 1.1 christos static void
267 1.1 christos observer_new_objfile_notification_stub (const void *data, const void *args_data)
268 1.1 christos {
269 1.1 christos observer_new_objfile_ftype *notify = (observer_new_objfile_ftype *) data;
270 1.1 christos const struct new_objfile_args *args = args_data;
271 1.1 christos notify (args->objfile);
272 1.1 christos }
273 1.1 christos
274 1.1 christos struct observer *
275 1.1 christos observer_attach_new_objfile (observer_new_objfile_ftype *f)
276 1.1 christos {
277 1.1 christos return generic_observer_attach (&new_objfile_subject,
278 1.1 christos &observer_new_objfile_notification_stub,
279 1.1 christos (void *) f);
280 1.1 christos }
281 1.1 christos
282 1.1 christos void
283 1.1 christos observer_detach_new_objfile (struct observer *observer)
284 1.1 christos {
285 1.1 christos generic_observer_detach (&new_objfile_subject, observer);
286 1.1 christos }
287 1.1 christos
288 1.1 christos void
289 1.1 christos observer_notify_new_objfile (struct objfile *objfile)
290 1.1 christos {
291 1.1 christos struct new_objfile_args args;
292 1.1 christos args.objfile = objfile;
293 1.1 christos
294 1.1 christos if (observer_debug)
295 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_new_objfile() called\n");
296 1.1 christos generic_observer_notify (new_objfile_subject, &args);
297 1.1 christos }
298 1.1 christos
299 1.1 christos /* new_thread notifications. */
300 1.1 christos
301 1.1 christos static struct observer_list *new_thread_subject = NULL;
302 1.1 christos
303 1.1 christos struct new_thread_args { struct thread_info *t; };
304 1.1 christos
305 1.1 christos static void
306 1.1 christos observer_new_thread_notification_stub (const void *data, const void *args_data)
307 1.1 christos {
308 1.1 christos observer_new_thread_ftype *notify = (observer_new_thread_ftype *) data;
309 1.1 christos const struct new_thread_args *args = args_data;
310 1.1 christos notify (args->t);
311 1.1 christos }
312 1.1 christos
313 1.1 christos struct observer *
314 1.1 christos observer_attach_new_thread (observer_new_thread_ftype *f)
315 1.1 christos {
316 1.1 christos return generic_observer_attach (&new_thread_subject,
317 1.1 christos &observer_new_thread_notification_stub,
318 1.1 christos (void *) f);
319 1.1 christos }
320 1.1 christos
321 1.1 christos void
322 1.1 christos observer_detach_new_thread (struct observer *observer)
323 1.1 christos {
324 1.1 christos generic_observer_detach (&new_thread_subject, observer);
325 1.1 christos }
326 1.1 christos
327 1.1 christos void
328 1.1 christos observer_notify_new_thread (struct thread_info *t)
329 1.1 christos {
330 1.1 christos struct new_thread_args args;
331 1.1 christos args.t = t;
332 1.1 christos
333 1.1 christos if (observer_debug)
334 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_new_thread() called\n");
335 1.1 christos generic_observer_notify (new_thread_subject, &args);
336 1.1 christos }
337 1.1 christos
338 1.1 christos /* thread_exit notifications. */
339 1.1 christos
340 1.1 christos static struct observer_list *thread_exit_subject = NULL;
341 1.1 christos
342 1.1 christos struct thread_exit_args { struct thread_info *t; int silent; };
343 1.1 christos
344 1.1 christos static void
345 1.1 christos observer_thread_exit_notification_stub (const void *data, const void *args_data)
346 1.1 christos {
347 1.1 christos observer_thread_exit_ftype *notify = (observer_thread_exit_ftype *) data;
348 1.1 christos const struct thread_exit_args *args = args_data;
349 1.1 christos notify (args->t, args->silent);
350 1.1 christos }
351 1.1 christos
352 1.1 christos struct observer *
353 1.1 christos observer_attach_thread_exit (observer_thread_exit_ftype *f)
354 1.1 christos {
355 1.1 christos return generic_observer_attach (&thread_exit_subject,
356 1.1 christos &observer_thread_exit_notification_stub,
357 1.1 christos (void *) f);
358 1.1 christos }
359 1.1 christos
360 1.1 christos void
361 1.1 christos observer_detach_thread_exit (struct observer *observer)
362 1.1 christos {
363 1.1 christos generic_observer_detach (&thread_exit_subject, observer);
364 1.1 christos }
365 1.1 christos
366 1.1 christos void
367 1.1 christos observer_notify_thread_exit (struct thread_info *t, int silent)
368 1.1 christos {
369 1.1 christos struct thread_exit_args args;
370 1.1 christos args.t = t, args.silent = silent;
371 1.1 christos
372 1.1 christos if (observer_debug)
373 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_exit() called\n");
374 1.1 christos generic_observer_notify (thread_exit_subject, &args);
375 1.1 christos }
376 1.1 christos
377 1.1 christos /* thread_stop_requested notifications. */
378 1.1 christos
379 1.1 christos static struct observer_list *thread_stop_requested_subject = NULL;
380 1.1 christos
381 1.1 christos struct thread_stop_requested_args { ptid_t ptid; };
382 1.1 christos
383 1.1 christos static void
384 1.1 christos observer_thread_stop_requested_notification_stub (const void *data, const void *args_data)
385 1.1 christos {
386 1.1 christos observer_thread_stop_requested_ftype *notify = (observer_thread_stop_requested_ftype *) data;
387 1.1 christos const struct thread_stop_requested_args *args = args_data;
388 1.1 christos notify (args->ptid);
389 1.1 christos }
390 1.1 christos
391 1.1 christos struct observer *
392 1.1 christos observer_attach_thread_stop_requested (observer_thread_stop_requested_ftype *f)
393 1.1 christos {
394 1.1 christos return generic_observer_attach (&thread_stop_requested_subject,
395 1.1 christos &observer_thread_stop_requested_notification_stub,
396 1.1 christos (void *) f);
397 1.1 christos }
398 1.1 christos
399 1.1 christos void
400 1.1 christos observer_detach_thread_stop_requested (struct observer *observer)
401 1.1 christos {
402 1.1 christos generic_observer_detach (&thread_stop_requested_subject, observer);
403 1.1 christos }
404 1.1 christos
405 1.1 christos void
406 1.1 christos observer_notify_thread_stop_requested (ptid_t ptid)
407 1.1 christos {
408 1.1 christos struct thread_stop_requested_args args;
409 1.1 christos args.ptid = ptid;
410 1.1 christos
411 1.1 christos if (observer_debug)
412 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_stop_requested() called\n");
413 1.1 christos generic_observer_notify (thread_stop_requested_subject, &args);
414 1.1 christos }
415 1.1 christos
416 1.1 christos /* target_resumed notifications. */
417 1.1 christos
418 1.1 christos static struct observer_list *target_resumed_subject = NULL;
419 1.1 christos
420 1.1 christos struct target_resumed_args { ptid_t ptid; };
421 1.1 christos
422 1.1 christos static void
423 1.1 christos observer_target_resumed_notification_stub (const void *data, const void *args_data)
424 1.1 christos {
425 1.1 christos observer_target_resumed_ftype *notify = (observer_target_resumed_ftype *) data;
426 1.1 christos const struct target_resumed_args *args = args_data;
427 1.1 christos notify (args->ptid);
428 1.1 christos }
429 1.1 christos
430 1.1 christos struct observer *
431 1.1 christos observer_attach_target_resumed (observer_target_resumed_ftype *f)
432 1.1 christos {
433 1.1 christos return generic_observer_attach (&target_resumed_subject,
434 1.1 christos &observer_target_resumed_notification_stub,
435 1.1 christos (void *) f);
436 1.1 christos }
437 1.1 christos
438 1.1 christos void
439 1.1 christos observer_detach_target_resumed (struct observer *observer)
440 1.1 christos {
441 1.1 christos generic_observer_detach (&target_resumed_subject, observer);
442 1.1 christos }
443 1.1 christos
444 1.1 christos void
445 1.1 christos observer_notify_target_resumed (ptid_t ptid)
446 1.1 christos {
447 1.1 christos struct target_resumed_args args;
448 1.1 christos args.ptid = ptid;
449 1.1 christos
450 1.1 christos if (observer_debug)
451 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_target_resumed() called\n");
452 1.1 christos generic_observer_notify (target_resumed_subject, &args);
453 1.1 christos }
454 1.1 christos
455 1.1 christos /* about_to_proceed notifications. */
456 1.1 christos
457 1.1 christos static struct observer_list *about_to_proceed_subject = NULL;
458 1.1 christos
459 1.1 christos static void
460 1.1 christos observer_about_to_proceed_notification_stub (const void *data, const void *args_data)
461 1.1 christos {
462 1.1 christos observer_about_to_proceed_ftype *notify = (observer_about_to_proceed_ftype *) data;
463 1.1 christos const struct about_to_proceed_args *args = args_data;
464 1.1 christos notify ();
465 1.1 christos }
466 1.1 christos
467 1.1 christos struct observer *
468 1.1 christos observer_attach_about_to_proceed (observer_about_to_proceed_ftype *f)
469 1.1 christos {
470 1.1 christos return generic_observer_attach (&about_to_proceed_subject,
471 1.1 christos &observer_about_to_proceed_notification_stub,
472 1.1 christos (void *) f);
473 1.1 christos }
474 1.1 christos
475 1.1 christos void
476 1.1 christos observer_detach_about_to_proceed (struct observer *observer)
477 1.1 christos {
478 1.1 christos generic_observer_detach (&about_to_proceed_subject, observer);
479 1.1 christos }
480 1.1 christos
481 1.1 christos void
482 1.1 christos observer_notify_about_to_proceed (void)
483 1.1 christos {
484 1.1 christos char *args = NULL;
485 1.1 christos if (observer_debug)
486 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_about_to_proceed() called\n");
487 1.1 christos generic_observer_notify (about_to_proceed_subject, &args);
488 1.1 christos }
489 1.1 christos
490 1.1 christos /* breakpoint_created notifications. */
491 1.1 christos
492 1.1 christos static struct observer_list *breakpoint_created_subject = NULL;
493 1.1 christos
494 1.1 christos struct breakpoint_created_args { int bpnum; };
495 1.1 christos
496 1.1 christos static void
497 1.1 christos observer_breakpoint_created_notification_stub (const void *data, const void *args_data)
498 1.1 christos {
499 1.1 christos observer_breakpoint_created_ftype *notify = (observer_breakpoint_created_ftype *) data;
500 1.1 christos const struct breakpoint_created_args *args = args_data;
501 1.1 christos notify (args->bpnum);
502 1.1 christos }
503 1.1 christos
504 1.1 christos struct observer *
505 1.1 christos observer_attach_breakpoint_created (observer_breakpoint_created_ftype *f)
506 1.1 christos {
507 1.1 christos return generic_observer_attach (&breakpoint_created_subject,
508 1.1 christos &observer_breakpoint_created_notification_stub,
509 1.1 christos (void *) f);
510 1.1 christos }
511 1.1 christos
512 1.1 christos void
513 1.1 christos observer_detach_breakpoint_created (struct observer *observer)
514 1.1 christos {
515 1.1 christos generic_observer_detach (&breakpoint_created_subject, observer);
516 1.1 christos }
517 1.1 christos
518 1.1 christos void
519 1.1 christos observer_notify_breakpoint_created (int bpnum)
520 1.1 christos {
521 1.1 christos struct breakpoint_created_args args;
522 1.1 christos args.bpnum = bpnum;
523 1.1 christos
524 1.1 christos if (observer_debug)
525 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_created() called\n");
526 1.1 christos generic_observer_notify (breakpoint_created_subject, &args);
527 1.1 christos }
528 1.1 christos
529 1.1 christos /* breakpoint_deleted notifications. */
530 1.1 christos
531 1.1 christos static struct observer_list *breakpoint_deleted_subject = NULL;
532 1.1 christos
533 1.1 christos struct breakpoint_deleted_args { int bpnum; };
534 1.1 christos
535 1.1 christos static void
536 1.1 christos observer_breakpoint_deleted_notification_stub (const void *data, const void *args_data)
537 1.1 christos {
538 1.1 christos observer_breakpoint_deleted_ftype *notify = (observer_breakpoint_deleted_ftype *) data;
539 1.1 christos const struct breakpoint_deleted_args *args = args_data;
540 1.1 christos notify (args->bpnum);
541 1.1 christos }
542 1.1 christos
543 1.1 christos struct observer *
544 1.1 christos observer_attach_breakpoint_deleted (observer_breakpoint_deleted_ftype *f)
545 1.1 christos {
546 1.1 christos return generic_observer_attach (&breakpoint_deleted_subject,
547 1.1 christos &observer_breakpoint_deleted_notification_stub,
548 1.1 christos (void *) f);
549 1.1 christos }
550 1.1 christos
551 1.1 christos void
552 1.1 christos observer_detach_breakpoint_deleted (struct observer *observer)
553 1.1 christos {
554 1.1 christos generic_observer_detach (&breakpoint_deleted_subject, observer);
555 1.1 christos }
556 1.1 christos
557 1.1 christos void
558 1.1 christos observer_notify_breakpoint_deleted (int bpnum)
559 1.1 christos {
560 1.1 christos struct breakpoint_deleted_args args;
561 1.1 christos args.bpnum = bpnum;
562 1.1 christos
563 1.1 christos if (observer_debug)
564 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_deleted() called\n");
565 1.1 christos generic_observer_notify (breakpoint_deleted_subject, &args);
566 1.1 christos }
567 1.1 christos
568 1.1 christos /* breakpoint_modified notifications. */
569 1.1 christos
570 1.1 christos static struct observer_list *breakpoint_modified_subject = NULL;
571 1.1 christos
572 1.1 christos struct breakpoint_modified_args { int bpnum; };
573 1.1 christos
574 1.1 christos static void
575 1.1 christos observer_breakpoint_modified_notification_stub (const void *data, const void *args_data)
576 1.1 christos {
577 1.1 christos observer_breakpoint_modified_ftype *notify = (observer_breakpoint_modified_ftype *) data;
578 1.1 christos const struct breakpoint_modified_args *args = args_data;
579 1.1 christos notify (args->bpnum);
580 1.1 christos }
581 1.1 christos
582 1.1 christos struct observer *
583 1.1 christos observer_attach_breakpoint_modified (observer_breakpoint_modified_ftype *f)
584 1.1 christos {
585 1.1 christos return generic_observer_attach (&breakpoint_modified_subject,
586 1.1 christos &observer_breakpoint_modified_notification_stub,
587 1.1 christos (void *) f);
588 1.1 christos }
589 1.1 christos
590 1.1 christos void
591 1.1 christos observer_detach_breakpoint_modified (struct observer *observer)
592 1.1 christos {
593 1.1 christos generic_observer_detach (&breakpoint_modified_subject, observer);
594 1.1 christos }
595 1.1 christos
596 1.1 christos void
597 1.1 christos observer_notify_breakpoint_modified (int bpnum)
598 1.1 christos {
599 1.1 christos struct breakpoint_modified_args args;
600 1.1 christos args.bpnum = bpnum;
601 1.1 christos
602 1.1 christos if (observer_debug)
603 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_breakpoint_modified() called\n");
604 1.1 christos generic_observer_notify (breakpoint_modified_subject, &args);
605 1.1 christos }
606 1.1 christos
607 1.1 christos /* tracepoint_created notifications. */
608 1.1 christos
609 1.1 christos static struct observer_list *tracepoint_created_subject = NULL;
610 1.1 christos
611 1.1 christos struct tracepoint_created_args { int tpnum; };
612 1.1 christos
613 1.1 christos static void
614 1.1 christos observer_tracepoint_created_notification_stub (const void *data, const void *args_data)
615 1.1 christos {
616 1.1 christos observer_tracepoint_created_ftype *notify = (observer_tracepoint_created_ftype *) data;
617 1.1 christos const struct tracepoint_created_args *args = args_data;
618 1.1 christos notify (args->tpnum);
619 1.1 christos }
620 1.1 christos
621 1.1 christos struct observer *
622 1.1 christos observer_attach_tracepoint_created (observer_tracepoint_created_ftype *f)
623 1.1 christos {
624 1.1 christos return generic_observer_attach (&tracepoint_created_subject,
625 1.1 christos &observer_tracepoint_created_notification_stub,
626 1.1 christos (void *) f);
627 1.1 christos }
628 1.1 christos
629 1.1 christos void
630 1.1 christos observer_detach_tracepoint_created (struct observer *observer)
631 1.1 christos {
632 1.1 christos generic_observer_detach (&tracepoint_created_subject, observer);
633 1.1 christos }
634 1.1 christos
635 1.1 christos void
636 1.1 christos observer_notify_tracepoint_created (int tpnum)
637 1.1 christos {
638 1.1 christos struct tracepoint_created_args args;
639 1.1 christos args.tpnum = tpnum;
640 1.1 christos
641 1.1 christos if (observer_debug)
642 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_tracepoint_created() called\n");
643 1.1 christos generic_observer_notify (tracepoint_created_subject, &args);
644 1.1 christos }
645 1.1 christos
646 1.1 christos /* tracepoint_deleted notifications. */
647 1.1 christos
648 1.1 christos static struct observer_list *tracepoint_deleted_subject = NULL;
649 1.1 christos
650 1.1 christos struct tracepoint_deleted_args { int tpnum; };
651 1.1 christos
652 1.1 christos static void
653 1.1 christos observer_tracepoint_deleted_notification_stub (const void *data, const void *args_data)
654 1.1 christos {
655 1.1 christos observer_tracepoint_deleted_ftype *notify = (observer_tracepoint_deleted_ftype *) data;
656 1.1 christos const struct tracepoint_deleted_args *args = args_data;
657 1.1 christos notify (args->tpnum);
658 1.1 christos }
659 1.1 christos
660 1.1 christos struct observer *
661 1.1 christos observer_attach_tracepoint_deleted (observer_tracepoint_deleted_ftype *f)
662 1.1 christos {
663 1.1 christos return generic_observer_attach (&tracepoint_deleted_subject,
664 1.1 christos &observer_tracepoint_deleted_notification_stub,
665 1.1 christos (void *) f);
666 1.1 christos }
667 1.1 christos
668 1.1 christos void
669 1.1 christos observer_detach_tracepoint_deleted (struct observer *observer)
670 1.1 christos {
671 1.1 christos generic_observer_detach (&tracepoint_deleted_subject, observer);
672 1.1 christos }
673 1.1 christos
674 1.1 christos void
675 1.1 christos observer_notify_tracepoint_deleted (int tpnum)
676 1.1 christos {
677 1.1 christos struct tracepoint_deleted_args args;
678 1.1 christos args.tpnum = tpnum;
679 1.1 christos
680 1.1 christos if (observer_debug)
681 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_tracepoint_deleted() called\n");
682 1.1 christos generic_observer_notify (tracepoint_deleted_subject, &args);
683 1.1 christos }
684 1.1 christos
685 1.1 christos /* tracepoint_modified notifications. */
686 1.1 christos
687 1.1 christos static struct observer_list *tracepoint_modified_subject = NULL;
688 1.1 christos
689 1.1 christos struct tracepoint_modified_args { int tpnum; };
690 1.1 christos
691 1.1 christos static void
692 1.1 christos observer_tracepoint_modified_notification_stub (const void *data, const void *args_data)
693 1.1 christos {
694 1.1 christos observer_tracepoint_modified_ftype *notify = (observer_tracepoint_modified_ftype *) data;
695 1.1 christos const struct tracepoint_modified_args *args = args_data;
696 1.1 christos notify (args->tpnum);
697 1.1 christos }
698 1.1 christos
699 1.1 christos struct observer *
700 1.1 christos observer_attach_tracepoint_modified (observer_tracepoint_modified_ftype *f)
701 1.1 christos {
702 1.1 christos return generic_observer_attach (&tracepoint_modified_subject,
703 1.1 christos &observer_tracepoint_modified_notification_stub,
704 1.1 christos (void *) f);
705 1.1 christos }
706 1.1 christos
707 1.1 christos void
708 1.1 christos observer_detach_tracepoint_modified (struct observer *observer)
709 1.1 christos {
710 1.1 christos generic_observer_detach (&tracepoint_modified_subject, observer);
711 1.1 christos }
712 1.1 christos
713 1.1 christos void
714 1.1 christos observer_notify_tracepoint_modified (int tpnum)
715 1.1 christos {
716 1.1 christos struct tracepoint_modified_args args;
717 1.1 christos args.tpnum = tpnum;
718 1.1 christos
719 1.1 christos if (observer_debug)
720 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_tracepoint_modified() called\n");
721 1.1 christos generic_observer_notify (tracepoint_modified_subject, &args);
722 1.1 christos }
723 1.1 christos
724 1.1 christos /* architecture_changed notifications. */
725 1.1 christos
726 1.1 christos static struct observer_list *architecture_changed_subject = NULL;
727 1.1 christos
728 1.1 christos struct architecture_changed_args { struct gdbarch *newarch; };
729 1.1 christos
730 1.1 christos static void
731 1.1 christos observer_architecture_changed_notification_stub (const void *data, const void *args_data)
732 1.1 christos {
733 1.1 christos observer_architecture_changed_ftype *notify = (observer_architecture_changed_ftype *) data;
734 1.1 christos const struct architecture_changed_args *args = args_data;
735 1.1 christos notify (args->newarch);
736 1.1 christos }
737 1.1 christos
738 1.1 christos struct observer *
739 1.1 christos observer_attach_architecture_changed (observer_architecture_changed_ftype *f)
740 1.1 christos {
741 1.1 christos return generic_observer_attach (&architecture_changed_subject,
742 1.1 christos &observer_architecture_changed_notification_stub,
743 1.1 christos (void *) f);
744 1.1 christos }
745 1.1 christos
746 1.1 christos void
747 1.1 christos observer_detach_architecture_changed (struct observer *observer)
748 1.1 christos {
749 1.1 christos generic_observer_detach (&architecture_changed_subject, observer);
750 1.1 christos }
751 1.1 christos
752 1.1 christos void
753 1.1 christos observer_notify_architecture_changed (struct gdbarch *newarch)
754 1.1 christos {
755 1.1 christos struct architecture_changed_args args;
756 1.1 christos args.newarch = newarch;
757 1.1 christos
758 1.1 christos if (observer_debug)
759 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_architecture_changed() called\n");
760 1.1 christos generic_observer_notify (architecture_changed_subject, &args);
761 1.1 christos }
762 1.1 christos
763 1.1 christos /* thread_ptid_changed notifications. */
764 1.1 christos
765 1.1 christos static struct observer_list *thread_ptid_changed_subject = NULL;
766 1.1 christos
767 1.1 christos struct thread_ptid_changed_args { ptid_t old_ptid; ptid_t new_ptid; };
768 1.1 christos
769 1.1 christos static void
770 1.1 christos observer_thread_ptid_changed_notification_stub (const void *data, const void *args_data)
771 1.1 christos {
772 1.1 christos observer_thread_ptid_changed_ftype *notify = (observer_thread_ptid_changed_ftype *) data;
773 1.1 christos const struct thread_ptid_changed_args *args = args_data;
774 1.1 christos notify (args->old_ptid, args->new_ptid);
775 1.1 christos }
776 1.1 christos
777 1.1 christos struct observer *
778 1.1 christos observer_attach_thread_ptid_changed (observer_thread_ptid_changed_ftype *f)
779 1.1 christos {
780 1.1 christos return generic_observer_attach (&thread_ptid_changed_subject,
781 1.1 christos &observer_thread_ptid_changed_notification_stub,
782 1.1 christos (void *) f);
783 1.1 christos }
784 1.1 christos
785 1.1 christos void
786 1.1 christos observer_detach_thread_ptid_changed (struct observer *observer)
787 1.1 christos {
788 1.1 christos generic_observer_detach (&thread_ptid_changed_subject, observer);
789 1.1 christos }
790 1.1 christos
791 1.1 christos void
792 1.1 christos observer_notify_thread_ptid_changed (ptid_t old_ptid, ptid_t new_ptid)
793 1.1 christos {
794 1.1 christos struct thread_ptid_changed_args args;
795 1.1 christos args.old_ptid = old_ptid, args.new_ptid = new_ptid;
796 1.1 christos
797 1.1 christos if (observer_debug)
798 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_thread_ptid_changed() called\n");
799 1.1 christos generic_observer_notify (thread_ptid_changed_subject, &args);
800 1.1 christos }
801 1.1 christos
802 1.1 christos /* inferior_added notifications. */
803 1.1 christos
804 1.1 christos static struct observer_list *inferior_added_subject = NULL;
805 1.1 christos
806 1.1 christos struct inferior_added_args { struct inferior *inf; };
807 1.1 christos
808 1.1 christos static void
809 1.1 christos observer_inferior_added_notification_stub (const void *data, const void *args_data)
810 1.1 christos {
811 1.1 christos observer_inferior_added_ftype *notify = (observer_inferior_added_ftype *) data;
812 1.1 christos const struct inferior_added_args *args = args_data;
813 1.1 christos notify (args->inf);
814 1.1 christos }
815 1.1 christos
816 1.1 christos struct observer *
817 1.1 christos observer_attach_inferior_added (observer_inferior_added_ftype *f)
818 1.1 christos {
819 1.1 christos return generic_observer_attach (&inferior_added_subject,
820 1.1 christos &observer_inferior_added_notification_stub,
821 1.1 christos (void *) f);
822 1.1 christos }
823 1.1 christos
824 1.1 christos void
825 1.1 christos observer_detach_inferior_added (struct observer *observer)
826 1.1 christos {
827 1.1 christos generic_observer_detach (&inferior_added_subject, observer);
828 1.1 christos }
829 1.1 christos
830 1.1 christos void
831 1.1 christos observer_notify_inferior_added (struct inferior *inf)
832 1.1 christos {
833 1.1 christos struct inferior_added_args args;
834 1.1 christos args.inf = inf;
835 1.1 christos
836 1.1 christos if (observer_debug)
837 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_added() called\n");
838 1.1 christos generic_observer_notify (inferior_added_subject, &args);
839 1.1 christos }
840 1.1 christos
841 1.1 christos /* inferior_appeared notifications. */
842 1.1 christos
843 1.1 christos static struct observer_list *inferior_appeared_subject = NULL;
844 1.1 christos
845 1.1 christos struct inferior_appeared_args { struct inferior *inf; };
846 1.1 christos
847 1.1 christos static void
848 1.1 christos observer_inferior_appeared_notification_stub (const void *data, const void *args_data)
849 1.1 christos {
850 1.1 christos observer_inferior_appeared_ftype *notify = (observer_inferior_appeared_ftype *) data;
851 1.1 christos const struct inferior_appeared_args *args = args_data;
852 1.1 christos notify (args->inf);
853 1.1 christos }
854 1.1 christos
855 1.1 christos struct observer *
856 1.1 christos observer_attach_inferior_appeared (observer_inferior_appeared_ftype *f)
857 1.1 christos {
858 1.1 christos return generic_observer_attach (&inferior_appeared_subject,
859 1.1 christos &observer_inferior_appeared_notification_stub,
860 1.1 christos (void *) f);
861 1.1 christos }
862 1.1 christos
863 1.1 christos void
864 1.1 christos observer_detach_inferior_appeared (struct observer *observer)
865 1.1 christos {
866 1.1 christos generic_observer_detach (&inferior_appeared_subject, observer);
867 1.1 christos }
868 1.1 christos
869 1.1 christos void
870 1.1 christos observer_notify_inferior_appeared (struct inferior *inf)
871 1.1 christos {
872 1.1 christos struct inferior_appeared_args args;
873 1.1 christos args.inf = inf;
874 1.1 christos
875 1.1 christos if (observer_debug)
876 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_appeared() called\n");
877 1.1 christos generic_observer_notify (inferior_appeared_subject, &args);
878 1.1 christos }
879 1.1 christos
880 1.1 christos /* inferior_exit notifications. */
881 1.1 christos
882 1.1 christos static struct observer_list *inferior_exit_subject = NULL;
883 1.1 christos
884 1.1 christos struct inferior_exit_args { struct inferior *inf; };
885 1.1 christos
886 1.1 christos static void
887 1.1 christos observer_inferior_exit_notification_stub (const void *data, const void *args_data)
888 1.1 christos {
889 1.1 christos observer_inferior_exit_ftype *notify = (observer_inferior_exit_ftype *) data;
890 1.1 christos const struct inferior_exit_args *args = args_data;
891 1.1 christos notify (args->inf);
892 1.1 christos }
893 1.1 christos
894 1.1 christos struct observer *
895 1.1 christos observer_attach_inferior_exit (observer_inferior_exit_ftype *f)
896 1.1 christos {
897 1.1 christos return generic_observer_attach (&inferior_exit_subject,
898 1.1 christos &observer_inferior_exit_notification_stub,
899 1.1 christos (void *) f);
900 1.1 christos }
901 1.1 christos
902 1.1 christos void
903 1.1 christos observer_detach_inferior_exit (struct observer *observer)
904 1.1 christos {
905 1.1 christos generic_observer_detach (&inferior_exit_subject, observer);
906 1.1 christos }
907 1.1 christos
908 1.1 christos void
909 1.1 christos observer_notify_inferior_exit (struct inferior *inf)
910 1.1 christos {
911 1.1 christos struct inferior_exit_args args;
912 1.1 christos args.inf = inf;
913 1.1 christos
914 1.1 christos if (observer_debug)
915 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_exit() called\n");
916 1.1 christos generic_observer_notify (inferior_exit_subject, &args);
917 1.1 christos }
918 1.1 christos
919 1.1 christos /* inferior_removed notifications. */
920 1.1 christos
921 1.1 christos static struct observer_list *inferior_removed_subject = NULL;
922 1.1 christos
923 1.1 christos struct inferior_removed_args { struct inferior *inf; };
924 1.1 christos
925 1.1 christos static void
926 1.1 christos observer_inferior_removed_notification_stub (const void *data, const void *args_data)
927 1.1 christos {
928 1.1 christos observer_inferior_removed_ftype *notify = (observer_inferior_removed_ftype *) data;
929 1.1 christos const struct inferior_removed_args *args = args_data;
930 1.1 christos notify (args->inf);
931 1.1 christos }
932 1.1 christos
933 1.1 christos struct observer *
934 1.1 christos observer_attach_inferior_removed (observer_inferior_removed_ftype *f)
935 1.1 christos {
936 1.1 christos return generic_observer_attach (&inferior_removed_subject,
937 1.1 christos &observer_inferior_removed_notification_stub,
938 1.1 christos (void *) f);
939 1.1 christos }
940 1.1 christos
941 1.1 christos void
942 1.1 christos observer_detach_inferior_removed (struct observer *observer)
943 1.1 christos {
944 1.1 christos generic_observer_detach (&inferior_removed_subject, observer);
945 1.1 christos }
946 1.1 christos
947 1.1 christos void
948 1.1 christos observer_notify_inferior_removed (struct inferior *inf)
949 1.1 christos {
950 1.1 christos struct inferior_removed_args args;
951 1.1 christos args.inf = inf;
952 1.1 christos
953 1.1 christos if (observer_debug)
954 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_removed() called\n");
955 1.1 christos generic_observer_notify (inferior_removed_subject, &args);
956 1.1 christos }
957 1.1 christos
958 1.1 christos /* memory_changed notifications. */
959 1.1 christos
960 1.1 christos static struct observer_list *memory_changed_subject = NULL;
961 1.1 christos
962 1.1 christos struct memory_changed_args { CORE_ADDR addr; int len; const bfd_byte *data; };
963 1.1 christos
964 1.1 christos static void
965 1.1 christos observer_memory_changed_notification_stub (const void *data, const void *args_data)
966 1.1 christos {
967 1.1 christos observer_memory_changed_ftype *notify = (observer_memory_changed_ftype *) data;
968 1.1 christos const struct memory_changed_args *args = args_data;
969 1.1 christos notify (args->addr, args->len, args->data);
970 1.1 christos }
971 1.1 christos
972 1.1 christos struct observer *
973 1.1 christos observer_attach_memory_changed (observer_memory_changed_ftype *f)
974 1.1 christos {
975 1.1 christos return generic_observer_attach (&memory_changed_subject,
976 1.1 christos &observer_memory_changed_notification_stub,
977 1.1 christos (void *) f);
978 1.1 christos }
979 1.1 christos
980 1.1 christos void
981 1.1 christos observer_detach_memory_changed (struct observer *observer)
982 1.1 christos {
983 1.1 christos generic_observer_detach (&memory_changed_subject, observer);
984 1.1 christos }
985 1.1 christos
986 1.1 christos void
987 1.1 christos observer_notify_memory_changed (CORE_ADDR addr, int len, const bfd_byte *data)
988 1.1 christos {
989 1.1 christos struct memory_changed_args args;
990 1.1 christos args.addr = addr, args.len = len, args.data = data;
991 1.1 christos
992 1.1 christos if (observer_debug)
993 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_memory_changed() called\n");
994 1.1 christos generic_observer_notify (memory_changed_subject, &args);
995 1.1 christos }
996 1.1 christos
997 1.1 christos /* test_notification notifications. */
998 1.1 christos
999 1.1 christos static struct observer_list *test_notification_subject = NULL;
1000 1.1 christos
1001 1.1 christos struct test_notification_args { int somearg; };
1002 1.1 christos
1003 1.1 christos static void
1004 1.1 christos observer_test_notification_notification_stub (const void *data, const void *args_data)
1005 1.1 christos {
1006 1.1 christos observer_test_notification_ftype *notify = (observer_test_notification_ftype *) data;
1007 1.1 christos const struct test_notification_args *args = args_data;
1008 1.1 christos notify (args->somearg);
1009 1.1 christos }
1010 1.1 christos
1011 1.1 christos struct observer *
1012 1.1 christos observer_attach_test_notification (observer_test_notification_ftype *f)
1013 1.1 christos {
1014 1.1 christos return generic_observer_attach (&test_notification_subject,
1015 1.1 christos &observer_test_notification_notification_stub,
1016 1.1 christos (void *) f);
1017 1.1 christos }
1018 1.1 christos
1019 1.1 christos void
1020 1.1 christos observer_detach_test_notification (struct observer *observer)
1021 1.1 christos {
1022 1.1 christos generic_observer_detach (&test_notification_subject, observer);
1023 1.1 christos }
1024 1.1 christos
1025 1.1 christos void
1026 1.1 christos observer_notify_test_notification (int somearg)
1027 1.1 christos {
1028 1.1 christos struct test_notification_args args;
1029 1.1 christos args.somearg = somearg;
1030 1.1 christos
1031 1.1 christos if (observer_debug)
1032 1.1 christos fprintf_unfiltered (gdb_stdlog, "observer_notify_test_notification() called\n");
1033 1.1 christos generic_observer_notify (test_notification_subject, &args);
1034 1.1 christos }
1035