aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-05-21 15:39:37 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-07-18 13:24:20 +0100
commit08a115cc1c45cd74f0e8993d1487528547c84509 (patch)
treec98c7adf95c6a41df32adb018f470de73673e20f /gdb/target.h
parent3ca6c047a42ecf444cf08ce879ba52e5ba0a9e06 (diff)
downloadfsf-binutils-gdb-08a115cc1c45cd74f0e8993d1487528547c84509.zip
fsf-binutils-gdb-08a115cc1c45cd74f0e8993d1487528547c84509.tar.gz
fsf-binutils-gdb-08a115cc1c45cd74f0e8993d1487528547c84509.tar.bz2
gdb: add target_fileio_stat, but no implementations yet
In a later commit I want target_fileio_stat, that is a call that operates on a filename rather than an open file descriptor as target_fileio_fstat does. This commit adds the initial framework for target_fileio_stat, I've added the top level target function and the virtual target_ops methods in the target_ops base class. At this point no actual targets override target_ops::fileio_stat, so any attempts to call this function will return ENOSYS error code.
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index f1b97cf..dcf68a6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1011,6 +1011,14 @@ struct target_ops
*TARGET_ERRNO). */
virtual int fileio_fstat (int fd, struct stat *sb, fileio_error *target_errno);
+ /* Get information about the file FILENAME and put it in SB. Look for
+ FILENAME in the filesystem as seen by INF. If INF is NULL, use the
+ filesystem seen by the debugger (GDB or, for remote targets, the
+ remote stub). Return 0 on success, or -1 if an error occurs (and
+ set *TARGET_ERRNO). */
+ virtual int fileio_stat (struct inferior *inf, const char *filename,
+ struct stat *sb, fileio_error *target_errno);
+
/* Close FD on the target. Return 0, or -1 if an error occurs
(and set *TARGET_ERRNO). */
virtual int fileio_close (int fd, fileio_error *target_errno);
@@ -2220,6 +2228,14 @@ extern int target_fileio_pread (int fd, gdb_byte *read_buf, int len,
extern int target_fileio_fstat (int fd, struct stat *sb,
fileio_error *target_errno);
+/* Get information about the file at FILENAME on the target and put it in
+ SB. Look in the filesystem as seen by INF. If INF is NULL, use the
+ filesystem seen by the debugger (GDB or, for remote targets, the remote
+ stub). Return 0 on success, or -1 if an error occurs (and set
+ *TARGET_ERRNO). */
+extern int target_fileio_stat (struct inferior *inf, const char *filename,
+ struct stat *sb, fileio_error *target_errno);
+
/* Close FD on the target. Return 0, or -1 if an error occurs
(and set *TARGET_ERRNO). */
extern int target_fileio_close (int fd, fileio_error *target_errno);