1 /* GDB Notifications to Observers.
3 Copyright 2004, 2005 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA.
24 This file was generated using observer.sh and observer.texi. */
27 /* normal_stop notifications. */
29 static struct observer_list *normal_stop_subject = NULL;
31 struct normal_stop_args { struct bpstats *bs; };
34 observer_normal_stop_notification_stub (const void *data, const void *args_data)
36 observer_normal_stop_ftype *notify = (observer_normal_stop_ftype *) data;
37 const struct normal_stop_args *args = args_data;
42 observer_attach_normal_stop (observer_normal_stop_ftype *f)
44 return generic_observer_attach (&normal_stop_subject,
45 &observer_normal_stop_notification_stub,
50 observer_detach_normal_stop (struct observer *observer)
52 generic_observer_detach (&normal_stop_subject, observer);
56 observer_notify_normal_stop (struct bpstats *bs)
58 struct normal_stop_args args;
61 fprintf_unfiltered (gdb_stdlog, "observer_notify_normal_stop() called\n");
62 generic_observer_notify (normal_stop_subject, &args);
65 /* target_changed notifications. */
67 static struct observer_list *target_changed_subject = NULL;
69 struct target_changed_args { struct target_ops *target; };
72 observer_target_changed_notification_stub (const void *data, const void *args_data)
74 observer_target_changed_ftype *notify = (observer_target_changed_ftype *) data;
75 const struct target_changed_args *args = args_data;
76 notify (args->target);
80 observer_attach_target_changed (observer_target_changed_ftype *f)
82 return generic_observer_attach (&target_changed_subject,
83 &observer_target_changed_notification_stub,
88 observer_detach_target_changed (struct observer *observer)
90 generic_observer_detach (&target_changed_subject, observer);
94 observer_notify_target_changed (struct target_ops *target)
96 struct target_changed_args args;
99 fprintf_unfiltered (gdb_stdlog, "observer_notify_target_changed() called\n");
100 generic_observer_notify (target_changed_subject, &args);
103 /* executable_changed notifications. */
105 static struct observer_list *executable_changed_subject = NULL;
107 struct executable_changed_args { void *unused_args; };
110 observer_executable_changed_notification_stub (const void *data, const void *args_data)
112 observer_executable_changed_ftype *notify = (observer_executable_changed_ftype *) data;
113 const struct executable_changed_args *args = args_data;
114 notify (args->unused_args);
118 observer_attach_executable_changed (observer_executable_changed_ftype *f)
120 return generic_observer_attach (&executable_changed_subject,
121 &observer_executable_changed_notification_stub,
126 observer_detach_executable_changed (struct observer *observer)
128 generic_observer_detach (&executable_changed_subject, observer);
132 observer_notify_executable_changed (void *unused_args)
134 struct executable_changed_args args;
135 args.unused_args = unused_args;
137 fprintf_unfiltered (gdb_stdlog, "observer_notify_executable_changed() called\n");
138 generic_observer_notify (executable_changed_subject, &args);
141 /* inferior_created notifications. */
143 static struct observer_list *inferior_created_subject = NULL;
145 struct inferior_created_args { struct target_ops *objfile; int from_tty; };
148 observer_inferior_created_notification_stub (const void *data, const void *args_data)
150 observer_inferior_created_ftype *notify = (observer_inferior_created_ftype *) data;
151 const struct inferior_created_args *args = args_data;
152 notify (args->objfile, args->from_tty);
156 observer_attach_inferior_created (observer_inferior_created_ftype *f)
158 return generic_observer_attach (&inferior_created_subject,
159 &observer_inferior_created_notification_stub,
164 observer_detach_inferior_created (struct observer *observer)
166 generic_observer_detach (&inferior_created_subject, observer);
170 observer_notify_inferior_created (struct target_ops *objfile, int from_tty)
172 struct inferior_created_args args;
173 args.objfile = objfile, args.from_tty = from_tty;
175 fprintf_unfiltered (gdb_stdlog, "observer_notify_inferior_created() called\n");
176 generic_observer_notify (inferior_created_subject, &args);
179 /* solib_loaded notifications. */
181 static struct observer_list *solib_loaded_subject = NULL;
183 struct solib_loaded_args { struct so_list *solib; };
186 observer_solib_loaded_notification_stub (const void *data, const void *args_data)
188 observer_solib_loaded_ftype *notify = (observer_solib_loaded_ftype *) data;
189 const struct solib_loaded_args *args = args_data;
190 notify (args->solib);
194 observer_attach_solib_loaded (observer_solib_loaded_ftype *f)
196 return generic_observer_attach (&solib_loaded_subject,
197 &observer_solib_loaded_notification_stub,
202 observer_detach_solib_loaded (struct observer *observer)
204 generic_observer_detach (&solib_loaded_subject, observer);
208 observer_notify_solib_loaded (struct so_list *solib)
210 struct solib_loaded_args args;
213 fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_loaded() called\n");
214 generic_observer_notify (solib_loaded_subject, &args);
217 /* solib_unloaded notifications. */
219 static struct observer_list *solib_unloaded_subject = NULL;
221 struct solib_unloaded_args { struct so_list *solib; };
224 observer_solib_unloaded_notification_stub (const void *data, const void *args_data)
226 observer_solib_unloaded_ftype *notify = (observer_solib_unloaded_ftype *) data;
227 const struct solib_unloaded_args *args = args_data;
228 notify (args->solib);
232 observer_attach_solib_unloaded (observer_solib_unloaded_ftype *f)
234 return generic_observer_attach (&solib_unloaded_subject,
235 &observer_solib_unloaded_notification_stub,
240 observer_detach_solib_unloaded (struct observer *observer)
242 generic_observer_detach (&solib_unloaded_subject, observer);
246 observer_notify_solib_unloaded (struct so_list *solib)
248 struct solib_unloaded_args args;
251 fprintf_unfiltered (gdb_stdlog, "observer_notify_solib_unloaded() called\n");
252 generic_observer_notify (solib_unloaded_subject, &args);