aboutsummaryrefslogtreecommitdiff
path: root/gdb/inf-child.c
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-06-10 14:28:43 +0100
committerGary Benson <gbenson@redhat.com>2015-06-10 14:28:43 +0100
commit12e2a5fdccfc6857c57d2e0a1c1e5fd136a94025 (patch)
treebd5208ebe3106237d7933b517bae5d1f1a19a46e /gdb/inf-child.c
parent9bc3a9760b22a6187fdce6abc3df8f0c1d483a21 (diff)
downloadgdb-12e2a5fdccfc6857c57d2e0a1c1e5fd136a94025.zip
gdb-12e2a5fdccfc6857c57d2e0a1c1e5fd136a94025.tar.gz
gdb-12e2a5fdccfc6857c57d2e0a1c1e5fd136a94025.tar.bz2
Comment and whitespace changes
Comments on the various implementations of target fileio functions duplicate information documented in target.h. This commit replaces the duplicated documentation with breadcrumbs, and inserts blank lines to separate comments from the functions they describe where necessary. gdb/ChangeLog: * inf-child.c (inf_child_fileio_open): Replace comment. (inf_child_fileio_pwrite): Likewise. (inf_child_fileio_pread): Likewise. (inf_child_fileio_fstat): Insert blank line before comment. (inf_child_fileio_close): Replace comment. (inf_child_fileio_unlink): Likewise. (inf_child_fileio_readlink): Likewise. * remote.c (remote_hostio_open): Likewise. (remote_hostio_pread): Likewise. (remote_hostio_pwrite): Likewise. (remote_hostio_close): Likewise. (remote_hostio_unlink): Likewise. (remote_hostio_readlink): Likewise. (remote_hostio_fstat): Likewise. (remote_filesystem_is_local): Likewise. * target.c (target_fileio_open): Likewise. (target_fileio_pwrite): Likewise. (target_fileio_pread): Likewise. (target_fileio_fstat): Insert blank line before comment. (target_fileio_close): Replace comment. (target_fileio_unlink): Likewise. (target_fileio_readlink): Likewise. (target_fileio_read_alloc): Likewise. (target_fileio_read_stralloc): Likewise.
Diffstat (limited to 'gdb/inf-child.c')
-rw-r--r--gdb/inf-child.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 013bf0c..92134de 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -204,9 +204,8 @@ inf_child_pid_to_exec_file (struct target_ops *self, int pid)
return NULL;
}
-/* Open FILENAME on the target, using FLAGS and MODE. Return a
- target file descriptor, or -1 if an error occurs (and set
- *TARGET_ERRNO). */
+/* Implementation of to_fileio_open. */
+
static int
inf_child_fileio_open (struct target_ops *self,
const char *filename, int flags, int mode,
@@ -230,9 +229,8 @@ inf_child_fileio_open (struct target_ops *self,
return fd;
}
-/* Write up to LEN bytes from WRITE_BUF to FD on the target.
- Return the number of bytes written, or -1 if an error occurs
- (and set *TARGET_ERRNO). */
+/* Implementation of to_fileio_pwrite. */
+
static int
inf_child_fileio_pwrite (struct target_ops *self,
int fd, const gdb_byte *write_buf, int len,
@@ -259,9 +257,8 @@ inf_child_fileio_pwrite (struct target_ops *self,
return ret;
}
-/* Read up to LEN bytes FD on the target into READ_BUF.
- Return the number of bytes read, or -1 if an error occurs
- (and set *TARGET_ERRNO). */
+/* Implementation of to_fileio_pread. */
+
static int
inf_child_fileio_pread (struct target_ops *self,
int fd, gdb_byte *read_buf, int len,
@@ -289,6 +286,7 @@ inf_child_fileio_pread (struct target_ops *self,
}
/* Implementation of to_fileio_fstat. */
+
static int
inf_child_fileio_fstat (struct target_ops *self, int fd,
struct stat *sb, int *target_errno)
@@ -302,8 +300,8 @@ inf_child_fileio_fstat (struct target_ops *self, int fd,
return ret;
}
-/* Close FD on the target. Return 0, or -1 if an error occurs
- (and set *TARGET_ERRNO). */
+/* Implementation of to_fileio_close. */
+
static int
inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
{
@@ -316,8 +314,8 @@ inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
return ret;
}
-/* Unlink FILENAME on the target. Return 0, or -1 if an error
- occurs (and set *TARGET_ERRNO). */
+/* Implementation of to_fileio_unlink. */
+
static int
inf_child_fileio_unlink (struct target_ops *self,
const char *filename, int *target_errno)
@@ -331,9 +329,8 @@ inf_child_fileio_unlink (struct target_ops *self,
return ret;
}
-/* Read value of symbolic link FILENAME on the target. Return a
- null-terminated string allocated via xmalloc, or NULL if an error
- occurs (and set *TARGET_ERRNO). */
+/* Implementation of to_fileio_readlink. */
+
static char *
inf_child_fileio_readlink (struct target_ops *self,
const char *filename, int *target_errno)