diff options
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 1c49cdf..6208a90 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -251,6 +251,7 @@ enum { PACKET_vFile_readlink, PACKET_vFile_fstat, PACKET_vFile_stat, + PACKET_vFile_lstat, PACKET_qXfer_auxv, PACKET_qXfer_features, PACKET_qXfer_exec_file, @@ -1023,8 +1024,8 @@ public: int fileio_fstat (int fd, struct stat *sb, fileio_error *target_errno) override; - int fileio_stat (struct inferior *inf, const char *filename, - struct stat *sb, fileio_error *target_errno) override; + int fileio_lstat (struct inferior *inf, const char *filename, + struct stat *sb, fileio_error *target_errno) override; int fileio_close (int fd, fileio_error *target_errno) override; @@ -13149,7 +13150,7 @@ remote_target::fileio_readlink (struct inferior *inf, const char *filename, return ret; } -/* Helper function to handle ::fileio_fstat and ::fileio_stat result +/* Helper function to handle ::fileio_fstat and ::fileio_lstat result processing. When this function is called the remote syscall has been performed and we know we didn't get an error back. @@ -13160,10 +13161,10 @@ remote_target::fileio_readlink (struct inferior *inf, const char *filename, data) is to be placed in ST. */ static int -fileio_process_fstat_and_stat_reply (const char *attachment, - int attachment_len, - int expected_len, - struct stat *st) +fileio_process_fstat_and_lstat_reply (const char *attachment, + int attachment_len, + int expected_len, + struct stat *st) { struct fio_stat fst; @@ -13225,15 +13226,15 @@ remote_target::fileio_fstat (int fd, struct stat *st, fileio_error *remote_errno return 0; } - return fileio_process_fstat_and_stat_reply (attachment, attachment_len, - ret, st); + return fileio_process_fstat_and_lstat_reply (attachment, attachment_len, + ret, st); } -/* Implementation of to_fileio_stat. */ +/* Implementation of to_fileio_lstat. */ int -remote_target::fileio_stat (struct inferior *inf, const char *filename, - struct stat *st, fileio_error *remote_errno) +remote_target::fileio_lstat (struct inferior *inf, const char *filename, + struct stat *st, fileio_error *remote_errno) { struct remote_state *rs = get_remote_state (); char *p = rs->buf.data (); @@ -13242,14 +13243,14 @@ remote_target::fileio_stat (struct inferior *inf, const char *filename, if (remote_hostio_set_filesystem (inf, remote_errno) != 0) return {}; - remote_buffer_add_string (&p, &left, "vFile:stat:"); + remote_buffer_add_string (&p, &left, "vFile:lstat:"); remote_buffer_add_bytes (&p, &left, (const gdb_byte *) filename, strlen (filename)); int attachment_len; const char *attachment; - int ret = remote_hostio_send_command (p - rs->buf.data (), PACKET_vFile_stat, + int ret = remote_hostio_send_command (p - rs->buf.data (), PACKET_vFile_lstat, remote_errno, &attachment, &attachment_len); @@ -13258,8 +13259,8 @@ remote_target::fileio_stat (struct inferior *inf, const char *filename, if (ret < 0) return ret; - return fileio_process_fstat_and_stat_reply (attachment, attachment_len, - ret, st); + return fileio_process_fstat_and_lstat_reply (attachment, attachment_len, + ret, st); } /* Implementation of to_filesystem_is_local. */ @@ -16161,9 +16162,7 @@ test_packet_check_result () } /* namespace selftests */ #endif /* GDB_SELF_TEST */ -void _initialize_remote (); -void -_initialize_remote () +INIT_GDB_FILE (remote) { add_target (remote_target_info, remote_target::open); add_target (extended_remote_target_info, extended_remote_target::open); @@ -16422,6 +16421,8 @@ Show the maximum size of the address (in bits) in a memory packet."), NULL, add_packet_config_cmd (PACKET_vFile_stat, "vFile:stat", "hostio-stat", 0); + add_packet_config_cmd (PACKET_vFile_lstat, "vFile:lstat", "hostio-lstat", 0); + add_packet_config_cmd (PACKET_vAttach, "vAttach", "attach", 0); add_packet_config_cmd (PACKET_vRun, "vRun", "run", 0); |