]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/gdbserver/notif.h
gdb/gdbserver/
[thirdparty/binutils-gdb.git] / gdb / gdbserver / notif.h
CommitLineData
14a00470
YQ
1/* Notification to GDB.
2 Copyright (C) 1989, 1993-1995, 1997-2000, 2002-2012 Free Software
3 Foundation, Inc.
4
5 This file is part of GDB.
6
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 3 of the License, or
10 (at your option) any later version.
11
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.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "ptid.h"
21#include "server.h"
22#include "target.h"
23#include "queue.h"
24
25/* Structure holding information related to a single event. We
26 keep a queue of these to push to GDB. It can be extended if
27 the event of given notification contains more information. */
28
29typedef struct notif_event
30{
31} *notif_event_p;
32
33DECLARE_QUEUE_P (notif_event_p);
34
35/* A type notification to GDB. An object of 'struct notif_server'
36 represents a type of notification. */
37
38typedef struct notif_server
39{
40 /* The name of ack packet, for example, 'vStopped'. */
41 const char *ack_name;
42
43 /* The notification packet, for example, '%Stop'. Note that '%' is
44 not in 'notif_name'. */
45 const char *notif_name;
46
47 /* A queue of events to GDB. A new notif_event can be enque'ed
48 into QUEUE at any appropriate time, and the notif_reply is
49 deque'ed only when the ack from GDB arrives. */
50 QUEUE (notif_event_p) *queue;
51
52 /* Write event EVENT to OWN_BUF. */
53 void (*write) (struct notif_event *event, char *own_buf);
54} *notif_server_p;
55
56extern struct notif_server notif_stop;
57
58int handle_notif_ack (char *own_buf, int packet_len);
59void notif_write_event (struct notif_server *notif, char *own_buf);
60
61void notif_push (struct notif_server *np, struct notif_event *event);
62void notif_event_enque (struct notif_server *notif,
63 struct notif_event *event);
64
65void initialize_notif (void);