summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-05-06 20:45:31 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-05-06 20:45:31 +0000
commit2edcad7b5982a207666150e4f30544fff6dcaa3e (patch)
treec35d7924e43ffbd99633144b5e749044da105bab /lldb/source/Interpreter/CommandInterpreter.cpp
parentd9923bb2dd2984bffbd17049a26d56890cd16ebd (diff)
downloadbcm5719-llvm-2edcad7b5982a207666150e4f30544fff6dcaa3e.tar.gz
bcm5719-llvm-2edcad7b5982a207666150e4f30544fff6dcaa3e.zip
[Driver] Change the way we deal with local lldbinit files.
Currently we have special handling for local lldbinit files in the driver. At the same time, we have an SB API named `SourceInitFileInCurrentWorkingDirectory` that does the same thing. This patch removes the special handling from the driver and uses the API instead. In addition to the obvious advantages of having one canonical way of doing things and removing code duplication, this change also means that the code path is the same for global and local lldb init files. Differential revision: https://reviews.llvm.org/D61577 llvm-svn: 360077
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 10a290be54c..0811822ff14 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2095,16 +2095,14 @@ void CommandInterpreter::SourceInitFile(bool in_cwd,
CommandReturnObject &result) {
FileSpec init_file;
if (in_cwd) {
- ExecutionContext exe_ctx(GetExecutionContext());
- Target *target = exe_ctx.GetTargetPtr();
- if (target) {
+ lldb::TargetPropertiesSP properties = Target::GetGlobalProperties();
+ if (properties) {
// In the current working directory we don't load any program specific
// .lldbinit files, we only look for a ".lldbinit" file.
if (m_skip_lldbinit_files)
return;
- LoadCWDlldbinitFile should_load =
- target->TargetProperties::GetLoadCWDlldbinitFile();
+ LoadCWDlldbinitFile should_load = properties->GetLoadCWDlldbinitFile();
if (should_load == eLoadCWDlldbinitWarn) {
FileSpec dot_lldb(".lldbinit");
FileSystem::Instance().Resolve(dot_lldb);
OpenPOWER on IntegriCloud