1999-08-31 03:14:27 +02:00
|
|
|
/* User Interface Events.
|
2002-03-19 03:51:09 +01:00
|
|
|
|
|
|
|
Copyright 1999, 2001, 2002 Free Software Foundation, Inc.
|
1999-08-31 03:14:27 +02:00
|
|
|
|
|
|
|
Contributed by Cygnus Solutions.
|
|
|
|
|
2000-04-03 06:43:26 +02:00
|
|
|
This file is part of GDB.
|
1999-08-31 03:14:27 +02:00
|
|
|
|
2000-04-03 06:43:26 +02:00
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
1999-08-31 03:14:27 +02:00
|
|
|
|
2000-04-03 06:43:26 +02:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
1999-08-31 03:14:27 +02:00
|
|
|
|
2000-04-03 06:43:26 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
1999-08-31 03:14:27 +02:00
|
|
|
|
|
|
|
/* Work in progress */
|
|
|
|
|
|
|
|
/* This file was created with the aid of ``gdb-events.sh''.
|
|
|
|
|
|
|
|
The bourn shell script ``gdb-events.sh'' creates the files
|
|
|
|
``new-gdb-events.c'' and ``new-gdb-events.h and then compares
|
|
|
|
them against the existing ``gdb-events.[hc]''. Any differences
|
|
|
|
found being reported.
|
|
|
|
|
|
|
|
If editing this file, please also run gdb-events.sh and merge any
|
|
|
|
changes into that script. Conversely, when making sweeping changes
|
|
|
|
to this file, modifying gdb-events.sh and using its output may
|
|
|
|
prove easier. */
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef GDB_EVENTS_H
|
|
|
|
#define GDB_EVENTS_H
|
|
|
|
|
|
|
|
#ifndef WITH_GDB_EVENTS
|
|
|
|
#define WITH_GDB_EVENTS 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/* COMPAT: pointer variables for old, unconverted events.
|
|
|
|
A call to set_gdb_events() will automatically update these. */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Type definition of all hook functions.
|
|
|
|
Recommended pratice is to first declare each hook function using
|
|
|
|
the below ftype and then define it. */
|
|
|
|
|
|
|
|
typedef void (gdb_events_breakpoint_create_ftype) (int b);
|
|
|
|
typedef void (gdb_events_breakpoint_delete_ftype) (int b);
|
|
|
|
typedef void (gdb_events_breakpoint_modify_ftype) (int b);
|
2001-06-06 16:44:42 +02:00
|
|
|
typedef void (gdb_events_tracepoint_create_ftype) (int number);
|
|
|
|
typedef void (gdb_events_tracepoint_delete_ftype) (int number);
|
|
|
|
typedef void (gdb_events_tracepoint_modify_ftype) (int number);
|
2001-08-11 02:41:02 +02:00
|
|
|
typedef void (gdb_events_architecture_changed_ftype) (void);
|
2002-08-21 17:34:36 +02:00
|
|
|
typedef void (gdb_events_target_changed_ftype) (void);
|
2002-08-26 21:41:56 +02:00
|
|
|
typedef void (gdb_events_selected_frame_level_changed_ftype) (int level);
|
2002-09-30 22:06:53 +02:00
|
|
|
typedef void (gdb_events_selected_thread_changed_ftype) (int thread_num);
|
1999-08-31 03:14:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* gdb-events: object. */
|
|
|
|
|
|
|
|
struct gdb_events
|
|
|
|
{
|
|
|
|
gdb_events_breakpoint_create_ftype *breakpoint_create;
|
|
|
|
gdb_events_breakpoint_delete_ftype *breakpoint_delete;
|
|
|
|
gdb_events_breakpoint_modify_ftype *breakpoint_modify;
|
2001-06-06 16:44:42 +02:00
|
|
|
gdb_events_tracepoint_create_ftype *tracepoint_create;
|
|
|
|
gdb_events_tracepoint_delete_ftype *tracepoint_delete;
|
|
|
|
gdb_events_tracepoint_modify_ftype *tracepoint_modify;
|
2001-08-11 02:41:02 +02:00
|
|
|
gdb_events_architecture_changed_ftype *architecture_changed;
|
2002-08-21 17:34:36 +02:00
|
|
|
gdb_events_target_changed_ftype *target_changed;
|
2002-08-26 21:41:56 +02:00
|
|
|
gdb_events_selected_frame_level_changed_ftype *selected_frame_level_changed;
|
2002-09-30 22:06:53 +02:00
|
|
|
gdb_events_selected_thread_changed_ftype *selected_thread_changed;
|
1999-08-31 03:14:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Interface into events functions.
|
1999-12-14 02:06:04 +01:00
|
|
|
Where a *_p() predicate is present, it must be called before
|
|
|
|
calling the hook proper. */
|
1999-08-31 03:14:27 +02:00
|
|
|
extern void breakpoint_create_event (int b);
|
|
|
|
extern void breakpoint_delete_event (int b);
|
|
|
|
extern void breakpoint_modify_event (int b);
|
2001-06-06 16:44:42 +02:00
|
|
|
extern void tracepoint_create_event (int number);
|
|
|
|
extern void tracepoint_delete_event (int number);
|
|
|
|
extern void tracepoint_modify_event (int number);
|
2001-08-11 02:41:02 +02:00
|
|
|
extern void architecture_changed_event (void);
|
2002-08-21 17:34:36 +02:00
|
|
|
extern void target_changed_event (void);
|
2002-08-26 21:41:56 +02:00
|
|
|
extern void selected_frame_level_changed_event (int level);
|
2002-09-30 22:06:53 +02:00
|
|
|
extern void selected_thread_changed_event (int thread_num);
|
1999-08-31 03:14:27 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* When GDB_EVENTS are not being used, completly disable them. */
|
|
|
|
|
|
|
|
#if !WITH_GDB_EVENTS
|
|
|
|
#define breakpoint_create_event(b) 0
|
|
|
|
#define breakpoint_delete_event(b) 0
|
|
|
|
#define breakpoint_modify_event(b) 0
|
2001-06-06 16:44:42 +02:00
|
|
|
#define tracepoint_create_event(number) 0
|
|
|
|
#define tracepoint_delete_event(number) 0
|
|
|
|
#define tracepoint_modify_event(number) 0
|
2001-08-11 02:41:02 +02:00
|
|
|
#define architecture_changed_event() 0
|
2002-08-21 17:34:36 +02:00
|
|
|
#define target_changed_event() 0
|
2002-08-26 21:41:56 +02:00
|
|
|
#define selected_frame_level_changed_event(level) 0
|
2002-09-30 22:06:53 +02:00
|
|
|
#define selected_thread_changed_event(thread_num) 0
|
1999-08-31 03:14:27 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Install custom gdb-events hooks. */
|
1999-12-22 22:45:38 +01:00
|
|
|
extern struct gdb_events *set_gdb_event_hooks (struct gdb_events *vector);
|
1999-08-31 03:14:27 +02:00
|
|
|
|
|
|
|
/* Deliver any pending events. */
|
|
|
|
extern void gdb_events_deliver (struct gdb_events *vector);
|
|
|
|
|
2002-08-16 18:09:07 +02:00
|
|
|
/* Clear event handlers */
|
|
|
|
extern void clear_gdb_event_hooks (void);
|
|
|
|
|
1999-08-31 03:14:27 +02:00
|
|
|
#if !WITH_GDB_EVENTS
|
|
|
|
#define set_gdb_events(x) 0
|
|
|
|
#define set_gdb_event_hooks(x) 0
|
|
|
|
#define gdb_events_deliver(x) 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|