summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2018-06-13 22:08:14 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2018-06-13 22:08:14 +0000
commit937348cd1359b30359b958ca81b7e7d8711b443e (patch)
treef4249e96df7ff194b336fdbf8cbd6c690d5a39f2 /lldb/source/Interpreter/CommandInterpreter.cpp
parent07570f55e4ad104a474efff4ae1a3c3b49145fed (diff)
downloadbcm5719-llvm-937348cd1359b30359b958ca81b7e7d8711b443e.tar.gz
bcm5719-llvm-937348cd1359b30359b958ca81b7e7d8711b443e.zip
[FileSpec] Make style argument mandatory for SetFile. NFC
SetFile has an optional style argument which defaulted to the native style. This patch makes that argument mandatory so clients of the FileSpec class are forced to think about the correct syntax. At the same time this introduces a (protected) convenience method to update the file from within the FileSpec class that keeps the current style. These two changes together prevent a potential pitfall where the style might be forgotten, leading to the path being updated and the style unintentionally being changed to the host style. llvm-svn: 334663
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 8f309512172..bb8da85390f 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2102,7 +2102,7 @@ void CommandInterpreter::SourceInitFile(bool in_cwd,
return;
}
} else if (should_load == eLoadCWDlldbinitTrue) {
- init_file.SetFile("./.lldbinit", true);
+ init_file.SetFile("./.lldbinit", true, FileSpec::Style::native);
}
}
} else {
@@ -2126,14 +2126,15 @@ void CommandInterpreter::SourceInitFile(bool in_cwd,
char program_init_file_name[PATH_MAX];
::snprintf(program_init_file_name, sizeof(program_init_file_name),
"%s-%s", init_file_path.c_str(), program_name);
- init_file.SetFile(program_init_file_name, true);
+ init_file.SetFile(program_init_file_name, true,
+ FileSpec::Style::native);
if (!init_file.Exists())
init_file.Clear();
}
}
if (!init_file && !m_skip_lldbinit_files)
- init_file.SetFile(init_file_path, false);
+ init_file.SetFile(init_file_path, false, FileSpec::Style::native);
}
// If the file exists, tell HandleCommand to 'source' it; this will do the
OpenPOWER on IntegriCloud