1 /* gdbserv-client.h -- Facilities for communicating with remote client
2 using GDB remote protocol.
4 Copyright 1998, 2000, 2002 Red Hat, Inc.
6 This file is part of RDA, the Red Hat Debug Agent (and library).
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.
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.
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.
23 Alternative licenses for RDA may be arranged by contacting Red Hat,
34 struct gdbserv_client {
36 /* Write LEN characters to the remote client. */
37 void (*write) (struct gdbserv *gdbserv, const unsigned char *ch,
41 void *gdbserv_client_data (struct gdbserv *gdbserv);
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
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
55 typedef struct gdbserv_target *(gdbserv_target_attach) (struct gdbserv *gdbserv,
58 struct gdbserv *gdbserv_fromclient_attach (struct gdbserv_client *gdbclient,
59 gdbserv_target_attach *to_target_attach,
60 void *target_attach_data);
63 /* Notify the server that the client has disconnected. */
65 void gdbserv_fromclient_detach (struct gdbserv *gdbserv);
69 /* The low level client code pumps packets/data into GDBSERV using the
72 /* Raw characters from the client<->server. */
74 void gdbserv_fromclient_data (struct gdbserv *gdbserv, const char *data,
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()). */
81 void gdbserv_fromclient_break (struct gdbserv *gdbserv);