GDB (xrefs)
Defines | Functions | Variables
/home/stan/gdb/src/gdb/remote-fileio.c File Reference
#include "defs.h"
#include "gdb_string.h"
#include "gdbcmd.h"
#include "remote.h"
#include "gdb/fileio.h"
#include "gdb_wait.h"
#include "gdb_stat.h"
#include "exceptions.h"
#include "remote-fileio.h"
#include "event-loop.h"
#include "target.h"
#include "filenames.h"
#include "filestuff.h"
#include <fcntl.h>
#include <sys/time.h>
#include <signal.h>

Go to the source code of this file.

Defines

#define FIO_FD_INVALID   -1
#define FIO_FD_CONSOLE_IN   -2
#define FIO_FD_CONSOLE_OUT   -3

Functions

static int remote_fileio_init_fd_map (void)
static int remote_fileio_resize_fd_map (void)
static int remote_fileio_next_free_fd (void)
static int remote_fileio_fd_to_targetfd (int fd)
static int remote_fileio_map_fd (int target_fd)
static void remote_fileio_close_target_fd (int target_fd)
static int remote_fileio_oflags_to_host (long flags)
static mode_t remote_fileio_mode_to_host (long mode, int open_call)
static LONGEST remote_fileio_mode_to_target (mode_t mode)
static int remote_fileio_errno_to_target (int error)
static int remote_fileio_seek_flag_to_host (long num, int *flag)
static int remote_fileio_extract_long (char **buf, LONGEST *retlong)
static int remote_fileio_extract_int (char **buf, long *retint)
static int remote_fileio_extract_ptr_w_len (char **buf, CORE_ADDR *ptrval, int *length)
static void remote_fileio_to_be (LONGEST num, char *buf, int bytes)
static void remote_fileio_to_fio_uint (long num, fio_uint_t fnum)
static void remote_fileio_to_fio_mode (mode_t num, fio_mode_t fnum)
static void remote_fileio_to_fio_time (time_t num, fio_time_t fnum)
static void remote_fileio_to_fio_long (LONGEST num, fio_long_t fnum)
static void remote_fileio_to_fio_ulong (LONGEST num, fio_ulong_t fnum)
static void remote_fileio_to_fio_stat (struct stat *st, struct fio_stat *fst)
static void remote_fileio_to_fio_timeval (struct timeval *tv, struct fio_timeval *ftv)
static void remote_fileio_sig_init (void)
static void remote_fileio_sig_set (void(*sigint_func)(int))
static void remote_fileio_sig_exit (void)
static void async_remote_fileio_interrupt (gdb_client_data arg)
static void remote_fileio_ctrl_c_signal_handler (int signo)
static void remote_fileio_reply (int retcode, int error)
static void remote_fileio_ioerror (void)
static void remote_fileio_badfd (void)
static void remote_fileio_return_errno (int retcode)
static void remote_fileio_return_success (int retcode)
static void remote_fileio_func_open (char *buf)
static void remote_fileio_func_close (char *buf)
static void remote_fileio_func_read (char *buf)
static void remote_fileio_func_write (char *buf)
static void remote_fileio_func_lseek (char *buf)
static void remote_fileio_func_rename (char *buf)
static void remote_fileio_func_unlink (char *buf)
static void remote_fileio_func_stat (char *buf)
static void remote_fileio_func_fstat (char *buf)
static void remote_fileio_func_gettimeofday (char *buf)
static void remote_fileio_func_isatty (char *buf)
static void remote_fileio_func_system (char *buf)
static int do_remote_fileio_request (struct ui_out *uiout, void *buf_arg)
void remote_fileio_reset (void)
void remote_fileio_request (char *buf, int ctrlc_pending_p)
static void set_system_call_allowed (char *args, int from_tty)
static void show_system_call_allowed (char *args, int from_tty)
void initialize_remote_fileio (struct cmd_list_element *remote_set_cmdlist, struct cmd_list_element *remote_show_cmdlist)

Variables

