summaryrefslogtreecommitdiff
path: root/src/sim/process.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2006-11-22 15:45:32 -0500
committerGabe Black <gblack@eecs.umich.edu>2006-11-22 15:45:32 -0500
commit0a99750ebfe9a9b400ee5f0610ed429851345c4b (patch)
treeb73463f5330730cca540b0fb0bd3757353e88d1a /src/sim/process.hh
parent04e6a3a07b6fdaba9f0954971b61556078611a55 (diff)
parent719416b60ff2ab60403d22b6c7f75139b9535d8c (diff)
downloadgem5-0a99750ebfe9a9b400ee5f0610ed429851345c4b.tar.xz
Merge zizzer:/bk/sparcfs
into zower.eecs.umich.edu:/eecshome/m5/newmem --HG-- extra : convert_revision : 75f3398e38e18eb1f8248e23708d7a8d8cce0fc5
Diffstat (limited to 'src/sim/process.hh')
-rw-r--r--src/sim/process.hh17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sim/process.hh b/src/sim/process.hh
index 5c37f725e..616c02c00 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -177,11 +177,13 @@ class LiveProcess : public Process
ObjectFile *objFile;
std::vector<std::string> argv;
std::vector<std::string> envp;
+ std::string cwd;
LiveProcess(const std::string &nm, ObjectFile *objFile,
System *_system, int stdin_fd, int stdout_fd, int stderr_fd,
std::vector<std::string> &argv,
std::vector<std::string> &envp,
+ const std::string &cwd,
uint64_t _uid, uint64_t _euid,
uint64_t _gid, uint64_t _egid,
uint64_t _pid, uint64_t _ppid);
@@ -207,6 +209,20 @@ class LiveProcess : public Process
inline uint64_t pid() {return __pid;}
inline uint64_t ppid() {return __ppid;}
+ std::string
+ fullPath(const std::string &filename)
+ {
+ if (filename[0] == '/' || cwd.empty())
+ return filename;
+
+ std::string full = cwd;
+
+ if (cwd[cwd.size() - 1] != '/')
+ full += '/';
+
+ return full + filename;
+ }
+
virtual void syscall(int64_t callnum, ThreadContext *tc);
virtual SyscallDesc* getDesc(int callnum) = 0;
@@ -220,6 +236,7 @@ class LiveProcess : public Process
std::string executable,
std::vector<std::string> &argv,
std::vector<std::string> &envp,
+ const std::string &cwd,
uint64_t _uid, uint64_t _euid,
uint64_t _gid, uint64_t _egid,
uint64_t _pid, uint64_t _ppid);