aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-06-10 14:37:04 +0000
committerCorinna Vinschen <corinna@vinschen.de>2003-06-10 14:37:04 +0000
commit449092f6f48a61f9c31101983369577b578d5995 (patch)
tree7188e9eeeaefa5f1d1f3bfb58f291eec7386eeb3 /gdb/remote.c
parent430329a943352cb440b1075a1b753483985f74bf (diff)
downloadbinutils-449092f6f48a61f9c31101983369577b578d5995.zip
binutils-449092f6f48a61f9c31101983369577b578d5995.tar.gz
binutils-449092f6f48a61f9c31101983369577b578d5995.tar.bz2
* Makefile.in: Add dependencies for remote-fileio.o.
* remote-fileio.c: New file implementing the remote File-I/O protocol. * remote-fileio.h: New header file defining remote File-I/O interface. * remote.c (remote_write_bytes, remote_read_bytes): Remove static storage class. (remote_wait, remote_async_wait): Call remote_fileio_request() on 'F' packet. (_initialize_remote): Call initialize_remote_fileio(). * remote.h: Declare remote_write_bytes() and remote_read_bytes(). * Makefile.in (REMOTE_OBS): Add remote-fileio.o (SFILES): Add remote-fileio.c. Add dependencies for building remote-fileio.o. Add remote-fileio.h to dependencies for building remote.o. * defs.h: Declare gdb_stdin, gdb_stdtargerr and gdb_stdtargin. * main.c: New ui_file gdb_stdin, gdb_stdtargerr and gdb_stdtargin. (captured_main): Initialize new ui_files. * ui-file.c: Add read and fgets input functions. (ui_file_new): set ui_file_fputs and ui_file_read to null functions. (null_file_read): New function. (ui_file_read): New function. (set_ui_file_read): New function. (stdio_file_read): New function. * ui-file.h: New type ui_file_read_ftype. (set_ui_file_read): Declare. (ui_file_read): Declare.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index d14c6c2..d5a5cf6 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -55,6 +55,8 @@
#include "gdbcore.h" /* for exec_bfd */
+#include "remote-fileio.h"
+
/* Prototypes for local functions */
static void cleanup_sigint_signal_handler (void *dummy);
static void initialize_sigint_signal_handler (void);
@@ -67,10 +69,6 @@ void async_remote_interrupt_twice (gdb_client_data);
static void build_remote_gdbarch_data (void);
-static int remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len);
-
-static int remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len);
-
static void remote_files_info (struct target_ops *ignore);
static int remote_xfer_memory (CORE_ADDR memaddr, char *myaddr,
@@ -2953,6 +2951,9 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status)
case 'E': /* Error of some sort */
warning ("Remote failure reply: %s", buf);
continue;
+ case 'F': /* File-I/O request */
+ remote_fileio_request (buf);
+ continue;
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
@@ -3204,6 +3205,9 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status)
case 'E': /* Error of some sort */
warning ("Remote failure reply: %s", buf);
continue;
+ case 'F': /* File-I/O request */
+ remote_fileio_request (buf);
+ continue;
case 'T': /* Status with PC, SP, FP, ... */
{
int i;
@@ -3758,7 +3762,7 @@ check_binary_download (CORE_ADDR addr)
Returns number of bytes transferred, or 0 (setting errno) for
error. Only transfer a single packet. */
-static int
+int
remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
{
unsigned char *buf;
@@ -3902,7 +3906,7 @@ remote_write_bytes (CORE_ADDR memaddr, char *myaddr, int len)
caller and its callers caller ;-) already contains code for
handling partial reads. */
-static int
+int
remote_read_bytes (CORE_ADDR memaddr, char *myaddr, int len)
{
char *buf;
@@ -6276,4 +6280,7 @@ Set use of remote protocol `Z' packets",
set_remote_protocol_Z_packet_cmd,
show_remote_protocol_Z_packet_cmd,
&remote_set_cmdlist, &remote_show_cmdlist);
+
+ /* Eventually initialize fileio. See fileio.c */
+ initialize_remote_fileio (remote_set_cmdlist, remote_show_cmdlist);
}