[Lldb-commits] [lldb] r298189 - Remove some dead code from DumpValueObjectOptions::PointerDepth
Author: tberghammer Date: Sat Mar 18 12:33:00 2017 New Revision: 298189 URL: http://llvm.org/viewvc/llvm-project?rev=298189&view=rev Log: Remove some dead code from DumpValueObjectOptions::PointerDepth Modified: lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Modified: lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h?rev=298189&r1=298188&r2=298189&view=diff == --- lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h (original) +++ lldb/trunk/include/lldb/DataFormatters/DumpValueObjectOptions.h Sat Mar 18 12:33:00 2017 @@ -27,7 +27,7 @@ namespace lldb_private { class DumpValueObjectOptions { public: struct PointerDepth { -enum class Mode { Always, Formatters, Default, Never } m_mode; +enum class Mode { Always, Default, Never } m_mode; uint32_t m_count; PointerDepth operator--() const { @@ -37,9 +37,6 @@ public: } bool CanAllowExpansion() const; - -bool CanAllowExpansion(bool is_root, TypeSummaryImpl *entry, - ValueObject *valobj, const std::string &summary); }; struct PointerAsArraySettings { Modified: lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp?rev=298189&r1=298188&r2=298189&view=diff == --- lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp (original) +++ lldb/trunk/source/DataFormatters/ValueObjectPrinter.cpp Sat Mar 18 12:33:00 2017 @@ -468,32 +468,11 @@ bool ValueObjectPrinter::PrintObjectDesc return true; } -bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion( -bool is_root, TypeSummaryImpl *entry, ValueObject *valobj, -const std::string &summary) { - switch (m_mode) { - case Mode::Always: -return (m_count > 0); - case Mode::Never: -return false; - case Mode::Default: -if (is_root) - m_count = std::min(m_count, 1); -return m_count > 0; - case Mode::Formatters: -if (!entry || entry->DoesPrintChildren(valobj) || summary.empty()) - return m_count > 0; -return false; - } - return false; -} - bool DumpValueObjectOptions::PointerDepth::CanAllowExpansion() const { switch (m_mode) { case Mode::Always: case Mode::Default: - case Mode::Formatters: -return (m_count > 0); +return m_count > 0; case Mode::Never: return false; } @@ -546,8 +525,7 @@ bool ValueObjectPrinter::ShouldPrintChil return true; } - return curr_ptr_depth.CanAllowExpansion(false, entry, m_valobj, - m_summary); + return curr_ptr_depth.CanAllowExpansion(); } return (!entry || entry->DoesPrintChildren(m_valobj) || m_summary.empty()); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r298202 - Fix unit test compilation failure.
Author: zturner Date: Sun Mar 19 00:48:01 2017 New Revision: 298202 URL: http://llvm.org/viewvc/llvm-project?rev=298202&view=rev Log: Fix unit test compilation failure. Modified: lldb/trunk/unittests/Interpreter/TestCompletion.cpp Modified: lldb/trunk/unittests/Interpreter/TestCompletion.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Interpreter/TestCompletion.cpp?rev=298202&r1=298201&r2=298202&view=diff == --- lldb/trunk/unittests/Interpreter/TestCompletion.cpp (original) +++ lldb/trunk/unittests/Interpreter/TestCompletion.cpp Sun Mar 19 00:48:01 2017 @@ -64,7 +64,8 @@ public: bool ResolveExact(StringRef Expr, SmallVectorImpl &Output) override { Output.clear(); -assert(!llvm::any_of(Expr, llvm::sys::path::is_separator)); +assert(!llvm::any_of( +Expr, [](char c) { return llvm::sys::path::is_separator(c); })); assert(Expr.empty() || Expr[0] == '~'); Expr = Expr.drop_front(); if (Expr.empty()) { @@ -85,7 +86,8 @@ public: bool ResolvePartial(StringRef Expr, StringSet<> &Output) override { Output.clear(); -assert(!llvm::any_of(Expr, llvm::sys::path::is_separator)); +assert(!llvm::any_of( +Expr, [](char c) { return llvm::sys::path::is_separator(c); })); assert(Expr.empty() || Expr[0] == '~'); Expr = Expr.drop_front(); ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
[Lldb-commits] [lldb] r298203 - Remove FileSystem::MakeDirectory.
Author: zturner Date: Sun Mar 19 00:48:47 2017 New Revision: 298203 URL: http://llvm.org/viewvc/llvm-project?rev=298203&view=rev Log: Remove FileSystem::MakeDirectory. Have callers use llvm::sys::fs::create_directory() instead. Differential Revision: https://reviews.llvm.org/D31086 Modified: lldb/trunk/include/lldb/Host/FileSystem.h lldb/trunk/source/Host/common/Editline.cpp lldb/trunk/source/Host/common/HostInfoBase.cpp lldb/trunk/source/Host/posix/FileSystem.cpp lldb/trunk/source/Host/windows/FileSystem.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp lldb/trunk/source/Target/Platform.cpp lldb/trunk/tools/lldb-server/lldb-platform.cpp Modified: lldb/trunk/include/lldb/Host/FileSystem.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=298203&r1=298202&r2=298203&view=diff == --- lldb/trunk/include/lldb/Host/FileSystem.h (original) +++ lldb/trunk/include/lldb/Host/FileSystem.h Sun Mar 19 00:48:47 2017 @@ -28,8 +28,6 @@ public: static FileSpec::PathSyntax GetNativePathSyntax(); - static Error MakeDirectory(const FileSpec &file_spec, uint32_t mode); - static Error GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions); static Error SetFilePermissions(const FileSpec &file_spec, Modified: lldb/trunk/source/Host/common/Editline.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=298203&r1=298202&r2=298203&view=diff == --- lldb/trunk/source/Host/common/Editline.cpp (original) +++ lldb/trunk/source/Host/common/Editline.cpp Sun Mar 19 00:48:47 2017 @@ -15,13 +15,13 @@ #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/Editline.h" #include "lldb/Host/FileSpec.h" -#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Utility/Error.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/SelectHelper.h" #include "lldb/Utility/StreamString.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/Threading.h" using namespace lldb_private; @@ -178,9 +178,7 @@ private: if (m_path.empty() && m_history && !m_prefix.empty()) { FileSpec parent_path{"~/.lldb", true}; char history_path[PATH_MAX]; - if (FileSystem::MakeDirectory(parent_path, -lldb::eFilePermissionsDirectoryDefault) - .Success()) { + if (!llvm::sys::fs::create_directory(parent_path.GetPath()) { snprintf(history_path, sizeof(history_path), "~/.lldb/%s-history", m_prefix.c_str()); } else { Modified: lldb/trunk/source/Host/common/HostInfoBase.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/HostInfoBase.cpp?rev=298203&r1=298202&r2=298203&view=diff == --- lldb/trunk/source/Host/common/HostInfoBase.cpp (original) +++ lldb/trunk/source/Host/common/HostInfoBase.cpp Sun Mar 19 00:48:47 2017 @@ -314,9 +314,7 @@ bool HostInfoBase::ComputeProcessTempFil std::string pid_str{llvm::to_string(Host::GetCurrentProcessID())}; temp_file_spec.AppendPathComponent(pid_str); - if (!FileSystem::MakeDirectory(temp_file_spec, - eFilePermissionsDirectoryDefault) - .Success()) + if (llvm::sys::fs::create_directory(temp_file_spec.GetPath())) return false; file_spec.GetDirectory().SetCString(temp_file_spec.GetCString()); @@ -338,9 +336,7 @@ bool HostInfoBase::ComputeGlobalTempFile return false; temp_file_spec.AppendPathComponent("lldb"); - if (!FileSystem::MakeDirectory(temp_file_spec, - eFilePermissionsDirectoryDefault) - .Success()) + if (llvm::sys::fs::create_directory(temp_file_spec.GetPath())) return false; file_spec.GetDirectory().SetCString(temp_file_spec.GetCString()); Modified: lldb/trunk/source/Host/posix/FileSystem.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/FileSystem.cpp?rev=298203&r1=298202&r2=298203&view=diff == --- lldb/trunk/source/Host/posix/FileSystem.cpp (original) +++ lldb/trunk/source/Host/posix/FileSystem.cpp Sun Mar 19 00:48:47 2017 @@ -40,39 +40,6 @@ FileSpec::PathSyntax FileSystem::GetNati return FileSpec::ePathSyntaxPosix; } -Error FileSystem::MakeDirectory(const FileSpec &file_spec, -uint32_t file_permissions) { - if (file_spec) { -Error error; -if (::mkdir(file_spec.GetCString(), file_permissions) == -1) { -
[Lldb-commits] [PATCH] D31086: Remove FileSystem::MakeDirectory
This revision was automatically updated to reflect the committed changes. Closed by commit rL298203: Remove FileSystem::MakeDirectory. (authored by zturner). Changed prior to commit: https://reviews.llvm.org/D31086?vs=92162&id=92259#toc Repository: rL LLVM https://reviews.llvm.org/D31086 Files: lldb/trunk/include/lldb/Host/FileSystem.h lldb/trunk/source/Host/common/Editline.cpp lldb/trunk/source/Host/common/HostInfoBase.cpp lldb/trunk/source/Host/posix/FileSystem.cpp lldb/trunk/source/Host/windows/FileSystem.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp lldb/trunk/source/Target/Platform.cpp lldb/trunk/tools/lldb-server/lldb-platform.cpp Index: lldb/trunk/include/lldb/Host/FileSystem.h === --- lldb/trunk/include/lldb/Host/FileSystem.h +++ lldb/trunk/include/lldb/Host/FileSystem.h @@ -28,8 +28,6 @@ static FileSpec::PathSyntax GetNativePathSyntax(); - static Error MakeDirectory(const FileSpec &file_spec, uint32_t mode); - static Error GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions); static Error SetFilePermissions(const FileSpec &file_spec, Index: lldb/trunk/tools/lldb-server/lldb-platform.cpp === --- lldb/trunk/tools/lldb-server/lldb-platform.cpp +++ lldb/trunk/tools/lldb-server/lldb-platform.cpp @@ -32,7 +32,6 @@ #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h" #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/FileSpec.h" -#include "lldb/Host/FileSystem.h" #include "lldb/Host/HostGetOpt.h" #include "lldb/Host/OptionParser.h" #include "lldb/Host/common/TCPSocket.h" @@ -102,8 +101,7 @@ static Error save_socket_id_to_file(const std::string &socket_id, const FileSpec &file_spec) { FileSpec temp_file_spec(file_spec.GetDirectory().AsCString(), false); - auto error = FileSystem::MakeDirectory(temp_file_spec, - eFilePermissionsDirectoryDefault); + Error error(llvm::sys::fs::create_directory(temp_file_spec.GetPath())); if (error.Fail()) return Error("Failed to create directory %s: %s", temp_file_spec.GetCString(), error.AsCString()); Index: lldb/trunk/source/Target/Platform.cpp === --- lldb/trunk/source/Target/Platform.cpp +++ lldb/trunk/source/Target/Platform.cpp @@ -761,7 +761,7 @@ Error Platform::MakeDirectory(const FileSpec &file_spec, uint32_t permissions) { if (IsHost()) -return FileSystem::MakeDirectory(file_spec, permissions); +return llvm::sys::fs::create_directory(file_spec.GetPath(), permissions); else { Error error; error.SetErrorStringWithFormat("remote platform %s doesn't support %s", Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp === --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp @@ -22,7 +22,6 @@ #include "lldb/Core/ModuleSpec.h" #include "lldb/Core/PluginManager.h" #include "lldb/Host/FileSpec.h" -#include "lldb/Host/FileSystem.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" #include "lldb/Symbol/ObjectFile.h" @@ -279,8 +278,7 @@ FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent(); // try to make the local directory first - Error err = FileSystem::MakeDirectory(module_cache_folder, -eFilePermissionsDirectoryDefault); + Error err(llvm::sys::fs::create_directory(module_cache_folder.GetPath())); if (err.Fail()) return err; err = GetFile(platform_file, module_cache_spec); Index: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp === --- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -225,8 +225,7 @@ MakeCacheFolderForFile(const FileSpec &module_cache_spec) { FileSpec module_cache_folder = module_cache_spec.CopyByRemovingLastPathComponent(); - return FileSystem::MakeDirectory(module_cache_folder, - eFilePermissionsDirectoryDefault); + return llvm::sys::fs::create_directory(module_cache_folder.GetPath()); } static lldb_private::Error Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp === --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer
[Lldb-commits] [lldb] r298205 - Remove FileSystem::Get/SetFilePermissions
Author: zturner Date: Sun Mar 19 00:49:43 2017 New Revision: 298205 URL: http://llvm.org/viewvc/llvm-project?rev=298205&view=rev Log: Remove FileSystem::Get/SetFilePermissions Differential Revision: https://reviews.llvm.org/D31089 Modified: lldb/trunk/include/lldb/Host/FileSystem.h lldb/trunk/source/Host/posix/FileSystem.cpp lldb/trunk/source/Host/windows/FileSystem.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp lldb/trunk/source/Target/Platform.cpp Modified: lldb/trunk/include/lldb/Host/FileSystem.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Host/FileSystem.h?rev=298205&r1=298204&r2=298205&view=diff == --- lldb/trunk/include/lldb/Host/FileSystem.h (original) +++ lldb/trunk/include/lldb/Host/FileSystem.h Sun Mar 19 00:49:43 2017 @@ -28,10 +28,6 @@ public: static FileSpec::PathSyntax GetNativePathSyntax(); - static Error GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions); - static Error SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions); static lldb::user_id_t GetFileSize(const FileSpec &file_spec); static bool GetFileExists(const FileSpec &file_spec); Modified: lldb/trunk/source/Host/posix/FileSystem.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/posix/FileSystem.cpp?rev=298205&r1=298204&r2=298205&view=diff == --- lldb/trunk/source/Host/posix/FileSystem.cpp (original) +++ lldb/trunk/source/Host/posix/FileSystem.cpp Sun Mar 19 00:49:43 2017 @@ -40,28 +40,6 @@ FileSpec::PathSyntax FileSystem::GetNati return FileSpec::ePathSyntaxPosix; } -Error FileSystem::GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions) { - Error error; - struct stat file_stats; - if (::stat(file_spec.GetCString(), &file_stats) == 0) { -// The bits in "st_mode" currently match the definitions -// for the file mode bits in unix. -file_permissions = file_stats.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); - } else { -error.SetErrorToErrno(); - } - return error; -} - -Error FileSystem::SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions) { - Error error; - if (::chmod(file_spec.GetCString(), file_permissions) != 0) -error.SetErrorToErrno(); - return error; -} - lldb::user_id_t FileSystem::GetFileSize(const FileSpec &file_spec) { return file_spec.GetByteSize(); } Modified: lldb/trunk/source/Host/windows/FileSystem.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/windows/FileSystem.cpp?rev=298205&r1=298204&r2=298205&view=diff == --- lldb/trunk/source/Host/windows/FileSystem.cpp (original) +++ lldb/trunk/source/Host/windows/FileSystem.cpp Sun Mar 19 00:49:43 2017 @@ -30,34 +30,6 @@ FileSpec::PathSyntax FileSystem::GetNati return FileSpec::ePathSyntaxWindows; } -Error FileSystem::GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions) { - Error error; - // Beware that Windows's permission model is different from Unix's, and it's - // not clear if this API is supposed to check ACLs. To match the caller's - // expectations as closely as possible, we'll use Microsoft's _stat, which - // attempts to emulate POSIX stat. This should be good enough for basic - // checks like FileSpec::Readable. - struct _stat file_stats; - if (::_stat(file_spec.GetCString(), &file_stats) == 0) { -// The owner permission bits in "st_mode" currently match the definitions -// for the owner file mode bits. -file_permissions = file_stats.st_mode & (_S_IREAD | _S_IWRITE | _S_IEXEC); - } else { -error.SetErrorToErrno(); - } - - return error; -} - -Error FileSystem::SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions) { - Error error; - error.SetErrorStringWithFormat("%s is not supported on this host", - LLVM_PRETTY_FUNCTION); - return error; -} - lldb::user_id_t FileSystem::GetFileSize(const FileSpec &file_spec) { return file_spec.GetByteSize(); } Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp?rev=298205&r1=298204&r2=298205&view=diff == --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp (original) +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServ
[Lldb-commits] [PATCH] D31089: Remove FileSystem::GetFilePermissions and FileSystem::SetFilePermissions
This revision was automatically updated to reflect the committed changes. Closed by commit rL298205: Remove FileSystem::Get/SetFilePermissions (authored by zturner). Changed prior to commit: https://reviews.llvm.org/D31089?vs=92167&id=92260#toc Repository: rL LLVM https://reviews.llvm.org/D31089 Files: lldb/trunk/include/lldb/Host/FileSystem.h lldb/trunk/source/Host/posix/FileSystem.cpp lldb/trunk/source/Host/windows/FileSystem.cpp lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp lldb/trunk/source/Target/Platform.cpp Index: lldb/trunk/include/lldb/Host/FileSystem.h === --- lldb/trunk/include/lldb/Host/FileSystem.h +++ lldb/trunk/include/lldb/Host/FileSystem.h @@ -28,10 +28,6 @@ static FileSpec::PathSyntax GetNativePathSyntax(); - static Error GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions); - static Error SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions); static lldb::user_id_t GetFileSize(const FileSpec &file_spec); static bool GetFileExists(const FileSpec &file_spec); Index: lldb/trunk/source/Target/Platform.cpp === --- lldb/trunk/source/Target/Platform.cpp +++ lldb/trunk/source/Target/Platform.cpp @@ -773,9 +773,12 @@ Error Platform::GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions) { - if (IsHost()) -return FileSystem::GetFilePermissions(file_spec, file_permissions); - else { + if (IsHost()) { +auto Value = llvm::sys::fs::getPermissions(file_spec.GetPath()); +if (Value) + file_permissions = Value.get(); +return Error(Value.getError()); + } else { Error error; error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), @@ -786,9 +789,10 @@ Error Platform::SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions) { - if (IsHost()) -return FileSystem::SetFilePermissions(file_spec, file_permissions); - else { + if (IsHost()) { +auto Perms = static_cast(file_permissions); +return llvm::sys::fs::setPermissions(file_spec.GetPath(), Perms); + } else { Error error; error.SetErrorStringWithFormat("remote platform %s doesn't support %s", GetPluginName().GetCString(), Index: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp === --- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp +++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp @@ -809,11 +809,12 @@ StringExtractorGDBRemote &packet) { packet.SetFilePos(::strlen("qPlatform_chmod:")); - mode_t mode = packet.GetHexMaxU32(false, UINT32_MAX); + auto perms = + static_cast(packet.GetHexMaxU32(false, UINT32_MAX)); if (packet.GetChar() == ',') { std::string path; packet.GetHexByteString(path); -Error error = FileSystem::SetFilePermissions(FileSpec{path, true}, mode); +Error error(llvm::sys::fs::setPermissions(path, perms)); StreamGDBRemote response; response.Printf("F%u", error.GetError()); Index: lldb/trunk/source/Host/posix/FileSystem.cpp === --- lldb/trunk/source/Host/posix/FileSystem.cpp +++ lldb/trunk/source/Host/posix/FileSystem.cpp @@ -40,28 +40,6 @@ return FileSpec::ePathSyntaxPosix; } -Error FileSystem::GetFilePermissions(const FileSpec &file_spec, - uint32_t &file_permissions) { - Error error; - struct stat file_stats; - if (::stat(file_spec.GetCString(), &file_stats) == 0) { -// The bits in "st_mode" currently match the definitions -// for the file mode bits in unix. -file_permissions = file_stats.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO); - } else { -error.SetErrorToErrno(); - } - return error; -} - -Error FileSystem::SetFilePermissions(const FileSpec &file_spec, - uint32_t file_permissions) { - Error error; - if (::chmod(file_spec.GetCString(), file_permissions) != 0) -error.SetErrorToErrno(); - return error; -} - lldb::user_id_t FileSystem::GetFileSize(const FileSpec &file_spec) { return file_spec.GetByteSize(); } Index: lldb/trunk/source/Host/windows/FileSystem.cpp === --- lldb/trunk/source/Host/windows/FileSystem.cpp +++ lldb/trunk/source/Host/windows/FileSystem.cpp @@ -30,34 +30,6 @@ return FileSpec::ePathSyntaxWindows; } -Error FileSystem::GetFilePermissions(const FileSpec &file_spec, -
[Lldb-commits] [lldb] r298206 - Fix syntax error when building with editline support.
Author: zturner Date: Sun Mar 19 01:00:31 2017 New Revision: 298206 URL: http://llvm.org/viewvc/llvm-project?rev=298206&view=rev Log: Fix syntax error when building with editline support. Modified: lldb/trunk/source/Host/common/Editline.cpp Modified: lldb/trunk/source/Host/common/Editline.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/common/Editline.cpp?rev=298206&r1=298205&r2=298206&view=diff == --- lldb/trunk/source/Host/common/Editline.cpp (original) +++ lldb/trunk/source/Host/common/Editline.cpp Sun Mar 19 01:00:31 2017 @@ -178,7 +178,7 @@ private: if (m_path.empty() && m_history && !m_prefix.empty()) { FileSpec parent_path{"~/.lldb", true}; char history_path[PATH_MAX]; - if (!llvm::sys::fs::create_directory(parent_path.GetPath()) { + if (!llvm::sys::fs::create_directory(parent_path.GetPath())) { snprintf(history_path, sizeof(history_path), "~/.lldb/%s-history", m_prefix.c_str()); } else { ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits