]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/gdb-events.h
2004-04-29 Andrew Cagney <cagney@redhat.com>
[thirdparty/binutils-gdb.git] / gdb / gdb-events.h
1 /* User Interface Events.
2
3 Copyright 1999, 2001, 2002, 2004 Free Software Foundation, Inc.
4
5 Contributed by Cygnus Solutions.
6
7 This file is part of GDB.
8
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
13
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
22
23 /* Work in progress */
24
25 /* This file was created with the aid of ``gdb-events.sh''.
26
27 The bourn shell script ``gdb-events.sh'' creates the files
28 ``new-gdb-events.c'' and ``new-gdb-events.h and then compares
29 them against the existing ``gdb-events.[hc]''. Any differences
30 found being reported.
31
32 If editing this file, please also run gdb-events.sh and merge any
33 changes into that script. Conversely, when making sweeping changes
34 to this file, modifying gdb-events.sh and using its output may
35 prove easier. */
36
37
38 #ifndef GDB_EVENTS_H
39 #define GDB_EVENTS_H
40
41
42 /* COMPAT: pointer variables for old, unconverted events.
43 A call to set_gdb_events() will automatically update these. */
44
45
46
47 /* Type definition of all hook functions.
48 Recommended pratice is to first declare each hook function using
49 the below ftype and then define it. */
50
51 typedef void (gdb_events_breakpoint_create_ftype) (int b);
52 typedef void (gdb_events_breakpoint_delete_ftype) (int b);
53 typedef void (gdb_events_breakpoint_modify_ftype) (int b);
54 typedef void (gdb_events_tracepoint_create_ftype) (int number);
55 typedef void (gdb_events_tracepoint_delete_ftype) (int number);
56 typedef void (gdb_events_tracepoint_modify_ftype) (int number);
57 typedef void (gdb_events_architecture_changed_ftype) (void);
58 typedef void (gdb_events_target_changed_ftype) (void);
59 typedef void (gdb_events_selected_frame_level_changed_ftype) (int level);
60 typedef void (gdb_events_selected_thread_changed_ftype) (int thread_num);
61
62
63 /* gdb-events: object. */
64
65 struct gdb_events
66 {
67 gdb_events_breakpoint_create_ftype *breakpoint_create;
68 gdb_events_breakpoint_delete_ftype *breakpoint_delete;
69 gdb_events_breakpoint_modify_ftype *breakpoint_modify;
70 gdb_events_tracepoint_create_ftype *tracepoint_create;
71 gdb_events_tracepoint_delete_ftype *tracepoint_delete;
72 gdb_events_tracepoint_modify_ftype *tracepoint_modify;
73 gdb_events_architecture_changed_ftype *architecture_changed;
74 gdb_events_target_changed_ftype *target_changed;
75 gdb_events_selected_frame_level_changed_ftype *selected_frame_level_changed;
76 gdb_events_selected_thread_changed_ftype *selected_thread_changed;
77 };
78
79
80 /* Interface into events functions.
81 Where a *_p() predicate is present, it must be called before
82 calling the hook proper. */
83 extern void breakpoint_create_event (int b);
84 extern void breakpoint_delete_event (int b);
85 extern void breakpoint_modify_event (int b);
86 extern void tracepoint_create_event (int number);
87 extern void tracepoint_delete_event (int number);
88 extern void tracepoint_modify_event (int number);
89 extern void architecture_changed_event (void);
90 extern void target_changed_event (void);
91 extern void selected_frame_level_changed_event (int level);
92 extern void selected_thread_changed_event (int thread_num);
93
94 /* Install custom gdb-events hooks. */
95 extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
96
97 /* Deliver any pending events. */
98 extern void gdb_events_deliver (struct gdb_events *vector);
99
100 /* Clear event handlers */
101 extern void clear_gdb_event_hooks (void);
102
103 #endif