From 01f9e8fab8e45337f0451f7edbd03cfe0381999a Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Thu, 22 Jun 2006 15:20:47 +0000 Subject: * remote-utils.c (remote_escape_output, remote_unescape_input): New. (putpkt_binary): Renamed from putpkt and adjusted for binary data. (putpkt): New wrapper for putpkt_binary. (readchar): Don't mask off the high bit. (decode_X_packet): New function. * server.c (main): Call putpkt_binary if a handler sets the packet length. Save the length of the incoming packet. Handle 'X'. * server.h (gdb_byte, remote_escape_output, decode_X_packet): New. --- gdb/gdbserver/server.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'gdb/gdbserver/server.h') diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index a659bbb..5147094 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -57,6 +57,9 @@ extern char *strerror (int); /* X3.159-1989 4.11.6.2 */ #endif #endif +/* A type used for binary buffers. */ +typedef unsigned char gdb_byte; + /* FIXME: This should probably be autoconf'd for. It's an integer type at least the size of a (void *). */ typedef long long CORE_ADDR; @@ -133,6 +136,7 @@ extern jmp_buf toplevel; extern int all_symbols_looked_up; int putpkt (char *buf); +int putpkt_binary (char *buf, int len); int getpkt (char *buf); void remote_open (char *name); void remote_close (void); @@ -152,9 +156,14 @@ void decode_m_packet (char *from, CORE_ADDR * mem_addr_ptr, unsigned int *len_ptr); void decode_M_packet (char *from, CORE_ADDR * mem_addr_ptr, unsigned int *len_ptr, unsigned char *to); +int decode_X_packet (char *from, int packet_len, CORE_ADDR * mem_addr_ptr, + unsigned int *len_ptr, unsigned char *to); int unhexify (char *bin, const char *hex, int count); int hexify (char *hex, const char *bin, int count); +int remote_escape_output (const gdb_byte *buffer, int len, + gdb_byte *out_buf, int *out_len, + int out_maxlen); int look_up_one_symbol (const char *name, CORE_ADDR *addrp); -- cgit v1.1