OSDN Git Service

Merge branch 'master' of git://github.com/monaka/binutils
[pf3gnuchains/pf3gnuchains3x.git] / sid / component / gdb / gdbserv-input.h
1 /*
2  * gdbserv-input.h -- part of GDB remote server.
3  *
4  * Copyright (C) 2000 Red Hat.
5  * This file is part of SID and is licensed under the GPL.
6  * See the file COPYING.SID for conditions for redistribution.
7  */
8
9
10 enum gdbinput_state {
11   /*  0 = looking for start of packet */
12   GDBINPUT_STATE_IDLE,
13   /*  1 = got start of packet, looking for # terminator */
14   GDBINPUT_STATE_TERM,
15   /*  2 = looking for first byte of checksum */
16   GDBINPUT_STATE_CRC1,
17   /*  3 = looking for second byte of checksum (indicating end of packet) */
18   GDBINPUT_STATE_CRC2,
19   /*  4 = ignoring everything while looking for an ack packet */
20   GDBINPUT_STATE_ACK,
21 };
22
23
24 struct gdbserv_input {
25   
26   /* The checksum calculated so far (sizeof >= 32 bits). */
27   unsigned long checksum;
28   /* The checksum we've received from the remote side (sizeof >= 32 bits). */
29   unsigned long xmitcsum;
30   /* Contents of the accumulated packet. */
31   unsigned char *buf;
32   unsigned long sizeof_buf;
33   /* Number of characters received. */
34   unsigned len;
35   /* Number of characters retrieved */
36   unsigned out;
37   /* what we are doing */
38   enum gdbinput_state state;
39
40 };
41
42 void gdbserv_input_attach (struct gdbserv *gdbserv);
43 void gdbserv_input_detach (struct gdbserv *gdbserv);
44 void gdbserv_input_data_packet (struct gdbserv *gdbserv, const char *buf, int len);
45 void gdbserv_input_wait_for_ack (struct gdbserv *gdbserv);
46