GDB (xrefs)
|
#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.
#define FIO_FD_CONSOLE_IN -2 |
Definition at line 49 of file remote-fileio.c.
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_read(), remote_fileio_func_write(), and remote_fileio_init_fd_map().
#define FIO_FD_CONSOLE_OUT -3 |
Definition at line 50 of file remote-fileio.c.
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_read(), remote_fileio_func_write(), and remote_fileio_init_fd_map().
#define FIO_FD_INVALID -1 |
Definition at line 48 of file remote-fileio.c.
Referenced by remote_fileio_close_target_fd(), remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_lseek(), remote_fileio_func_read(), remote_fileio_func_write(), remote_fileio_init_fd_map(), remote_fileio_map_fd(), remote_fileio_next_free_fd(), and remote_fileio_resize_fd_map().
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] |
Definition at line 1350 of file remote-fileio.c.
References name, remote_fileio_ctrl_c_signal_handler(), remote_fileio_sig_set(), remote_fio_func_map, RETURN_ERROR, and strchr().
Referenced by remote_fileio_request().
void initialize_remote_fileio | ( | struct cmd_list_element * | remote_set_cmdlist, |
struct cmd_list_element * | remote_show_cmdlist | ||
) |
Definition at line 1466 of file remote-fileio.c.
References _, add_cmd(), async_remote_fileio_interrupt(), create_async_signal_handler(), no_class, set_system_call_allowed(), and show_system_call_allowed().
static void remote_fileio_badfd | ( | void | ) | [static] |
Definition at line 566 of file remote-fileio.c.
References remote_fileio_reply().
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_lseek(), remote_fileio_func_read(), and remote_fileio_func_write().
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] |
Definition at line 520 of file remote-fileio.c.
References gdb_call_async_signal_handler(), remote_fileio_sig_set(), remote_fio_ctrl_c_flag, and remote_fio_no_longjmp.
Referenced by do_remote_fileio_request(), and remote_fileio_reply().
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] |
Definition at line 351 of file remote-fileio.c.
References gdb::printing::long, LONGEST, and remote_fileio_extract_long().
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_open(), remote_fileio_func_read(), and remote_fileio_func_write().
static int remote_fileio_extract_long | ( | char ** | buf, |
LONGEST * | retlong | ||
) | [static] |
Definition at line 315 of file remote-fileio.c.
References strchr().
Referenced by remote_fileio_extract_int(), remote_fileio_extract_ptr_w_len(), remote_fileio_func_fstat(), remote_fileio_func_gettimeofday(), remote_fileio_func_lseek(), remote_fileio_func_read(), remote_fileio_func_stat(), and remote_fileio_func_write().
static int remote_fileio_extract_ptr_w_len | ( | char ** | buf, |
CORE_ADDR * | ptrval, | ||
int * | length | ||
) | [static] |
Definition at line 365 of file remote-fileio.c.
References int, LONGEST, remote_fileio_extract_long(), and strchr().
Referenced by remote_fileio_func_open(), remote_fileio_func_rename(), remote_fileio_func_stat(), remote_fileio_func_system(), and remote_fileio_func_unlink().
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] |
Definition at line 655 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, FIO_FD_INVALID, remote_fileio_badfd(), remote_fileio_close_target_fd(), remote_fileio_extract_int(), remote_fileio_ioerror(), remote_fileio_map_fd(), remote_fileio_return_errno(), remote_fileio_return_success(), and remote_fio_no_longjmp.
static void remote_fileio_func_fstat | ( | char * | buf | ) | [static] |
Definition at line 1134 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, FIO_FD_INVALID, LONGEST, memset(), remote_fileio_badfd(), remote_fileio_extract_int(), remote_fileio_extract_long(), remote_fileio_ioerror(), remote_fileio_map_fd(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fileio_to_fio_stat(), remote_fileio_to_fio_uint(), remote_fio_no_longjmp, and target_write_memory().
static void remote_fileio_func_gettimeofday | ( | char * | buf | ) | [static] |
Definition at line 1212 of file remote-fileio.c.
References LONGEST, remote_fileio_extract_long(), remote_fileio_ioerror(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fileio_to_fio_timeval(), remote_fio_no_longjmp, and target_write_memory().
static void remote_fileio_func_isatty | ( | char * | buf | ) | [static] |
Definition at line 1264 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, remote_fileio_extract_int(), remote_fileio_ioerror(), remote_fileio_map_fd(), remote_fileio_return_success(), and remote_fio_no_longjmp.
static void remote_fileio_func_lseek | ( | char * | buf | ) | [static] |
Definition at line 884 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, FIO_FD_INVALID, LONGEST, offset, remote_fileio_badfd(), remote_fileio_extract_int(), remote_fileio_extract_long(), remote_fileio_ioerror(), remote_fileio_map_fd(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fileio_seek_flag_to_host(), and remote_fio_no_longjmp.
static void remote_fileio_func_open | ( | char * | buf | ) | [static] |
Definition at line 585 of file remote-fileio.c.
References flags, gdb_open_cloexec(), remote_fileio_extract_int(), remote_fileio_extract_ptr_w_len(), remote_fileio_fd_to_targetfd(), remote_fileio_ioerror(), remote_fileio_mode_to_host(), remote_fileio_oflags_to_host(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fio_no_longjmp, and target_read_memory().
static void remote_fileio_func_read | ( | char * | buf | ) | [static] |
Definition at line 681 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, FIO_FD_INVALID, gdb_stdtargin, LONGEST, memcpy(), memmove(), read(), remote_fileio_badfd(), remote_fileio_extract_int(), remote_fileio_extract_long(), remote_fileio_ioerror(), remote_fileio_map_fd(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fio_no_longjmp, target_write_memory(), ui_file_read(), xfree(), and xmalloc().
static void remote_fileio_func_rename | ( | char * | buf | ) | [static] |
Definition at line 938 of file remote-fileio.c.
References len, remote_fileio_extract_ptr_w_len(), remote_fileio_ioerror(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fio_no_longjmp, and target_read_memory().
static void remote_fileio_func_stat | ( | char * | buf | ) | [static] |
Definition at line 1072 of file remote-fileio.c.
References LONGEST, remote_fileio_extract_long(), remote_fileio_extract_ptr_w_len(), remote_fileio_ioerror(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fileio_to_fio_stat(), remote_fileio_to_fio_uint(), remote_fio_no_longjmp, target_read_memory(), and target_write_memory().
static void remote_fileio_func_system | ( | char * | buf | ) | [static] |
Definition at line 1282 of file remote-fileio.c.
References remote_fileio_extract_ptr_w_len(), remote_fileio_ioerror(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fio_no_longjmp, remote_fio_system_call_allowed, and target_read_memory().
static void remote_fileio_func_unlink | ( | char * | buf | ) | [static] |
Definition at line 1032 of file remote-fileio.c.
References remote_fileio_extract_ptr_w_len(), remote_fileio_ioerror(), remote_fileio_reply(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fio_no_longjmp, and target_read_memory().
static void remote_fileio_func_write | ( | char * | buf | ) | [static] |
Definition at line 810 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, FIO_FD_INVALID, gdb_flush(), gdb_stdtarg, gdb_stdtargerr, LONGEST, remote_fileio_badfd(), remote_fileio_extract_int(), remote_fileio_extract_long(), remote_fileio_ioerror(), remote_fileio_map_fd(), remote_fileio_return_errno(), remote_fileio_return_success(), remote_fio_no_longjmp, target_read_memory(), ui_file_write(), xfree(), and xmalloc().
static int remote_fileio_init_fd_map | ( | void | ) | [static] |
Definition at line 57 of file remote-fileio.c.
References FIO_FD_CONSOLE_IN, FIO_FD_CONSOLE_OUT, FIO_FD_INVALID, remote_fio_data, and xmalloc().
Referenced by remote_fileio_close_target_fd(), remote_fileio_map_fd(), and remote_fileio_resize_fd_map().
static void remote_fileio_ioerror | ( | void | ) | [static] |
Definition at line 560 of file remote-fileio.c.
References remote_fileio_reply().
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_gettimeofday(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_open(), remote_fileio_func_read(), remote_fileio_func_rename(), remote_fileio_func_stat(), remote_fileio_func_system(), remote_fileio_func_unlink(), and remote_fileio_func_write().
static int remote_fileio_map_fd | ( | int | target_fd | ) | [static] |
Definition at line 111 of file remote-fileio.c.
References FIO_FD_INVALID, remote_fileio_init_fd_map(), and remote_fio_data.
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_read(), and remote_fileio_func_write().
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] |
Definition at line 91 of file remote-fileio.c.
References FIO_FD_INVALID, remote_fileio_resize_fd_map(), and remote_fio_data.
Referenced by remote_fileio_fd_to_targetfd().
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] |
Definition at line 530 of file remote-fileio.c.
References error(), putpkt(), remote_fileio_ctrl_c_signal_handler(), remote_fileio_sig_set(), and remote_fio_ctrl_c_flag.
Referenced by remote_fileio_badfd(), remote_fileio_func_gettimeofday(), remote_fileio_func_lseek(), remote_fileio_func_open(), remote_fileio_func_rename(), remote_fileio_func_stat(), remote_fileio_func_system(), remote_fileio_func_unlink(), remote_fileio_ioerror(), remote_fileio_request(), remote_fileio_return_errno(), and remote_fileio_return_success().
void remote_fileio_request | ( | char * | buf, |
int | ctrlc_pending_p | ||
) |
Definition at line 1399 of file remote-fileio.c.
References catch_exceptions(), current_uiout, do_remote_fileio_request(), remote_fileio_reply(), remote_fileio_sig_exit(), remote_fileio_sig_init(), remote_fio_ctrl_c_flag, remote_fio_no_longjmp, RETURN_ERROR, RETURN_MASK_ALL, and RETURN_QUIT.
Referenced by remote_wait_as().
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] |
Definition at line 75 of file remote-fileio.c.
References FIO_FD_INVALID, remote_fileio_init_fd_map(), remote_fio_data, and xrealloc().
Referenced by remote_fileio_next_free_fd().
static void remote_fileio_return_errno | ( | int | retcode | ) | [static] |
Definition at line 572 of file remote-fileio.c.
References remote_fileio_errno_to_target(), and remote_fileio_reply().
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_gettimeofday(), remote_fileio_func_lseek(), remote_fileio_func_open(), remote_fileio_func_read(), remote_fileio_func_rename(), remote_fileio_func_stat(), remote_fileio_func_system(), remote_fileio_func_unlink(), and remote_fileio_func_write().
static void remote_fileio_return_success | ( | int | retcode | ) | [static] |
Definition at line 579 of file remote-fileio.c.
References remote_fileio_reply().
Referenced by remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_gettimeofday(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_open(), remote_fileio_func_read(), remote_fileio_func_rename(), remote_fileio_func_stat(), remote_fileio_func_system(), remote_fileio_func_unlink(), and remote_fileio_func_write().
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] |
Definition at line 491 of file remote-fileio.c.
Referenced by do_remote_fileio_request(), remote_fileio_ctrl_c_signal_handler(), and remote_fileio_reply().
static void remote_fileio_to_be | ( | LONGEST | num, |
char * | buf, | ||
int | bytes | ||
) | [static] |
Definition at line 388 of file remote-fileio.c.
Referenced by remote_fileio_to_fio_long(), remote_fileio_to_fio_mode(), remote_fileio_to_fio_time(), remote_fileio_to_fio_uint(), and remote_fileio_to_fio_ulong().
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] |
Definition at line 427 of file remote-fileio.c.
References LONGEST, remote_fileio_to_fio_mode(), remote_fileio_to_fio_time(), remote_fileio_to_fio_uint(), and remote_fileio_to_fio_ulong().
Referenced by remote_fileio_func_fstat(), and remote_fileio_func_stat().
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] |
Definition at line 461 of file remote-fileio.c.
References remote_fileio_to_fio_long(), and remote_fileio_to_fio_time().
Referenced by remote_fileio_func_gettimeofday().
static void remote_fileio_to_fio_uint | ( | long | num, |
fio_uint_t | fnum | ||
) | [static] |
Definition at line 397 of file remote-fileio.c.
References LONGEST, and remote_fileio_to_be().
Referenced by remote_fileio_func_fstat(), remote_fileio_func_stat(), and remote_fileio_to_fio_stat().
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().
Definition at line 44 of file remote-fileio.c.
Definition at line 45 of file remote-fileio.c.
void(* func)(char *) |
Definition at line 1332 of file remote-fileio.c.
Referenced by gdb::prompt::_prompt_object_attr(), aarch64_prologue_this_id(), add_dump_command(), alpha_heuristic_proc_start(), amd64obsd_trapframe_cache(), arm_prologue_this_id(), avr_frame_this_id(), catch_errors(), check_exception_resume(), cris_frame_this_id(), evpy_emit_event(), evregpy_connect(), evregpy_disconnect(), exec_set_find_memory_regions(), execute_code(), fbsd_find_memory_regions(), fdwalk(), find_frame_funname(), find_objc_msgsend(), find_solib_trampoline_target(), finish_command_continuation(), for_each_block(), frame_info(), frv_frame_this_id(), gdb_register_info(), gen_expr(), get_frame_name(), hppa_hpux_find_dummy_bpaddr(), i386obsd_trapframe_cache(), inline_frame_this_id(), iterate_over_mappings(), linux_find_memory_regions(), linux_find_memory_regions_full(), m32r_frame_this_id(), m68hc11_frame_this_id(), map_arg_registers(), microblaze_frame_cache(), parse_exp_in_context_1(), ppcfbsd_sigtramp_frame_cache(), ppcobsd_sigtramp_frame_cache(), ppu2spu_sniffer(), print_frame(), print_frame_arg_vars(), proc_iterate_over_threads(), pv_area_scan(), rs6000_frame_cache(), s390_prologue_frame_unwind_cache(), spu2ppu_sniffer(), tramp_frame_sniffer(), tramp_frame_start(), until_next_command(), and vaxobsd_sigtramp_frame_cache().
char* name |
Definition at line 1331 of file remote-fileio.c.
int remote_fio_ctrl_c_flag = 0 [static] |
Definition at line 467 of file remote-fileio.c.
Referenced by remote_fileio_ctrl_c_signal_handler(), remote_fileio_reply(), and remote_fileio_request().
struct { ... } remote_fio_data [static] |
struct { ... } remote_fio_func_map[] [static] |
Referenced by do_remote_fileio_request().
int remote_fio_no_longjmp = 0 [static] |
Definition at line 468 of file remote-fileio.c.
Referenced by remote_fileio_ctrl_c_signal_handler(), remote_fileio_func_close(), remote_fileio_func_fstat(), remote_fileio_func_gettimeofday(), remote_fileio_func_isatty(), remote_fileio_func_lseek(), remote_fileio_func_open(), remote_fileio_func_read(), remote_fileio_func_rename(), remote_fileio_func_stat(), remote_fileio_func_system(), remote_fileio_func_unlink(), remote_fileio_func_write(), and remote_fileio_request().
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().
int remote_fio_system_call_allowed = 0 [static] |
Definition at line 52 of file remote-fileio.c.
Referenced by remote_fileio_func_system(), set_system_call_allowed(), and show_system_call_allowed().
struct async_signal_handler* sigint_fileio_token [static] |
Definition at line 54 of file remote-fileio.c.