OSDN Git Service

Merge branch 'master' of git://github.com/monaka/binutils
[pf3gnuchains/pf3gnuchains3x.git] / rda / include / gdbserv-client.h
1 /* gdbserv-client.h -- Facilities for communicating with remote client
2    using GDB remote protocol.
3
4    Copyright 1998, 2000, 2002 Red Hat, Inc.
5
6    This file is part of RDA, the Red Hat Debug Agent (and library).
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful,
14    but WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16    GNU General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place - Suite 330,
21    Boston, MA 02111-1307, USA.
22    
23    Alternative licenses for RDA may be arranged by contacting Red Hat,
24    Inc.  */
25
26 #ifdef __cplusplus
27 extern "C" {
28 #elif 0
29 }
30 #endif
31
32 struct gdbserv;
33
34 struct gdbserv_client {
35   void *data;
36   /* Write LEN characters to the remote client. */
37   void (*write) (struct gdbserv *gdbserv, const unsigned char *ch,
38                  unsigned len);
39 };
40
41 void *gdbserv_client_data (struct gdbserv *gdbserv);
42
43
44 /* This is a call into the target so that it to is notified of the
45    connecting client.  The target can reject the connection by
46    returning NULL */
47
48 /* Notify the server that the client has initiated a connection.
49    Returns a GDBSERV struct for the session (or null if the target
50    rejected the connect).  The server will, in turn, pass the request
51    onto the target.  The target can either reject the connection
52    (returning NULL) or accept the connection (returning a target
53    object). */
54
55 typedef struct gdbserv_target *(gdbserv_target_attach) (struct gdbserv *gdbserv,
56                                                         void *attatch_data);
57
58 struct gdbserv *gdbserv_fromclient_attach (struct gdbserv_client *gdbclient,
59                                            gdbserv_target_attach *to_target_attach,
60                                            void *target_attach_data);
61
62
63 /* Notify the server that the client has disconnected. */
64
65 void gdbserv_fromclient_detach (struct gdbserv *gdbserv);
66
67
68
69 /* The low level client code pumps packets/data into GDBSERV using the
70    following. */
71
72 /* Raw characters from the client<->server. */
73
74 void gdbserv_fromclient_data (struct gdbserv *gdbserv, const char *data,
75                               int sizeof_data);
76
77 /* The remote client has requested that the target ``break'' (halt).
78    Notify gdbserv of the request so that it can pass it through to the
79    target (using gdbserv_target->break_program()). */
80
81 void gdbserv_fromclient_break (struct gdbserv *gdbserv);
82
83 #ifdef __cplusplus
84 }
85 #endif