/* Remote File-I/O communications
- Copyright (C) 2003-2019 Free Software Foundation, Inc.
+ Copyright (C) 2003-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "defs.h"
#include "gdbcmd.h"
#include "remote.h"
-#include "common/gdb_wait.h"
+#include "gdbsupport/gdb_wait.h"
#include <sys/stat.h>
#include "remote-fileio.h"
#include "event-loop.h"
#include "target.h"
#include "filenames.h"
-#include "common/filestuff.h"
+#include "gdbsupport/filestuff.h"
#include <fcntl.h>
-#include "common/gdb_sys_time.h"
+#include "gdbsupport/gdb_sys_time.h"
#ifdef __CYGWIN__
#include <sys/cygwin.h> /* For cygwin_conv_path. */
#endif
limit this read to something smaller than that - by a
safe margin, in case the limit depends on system
resources or version. */
- ret = ui_file_read (gdb_stdtargin, (char *) buffer, 16383);
+ ret = gdb_stdtargin->read ((char *) buffer, 16383);
if (ret > 0 && (size_t)ret > length)
{
remaining_buf = (char *) xmalloc (ret - length);
xfree (buffer);
return;
case FIO_FD_CONSOLE_OUT:
- ui_file_write (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr,
- (char *) buffer, length);
- gdb_flush (target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr);
- ret = length;
+ {
+ ui_file *file = target_fd == 1 ? gdb_stdtarg : gdb_stdtargerr;
+ file->write ((char *) buffer, length);
+ file->flush ();
+ ret = length;
+ }
break;
default:
ret = write (fd, buffer, length);
}
}
- /* Check if system(3) has been explicitely allowed using the
+ /* Check if system(3) has been explicitly allowed using the
`set remote system-call-allowed 1' command. If length is 0,
indicating a NULL parameter to the system call, return zero to
indicate a shell is not available. Otherwise fail with EPERM. */
}
else
{
- TRY
+ try
{
do_remote_fileio_request (remote, buf);
}
- CATCH (ex, RETURN_MASK_ALL)
+ catch (const gdb_exception &ex)
{
if (ex.reason == RETURN_QUIT)
remote_fileio_reply (remote, -1, FILEIO_EINTR);
else
remote_fileio_reply (remote, -1, FILEIO_EIO);
}
- END_CATCH
}
quit_handler = remote_fileio_o_quit_handler;