gdbserver: turn target ops 'multifs_{open, readlink, unlink}' into methods
[deliverable/binutils-gdb.git] / gdbserver / target.h
index d728646d274c5b6a221cb17efab22fa2ce1d8390..bf653a4d08a4547b8f8886996a015a393d61d1a4 100644 (file)
@@ -70,27 +70,6 @@ class process_target;
    shared code.  */
 struct process_stratum_target
 {
-  /* 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);
-
   /* Return the breakpoint kind for this target based on PC.  The PCPTR is
      adjusted to the real memory location in case a flag (e.g., the Thumb bit on
      ARM) was present in the PC.  */
@@ -501,6 +480,29 @@ public:
      string should be copied into a buffer by the client if the string
      will not be immediately used, or if it must persist.  */
   virtual char *pid_to_exec_file (int pid);
+
+  /* Return true if any of the multifs ops is supported.  */
+  virtual bool supports_multifs ();
+
+  /* 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 not override this.
+     The default behavior is to use open(2).  */
+  virtual 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 not override this.
+     The default behavior is to use unlink(2).  */
+  virtual 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
+     not override this.  The default behavior is to use readlink(2).  */
+  virtual ssize_t multifs_readlink (int pid, const char *filename,
+                                   char *buf, size_t bufsiz);
 };
 
 extern process_stratum_target *the_target;
This page took 0.027095 seconds and 4 git commands to generate.