aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Host/common/File.cpp
diff options
context:
space:
mode:
authorChaoren Lin <chaorenl@google.com>2015-05-29 19:52:29 +0000
committerChaoren Lin <chaorenl@google.com>2015-05-29 19:52:29 +0000
commitd3173f34e8546a96b8d0df0d9de133f88f10c127 (patch)
tree5e778446085cbd4a4d43fc3b488b3ac6ff17f2b5 /lldb/source/Host/common/File.cpp
parent375432e4d8f50212bca3d9228e349b5a00f770d7 (diff)
downloadllvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.zip
llvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.tar.gz
llvm-d3173f34e8546a96b8d0df0d9de133f88f10c127.tar.bz2
Refactor many file functions to use FileSpec over strings.
Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604
Diffstat (limited to 'lldb/source/Host/common/File.cpp')
-rw-r--r--lldb/source/Host/common/File.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 4361eae..a3420bf 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -325,12 +325,12 @@ File::Open (const char *path, uint32_t options, uint32_t permissions)
}
uint32_t
-File::GetPermissions (const char *path, Error &error)
+File::GetPermissions(const FileSpec &file_spec, Error &error)
{
- if (path && path[0])
+ if (file_spec)
{
struct stat file_stats;
- if (::stat (path, &file_stats) == -1)
+ if (::stat(file_spec.GetCString(), &file_stats) == -1)
error.SetErrorToErrno();
else
{
@@ -339,12 +339,7 @@ File::GetPermissions (const char *path, Error &error)
}
}
else
- {
- if (path)
- error.SetErrorString ("invalid path");
- else
- error.SetErrorString ("empty path");
- }
+ error.SetErrorString ("empty file spec");
return 0;
}