summaryrefslogtreecommitdiff
path: root/gdb/target-fileio.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target-fileio.h')
-rw-r--r--gdb/target-fileio.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/gdb/target-fileio.h b/gdb/target-fileio.h
new file mode 100644
index 00000000000..46efd90428a
--- /dev/null
+++ b/gdb/target-fileio.h
@@ -0,0 +1,53 @@
+/* Target File-I/O communications
+
+ Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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 3 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, see <http://www.gnu.org/licenses/>. */
+
+
+#ifndef TARGET_FILEIO_H
+#define TARGET_FILEIO_H
+
+struct cmd_list_element;
+
+struct file_io_operations {
+ int (*read_bytes) (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
+ int (*write_bytes)(CORE_ADDR memaddr, gdb_byte *myaddr, int len);
+ void (*reply)(int retcode, int error);
+ void (*set_ctrl_c_signal_handler)(void);
+};
+
+
+#define ioerror() reply(-1, FILEIO_EIO)
+#define badfd() reply(-1, FILEIO_EBADF)
+#define return_errno(retcode) reply(retcode, ((retcode) < 0) ? target_fileio_errno_to_target (errno) : 0)
+#define return_success(retcode) reply(retcode, 0)
+
+
+/* Unified interface to target fileio */
+extern void target_fileio_request (char *buf, struct file_io_operations *operations);
+
+/* Cleanup any target fileio state. */
+extern void target_fileio_reset (void);
+
+extern void initialize_target_fileio (
+ struct cmd_list_element *set_cmdlist,
+ struct cmd_list_element *show_cmdlist);
+
+
+extern int target_fio_no_longjmp;
+
+#endif