diff options
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 2a483f9..d1d11fb 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -12751,7 +12751,24 @@ remote_target::remote_hostio_open (inferior *inf, const char *filename, char *p = rs->buf.data (); int left = get_remote_packet_size () - 1; - if (warn_if_slow) + if (remote_hostio_set_filesystem (inf, remote_errno) != 0) + return -1; + + remote_buffer_add_string (&p, &left, "vFile:open:"); + + remote_buffer_add_bytes (&p, &left, (const gdb_byte *) filename, + strlen (filename)); + remote_buffer_add_string (&p, &left, ","); + + remote_buffer_add_int (&p, &left, flags); + remote_buffer_add_string (&p, &left, ","); + + remote_buffer_add_int (&p, &left, mode); + + int res = remote_hostio_send_command (p - rs->buf.data (), PACKET_vFile_open, + remote_errno, nullptr, nullptr); + + if (warn_if_slow && res != -1) { static int warning_issued = 0; @@ -12767,22 +12784,7 @@ remote_target::remote_hostio_open (inferior *inf, const char *filename, } } - if (remote_hostio_set_filesystem (inf, remote_errno) != 0) - return -1; - - remote_buffer_add_string (&p, &left, "vFile:open:"); - - remote_buffer_add_bytes (&p, &left, (const gdb_byte *) filename, - strlen (filename)); - remote_buffer_add_string (&p, &left, ","); - - remote_buffer_add_int (&p, &left, flags); - remote_buffer_add_string (&p, &left, ","); - - remote_buffer_add_int (&p, &left, mode); - - return remote_hostio_send_command (p - rs->buf.data (), PACKET_vFile_open, - remote_errno, NULL, NULL); + return res; } int |