GDBserver
|
00001 /* Notification to GDB. 00002 Copyright (C) 1989-2013 Free Software Foundation, Inc. 00003 00004 This file is part of GDB. 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 3 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program. If not, see <http://www.gnu.org/licenses/>. */ 00018 00019 #include "ptid.h" 00020 #include "server.h" 00021 #include "target.h" 00022 #include "queue.h" 00023 00024 /* Structure holding information related to a single event. We 00025 keep a queue of these to push to GDB. It can be extended if 00026 the event of given notification contains more information. */ 00027 00028 typedef struct notif_event 00029 { 00030 /* C requires that a struct or union has at least one member. */ 00031 char dummy; 00032 } *notif_event_p; 00033 00034 DECLARE_QUEUE_P (notif_event_p); 00035 00036 /* A type notification to GDB. An object of 'struct notif_server' 00037 represents a type of notification. */ 00038 00039 typedef struct notif_server 00040 { 00041 /* The name of ack packet, for example, 'vStopped'. */ 00042 const char *ack_name; 00043 00044 /* The notification packet, for example, '%Stop'. Note that '%' is 00045 not in 'notif_name'. */ 00046 const char *notif_name; 00047 00048 /* A queue of events to GDB. A new notif_event can be enque'ed 00049 into QUEUE at any appropriate time, and the notif_reply is 00050 deque'ed only when the ack from GDB arrives. */ 00051 QUEUE (notif_event_p) *queue; 00052 00053 /* Write event EVENT to OWN_BUF. */ 00054 void (*write) (struct notif_event *event, char *own_buf); 00055 } *notif_server_p; 00056 00057 extern struct notif_server notif_stop; 00058 00059 int handle_notif_ack (char *own_buf, int packet_len); 00060 void notif_write_event (struct notif_server *notif, char *own_buf); 00061 00062 void notif_push (struct notif_server *np, struct notif_event *event); 00063 void notif_event_enque (struct notif_server *notif, 00064 struct notif_event *event); 00065 00066 void initialize_notif (void);