struct {
   int *   fd_map
   int   fd_map_size
remote_fio_data
static int remote_fio_system_call_allowed = 0
static struct
async_signal_handler
sigint_fileio_token
static int remote_fio_ctrl_c_flag = 0
static int remote_fio_no_longjmp = 0
static void(* remote_fio_ofunc )(int)
struct {
   char *   name
   void(*   func )(char *)
remote_fio_func_map []

Define Documentation

#define FIO_FD_CONSOLE_IN   -2
#define FIO_FD_CONSOLE_OUT   -3
#define FIO_FD_INVALID   -1

Function Documentation

static void async_remote_fileio_interrupt ( gdb_client_data  arg) [static]

Definition at line 514 of file remote-fileio.c.

References quit().

Referenced by initialize_remote_fileio().

static int do_remote_fileio_request ( struct ui_out uiout,
void *  buf_arg 
) [static]
void initialize_remote_fileio ( struct cmd_list_element remote_set_cmdlist,
struct cmd_list_element remote_show_cmdlist 
)
static void remote_fileio_badfd ( void  ) [static]
static void remote_fileio_close_target_fd ( int  target_fd) [static]

Definition at line 120 of file remote-fileio.c.

References FIO_FD_INVALID, remote_fileio_init_fd_map(), and remote_fio_data.

Referenced by remote_fileio_func_close().

static void remote_fileio_ctrl_c_signal_handler ( int  signo) [static]
static int remote_fileio_errno_to_target ( int  error) [static]

Definition at line 242 of file remote-fileio.c.

Referenced by remote_fileio_return_errno().

static int remote_fileio_extract_int ( char **  buf,
long *  retint 
) [static]
static int remote_fileio_extract_long ( char **  buf,
LONGEST retlong 
) [static]
static int remote_fileio_extract_ptr_w_len ( char **  buf,
CORE_ADDR ptrval,
int length 
) [static]
static int remote_fileio_fd_to_targetfd ( int  fd) [static]

Definition at line 102 of file remote-fileio.c.

References remote_fileio_next_free_fd(), and remote_fio_data.

Referenced by remote_fileio_func_open().

static void remote_fileio_func_close ( char *  buf) [static]
static void remote_fileio_func_fstat ( char *  buf) [static]
static void remote_fileio_func_gettimeofday ( char *  buf) [static]
static void remote_fileio_func_isatty ( char *  buf) [static]
static void remote_fileio_func_lseek ( char *  buf) [static]
static void remote_fileio_func_open ( char *  buf) [static]
static void remote_fileio_func_read ( char *  buf) [static]
static void remote_fileio_func_rename ( char *  buf) [static]
static void remote_fileio_func_stat ( char *  buf) [static]
static void remote_fileio_func_system ( char *  buf) [static]
static void remote_fileio_func_unlink ( char *  buf) [static]
static void remote_fileio_func_write ( char *  buf) [static]
static int remote_fileio_init_fd_map ( void  ) [static]
static void remote_fileio_ioerror ( void  ) [static]
static int remote_fileio_map_fd ( int  target_fd) [static]
static mode_t remote_fileio_mode_to_host ( long  mode,
int  open_call 
) [static]

Definition at line 155 of file remote-fileio.c.

Referenced by remote_fileio_func_open().

static LONGEST remote_fileio_mode_to_target ( mode_t  mode) [static]

Definition at line 200 of file remote-fileio.c.

Referenced by remote_fileio_to_fio_mode().

static int remote_fileio_next_free_fd ( void  ) [static]
static int remote_fileio_oflags_to_host ( long  flags) [static]

Definition at line 128 of file remote-fileio.c.

Referenced by remote_fileio_func_open().

static void remote_fileio_reply ( int  retcode,
int  error 
) [static]
void remote_fileio_request ( char *  buf,
int  ctrlc_pending_p 
)
void remote_fileio_reset ( void  )

Definition at line 1375 of file remote-fileio.c.

References remote_fio_data, and xfree().

Referenced by extended_remote_restart(), and remote_open_1().

static int remote_fileio_resize_fd_map ( void  ) [static]
static void remote_fileio_return_errno ( int  retcode) [static]
static void remote_fileio_return_success ( int  retcode) [static]
static int remote_fileio_seek_flag_to_host ( long  num,
int flag 
) [static]

Definition at line 293 of file remote-fileio.c.

Referenced by remote_fileio_func_lseek().

static void remote_fileio_sig_exit ( void  ) [static]

Definition at line 504 of file remote-fileio.c.

References remote_fio_ofunc.

Referenced by remote_fileio_request().

static void remote_fileio_sig_init ( void  ) [static]

Definition at line 478 of file remote-fileio.c.

References remote_fio_ofunc.

Referenced by remote_fileio_request().

static void remote_fileio_sig_set ( void(*)(int sigint_func) [static]
static void remote_fileio_to_be ( LONGEST  num,
char *  buf,
int  bytes 
) [static]
static void remote_fileio_to_fio_long ( LONGEST  num,
fio_long_t  fnum 
) [static]

Definition at line 415 of file remote-fileio.c.

References remote_fileio_to_be().

Referenced by remote_fileio_to_fio_timeval().

static void remote_fileio_to_fio_mode ( mode_t  num,
fio_mode_t  fnum 
) [static]

Definition at line 403 of file remote-fileio.c.

References remote_fileio_mode_to_target(), and remote_fileio_to_be().

Referenced by remote_fileio_to_fio_stat().

static void remote_fileio_to_fio_stat ( struct stat *  st,
struct fio_stat *  fst 
) [static]
static void remote_fileio_to_fio_time ( time_t  num,
fio_time_t  fnum 
) [static]

Definition at line 409 of file remote-fileio.c.

References LONGEST, and remote_fileio_to_be().

Referenced by remote_fileio_to_fio_stat(), and remote_fileio_to_fio_timeval().

static void remote_fileio_to_fio_timeval ( struct timeval *  tv,
struct fio_timeval *  ftv 
) [static]
static void remote_fileio_to_fio_uint ( long  num,
fio_uint_t  fnum 
) [static]
static void remote_fileio_to_fio_ulong ( LONGEST  num,
fio_ulong_t  fnum 
) [static]

Definition at line 421 of file remote-fileio.c.

References remote_fileio_to_be().

Referenced by remote_fileio_to_fio_stat().

static void set_system_call_allowed ( char *  args,
int  from_tty 
) [static]

Definition at line 1439 of file remote-fileio.c.

References _, error(), and remote_fio_system_call_allowed.

Referenced by initialize_remote_fileio().

static void show_system_call_allowed ( char *  args,
int  from_tty 
) [static]

Definition at line 1456 of file remote-fileio.c.

References _, error(), printf_unfiltered(), and remote_fio_system_call_allowed.

Referenced by initialize_remote_fileio().


Variable Documentation

Definition at line 44 of file remote-fileio.c.

Definition at line 45 of file remote-fileio.c.

void(* func)(char *)
char* name

Definition at line 1331 of file remote-fileio.c.

struct { ... } remote_fio_data [static]
struct { ... } remote_fio_func_map[] [static]
int remote_fio_no_longjmp = 0 [static]
void(* remote_fio_ofunc)(int) [static]

Definition at line 474 of file remote-fileio.c.

Referenced by remote_fileio_sig_exit(), and remote_fileio_sig_init().

Definition at line 54 of file remote-fileio.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines