summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r--lldb/source/Commands/CommandCompletions.cpp12
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp7
2 files changed, 11 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandCompletions.cpp b/lldb/source/Commands/CommandCompletions.cpp
index 10c1a2429bb..2d24843fccc 100644
--- a/lldb/source/Commands/CommandCompletions.cpp
+++ b/lldb/source/Commands/CommandCompletions.cpp
@@ -33,6 +33,7 @@
#include "lldb/Utility/CleanUp.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/FileSystem.h"
using namespace lldb_private;
@@ -109,7 +110,7 @@ typedef struct DiskFilesOrDirectoriesBaton {
} DiskFilesOrDirectoriesBaton;
FileSpec::EnumerateDirectoryResult
-DiskFilesOrDirectoriesCallback(void *baton, FileSpec::FileType file_type,
+DiskFilesOrDirectoriesCallback(void *baton, llvm::sys::fs::file_type file_type,
const FileSpec &spec) {
const char *name = spec.GetFilename().AsCString();
@@ -137,13 +138,12 @@ DiskFilesOrDirectoriesCallback(void *baton, FileSpec::FileType file_type,
strcpy(end_ptr, name);
+ namespace fs = llvm::sys::fs;
bool isa_directory = false;
- if (file_type == FileSpec::eFileTypeDirectory)
+ if (file_type == fs::file_type::directory_file)
isa_directory = true;
- else if (file_type == FileSpec::eFileTypeSymbolicLink) {
- if (FileSpec(partial_name_copy, false).IsDirectory())
- isa_directory = true;
- }
+ else if (file_type == fs::file_type::symlink_file)
+ isa_directory = fs::is_directory(partial_name_copy);
if (isa_directory) {
*parameters->saw_directory = true;
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 37dec184805..c8871c8de6e 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -50,6 +50,8 @@
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
+#include "llvm/Support/FileSystem.h"
+
// C Includes
// C++ Includes
#include <cerrno>
@@ -4136,20 +4138,21 @@ protected:
module_sp->SetSymbolFileFileSpec(FileSpec());
}
+ namespace fs = llvm::sys::fs;
if (module_spec.GetUUID().IsValid()) {
StreamString ss_symfile_uuid;
module_spec.GetUUID().Dump(&ss_symfile_uuid);
result.AppendErrorWithFormat(
"symbol file '%s' (%s) does not match any existing module%s\n",
symfile_path, ss_symfile_uuid.GetData(),
- (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)
+ !fs::is_regular_file(symbol_fspec.GetPath())
? "\n please specify the full path to the symbol file"
: "");
} else {
result.AppendErrorWithFormat(
"symbol file '%s' does not match any existing module%s\n",
symfile_path,
- (symbol_fspec.GetFileType() != FileSpec::eFileTypeRegular)
+ !fs::is_regular_file(symbol_fspec.GetPath())
? "\n please specify the full path to the symbol file"
: "");
}
OpenPOWER on IntegriCloud