summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-11-01 21:05:36 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-11-01 21:05:36 +0000
commit8f3be7a32b631e9ba584872c1f0dde8fd8536c07 (patch)
treeb4cfca7eb1e0996decd88a2b1dd1954ff3d7ff28 /lldb/source/Commands/CommandObjectTarget.cpp
parent8487d22d12f5b7b5c745e5a5cdda61f8a07391e1 (diff)
downloadbcm5719-llvm-8f3be7a32b631e9ba584872c1f0dde8fd8536c07.tar.gz
bcm5719-llvm-8f3be7a32b631e9ba584872c1f0dde8fd8536c07.zip
[FileSystem] Move path resolution logic out of FileSpec
This patch removes the logic for resolving paths out of FileSpec and updates call sites to rely on the FileSystem class instead. Differential revision: https://reviews.llvm.org/D53915 llvm-svn: 345890
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index de9526d94d4..d89779940c5 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -313,8 +313,10 @@ protected:
Timer scoped_timer(func_cat, "(lldb) target create '%s'", file_path);
FileSpec file_spec;
- if (file_path)
- file_spec.SetFile(file_path, true, FileSpec::Style::native);
+ if (file_path) {
+ file_spec.SetFile(file_path, FileSpec::Style::native);
+ FileSystem::Instance().Resolve(file_spec);
+ }
bool must_set_platform_path = false;
@@ -1793,7 +1795,7 @@ static uint32_t LookupFileAndLineInModule(CommandInterpreter &interpreter,
static size_t FindModulesByName(Target *target, const char *module_name,
ModuleList &module_list,
bool check_global_list) {
- FileSpec module_file_spec(module_name, false);
+ FileSpec module_file_spec(module_name);
ModuleSpec module_spec(module_file_spec);
const size_t initial_size = module_list.GetSize();
@@ -2352,7 +2354,7 @@ protected:
for (int arg_idx = 0;
(arg_cstr = command.GetArgumentAtIndex(arg_idx)) != nullptr;
++arg_idx) {
- FileSpec file_spec(arg_cstr, false);
+ FileSpec file_spec(arg_cstr);
const ModuleList &target_modules = target->GetImages();
std::lock_guard<std::recursive_mutex> guard(target_modules.GetMutex());
@@ -2532,7 +2534,7 @@ protected:
if (entry.ref.empty())
continue;
- FileSpec file_spec(entry.ref, true);
+ FileSpec file_spec(entry.ref);
if (FileSystem::Instance().Exists(file_spec)) {
ModuleSpec module_spec(file_spec);
if (m_uuid_option_group.GetOptionValue().OptionWasSet())
@@ -3616,7 +3618,7 @@ public:
break;
case 'f':
- m_file.SetFile(option_arg, false, FileSpec::Style::native);
+ m_file.SetFile(option_arg, FileSpec::Style::native);
m_type = eLookupTypeFileLine;
break;
@@ -4348,8 +4350,9 @@ protected:
for (auto &entry : args.entries()) {
if (!entry.ref.empty()) {
- module_spec.GetSymbolFileSpec().SetFile(entry.ref, true,
- FileSpec::Style::native);
+ auto &symbol_file_spec = module_spec.GetSymbolFileSpec();
+ symbol_file_spec.SetFile(entry.ref, FileSpec::Style::native);
+ FileSystem::Instance().Resolve(symbol_file_spec);
if (file_option_set) {
module_spec.GetFileSpec() =
m_file_option.GetOptionValue().GetCurrentValue();
OpenPOWER on IntegriCloud