aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/target.h
diff options
context:
space:
mode:
authorGary Benson <gbenson@redhat.com>2015-06-10 14:28:44 +0100
committerGary Benson <gbenson@redhat.com>2015-06-10 14:28:44 +0100
commit14d2069a321cdd2b06f1982e6832c8c5661febf4 (patch)
tree2473ce366cec53612aa1b2ad559a5a1725039a35 /gdb/gdbserver/target.h
parent15a201c844e770d3c6edf174b9ef6596fbae7eb2 (diff)
downloadgdb-14d2069a321cdd2b06f1982e6832c8c5661febf4.zip
gdb-14d2069a321cdd2b06f1982e6832c8c5661febf4.tar.gz
gdb-14d2069a321cdd2b06f1982e6832c8c5661febf4.tar.bz2
Implement vFile:setfs in gdbserver
This commit implements the "vFile:setfs" packet in gdbserver. gdb/gdbserver/ChangeLog: * target.h (struct target_ops) <multifs_open>: New field. <multifs_unlink>: Likewise. <multifs_readlink>: Likewise. * linux-low.c (nat/linux-namespaces.h): New include. (linux_target_ops): Initialize the_target->multifs_open, the_target->multifs_unlink and the_target->multifs_readlink. * hostio.h (hostio_handle_new_gdb_connection): New declaration. * hostio.c (hostio_fs_pid): New static variable. (hostio_handle_new_gdb_connection): New function. (handle_setfs): Likewise. (handle_open): Use the_target->multifs_open as appropriate. (handle_unlink): Use the_target->multifs_unlink as appropriate. (handle_readlink): Use the_target->multifs_readlink as appropriate. (handle_vFile): Handle vFile:setfs packets. * server.c (handle_query): Call hostio_handle_new_gdb_connection after target_handle_new_gdb_connection.
Diffstat (limited to 'gdb/gdbserver/target.h')
-rw-r--r--gdb/gdbserver/target.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/gdbserver/target.h b/gdb/gdbserver/target.h
index e9c6be0..9a40867 100644
--- a/gdb/gdbserver/target.h
+++ b/gdb/gdbserver/target.h
@@ -415,6 +415,27 @@ struct target_ops
string should be copied into a buffer by the client if the string
will not be immediately used, or if it must persist. */
char *(*pid_to_exec_file) (int pid);
+
+ /* Multiple-filesystem-aware open. Like open(2), but operating in
+ the filesystem as it appears to process PID. Systems where all
+ processes share a common filesystem should set this to NULL.
+ If NULL, the caller should fall back to open(2). */
+ int (*multifs_open) (int pid, const char *filename,
+ int flags, mode_t mode);
+
+ /* Multiple-filesystem-aware unlink. Like unlink(2), but operates
+ in the filesystem as it appears to process PID. Systems where
+ all processes share a common filesystem should set this to NULL.
+ If NULL, the caller should fall back to unlink(2). */
+ int (*multifs_unlink) (int pid, const char *filename);
+
+ /* Multiple-filesystem-aware readlink. Like readlink(2), but
+ operating in the filesystem as it appears to process PID.
+ Systems where all processes share a common filesystem should
+ set this to NULL. If NULL, the caller should fall back to
+ readlink(2). */
+ ssize_t (*multifs_readlink) (int pid, const char *filename,
+ char *buf, size_t bufsiz);
};
extern struct target_ops *the_target;