1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
/* MSPDebug - debugging tool for MSP430 MCUs
* Copyright (C) 2009-2011 Daniel Beer
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef GDB_PROTO_H_
#define GDB_PROTO_H_
#define GDB_MAX_XFER 8192
#define GDB_BUF_SIZE (GDB_MAX_XFER * 2 + 64)
struct gdb_data {
int sock;
int error;
char xbuf[1024];
int head;
int tail;
char outbuf[GDB_BUF_SIZE];
int outlen;
};
void gdb_init(struct gdb_data *d, int sock);
void gdb_printf(struct gdb_data *data, const char *fmt, ...);
int gdb_send(struct gdb_data *data, const char *msg);
void gdb_packet_start(struct gdb_data *data);
void gdb_packet_end(struct gdb_data *data);
int gdb_peek(struct gdb_data *data, int timeout_ms);
int gdb_getc(struct gdb_data *data);
int gdb_flush_ack(struct gdb_data *data);
int gdb_read_packet(struct gdb_data *data, char *buf);
#endif
|