gas/
[deliverable/binutils-gdb.git] / gdb / gdb-events.h
CommitLineData
104c1213 1/* User Interface Events.
349c5d5f
AC
2
3 Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
104c1213
JM
4
5 Contributed by Cygnus Solutions.
6
afbfc876 7 This file is part of GDB.
104c1213 8
afbfc876
AC
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.
104c1213 13
afbfc876
AC
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.
104c1213 18
afbfc876
AC
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. */
104c1213
JM
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#ifndef WITH_GDB_EVENTS
42#define WITH_GDB_EVENTS 1
43#endif
44
45
46/* COMPAT: pointer variables for old, unconverted events.
47 A call to set_gdb_events() will automatically update these. */
48
49
50
51/* Type definition of all hook functions.
52 Recommended pratice is to first declare each hook function using
53 the below ftype and then define it. */
54
55typedef void (gdb_events_breakpoint_create_ftype) (int b);
56typedef void (gdb_events_breakpoint_delete_ftype) (int b);
57typedef void (gdb_events_breakpoint_modify_ftype) (int b);
ba9fe036
KS
58typedef void (gdb_events_tracepoint_create_ftype) (int number);
59typedef void (gdb_events_tracepoint_delete_ftype) (int number);
60typedef void (gdb_events_tracepoint_modify_ftype) (int number);
67c2c32c 61typedef void (gdb_events_architecture_changed_ftype) (void);
e23792cc 62typedef void (gdb_events_target_changed_ftype) (void);
55970da6 63typedef void (gdb_events_selected_frame_level_changed_ftype) (int level);
28ee05e9 64typedef void (gdb_events_selected_thread_changed_ftype) (int thread_num);
104c1213
JM
65
66
67/* gdb-events: object. */
68
69struct gdb_events
70 {
71 gdb_events_breakpoint_create_ftype *breakpoint_create;
72 gdb_events_breakpoint_delete_ftype *breakpoint_delete;
73 gdb_events_breakpoint_modify_ftype *breakpoint_modify;
ba9fe036
KS
74 gdb_events_tracepoint_create_ftype *tracepoint_create;
75 gdb_events_tracepoint_delete_ftype *tracepoint_delete;
76 gdb_events_tracepoint_modify_ftype *tracepoint_modify;
67c2c32c 77 gdb_events_architecture_changed_ftype *architecture_changed;
e23792cc 78 gdb_events_target_changed_ftype *target_changed;
55970da6 79 gdb_events_selected_frame_level_changed_ftype *selected_frame_level_changed;
28ee05e9 80 gdb_events_selected_thread_changed_ftype *selected_thread_changed;
104c1213
JM
81 };
82
83
84/* Interface into events functions.
c4093a6a
JM
85 Where a *_p() predicate is present, it must be called before
86 calling the hook proper. */
104c1213
JM
87extern void breakpoint_create_event (int b);
88extern void breakpoint_delete_event (int b);
89extern void breakpoint_modify_event (int b);
ba9fe036
KS
90extern void tracepoint_create_event (int number);
91extern void tracepoint_delete_event (int number);
92extern void tracepoint_modify_event (int number);
67c2c32c 93extern void architecture_changed_event (void);
e23792cc 94extern void target_changed_event (void);
55970da6 95extern void selected_frame_level_changed_event (int level);
28ee05e9 96extern void selected_thread_changed_event (int thread_num);
104c1213
JM
97
98
99/* When GDB_EVENTS are not being used, completly disable them. */
100
101#if !WITH_GDB_EVENTS
102#define breakpoint_create_event(b) 0
103#define breakpoint_delete_event(b) 0
104#define breakpoint_modify_event(b) 0
ba9fe036
KS
105#define tracepoint_create_event(number) 0
106#define tracepoint_delete_event(number) 0
107#define tracepoint_modify_event(number) 0
67c2c32c 108#define architecture_changed_event() 0
e23792cc 109#define target_changed_event() 0
55970da6 110#define selected_frame_level_changed_event(level) 0
28ee05e9 111#define selected_thread_changed_event(thread_num) 0
104c1213
JM
112#endif
113
114/* Install custom gdb-events hooks. */
ed9a39eb 115extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
104c1213
JM
116
117/* Deliver any pending events. */
118extern void gdb_events_deliver (struct gdb_events *vector);
119
63d022e0
KS
120/* Clear event handlers */
121extern void clear_gdb_event_hooks (void);
122
104c1213
JM
123#if !WITH_GDB_EVENTS
124#define set_gdb_events(x) 0
125#define set_gdb_event_hooks(x) 0
126#define gdb_events_deliver(x) 0
127#endif
128
129#endif
This page took 0.250424 seconds and 4 git commands to generate.