diff options
author | Joern Rennecke <joern.rennecke@arc.com> | 2009-09-11 04:45:40 +0000 |
---|---|---|
committer | Joern Rennecke <joern.rennecke@arc.com> | 2009-09-11 04:45:40 +0000 |
commit | c0b9c0330ac498673282832d8714d013569ca986 (patch) | |
tree | 7524276d1d63cb4ab23038ae8361a0228325863a /gdb/target-fileio.h | |
parent | 139d19ee035d132be681a95ece3bbe230664ea9c (diff) | |
download | gdb-arc-insight_6_8-branch.tar.gz |
gdb/insight for ARCompact (from Richard Stuckey)arc-insight_6_8-branch
Diffstat (limited to 'gdb/target-fileio.h')
-rw-r--r-- | gdb/target-fileio.h | 53 |
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 |