459,465c459,462
< // If the input parameter contains a relative path, convert it. Note,
< // the return value for this method should always return an absolute
< // path on the host filesystem. The return value will be used to
< // open and manipulate the path specified by the input parameter. Since
< // all filesystem handling in syscall mode is passed through to the host,
< // we deal only with host paths.
< auto host_fs_abs_path = absolutePath(filename, true);
---
> // If the input parameter contains a relative path, convert it.
> // The target version of the current working directory is fine since
> // we immediately convert it using redirect paths into a host version.
> auto abs_path = absolutePath(filename, false);
470,471c467,468
< if (startswith(host_fs_abs_path, path->appPath())) {
< std::string tail = host_fs_abs_path.substr(path->appPath().size());
---
> if (startswith(abs_path, path->appPath())) {
> std::string tail = abs_path.substr(path->appPath().size());
489c486
< return host_fs_abs_path;
---
> return abs_path;
546,552d542
< // Verify that the current working directories are initialized properly.
< // These members should be set initially via params from 'Process.py',
< // although they may change over time depending on what the application
< // does during simulation.
< assert(!tgtCwd.empty());
< assert(!hostCwd.empty());
<
556c546,553
< auto path_base = host_filesystem ? hostCwd : tgtCwd;
---
> auto path_base = std::string();
> if (host_filesystem) {
> path_base = hostCwd;
> assert(!hostCwd.empty());
> } else {
> path_base = tgtCwd;
> assert(!tgtCwd.empty());
> }