diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-17 22:53:04 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-05-17 22:53:04 +0000 |
commit | 2fc6b024b981830ae7d1da09a5a8b5e19ca3c6ba (patch) | |
tree | 1d90d23258094d5af87d5a352e47b41fd495c953 /lldb/source/API/SBCommandInterpreter.cpp | |
parent | d84d02e1973a0601ad2353c131fd588d271ea1b1 (diff) | |
download | llvm-2fc6b024b981830ae7d1da09a5a8b5e19ca3c6ba.zip llvm-2fc6b024b981830ae7d1da09a5a8b5e19ca3c6ba.tar.gz llvm-2fc6b024b981830ae7d1da09a5a8b5e19ca3c6ba.tar.bz2 |
[CommandInterpreter] Refactor SourceInitFile
I was looking at the current implementation of SourceInitFile and there
were a few things that made this function hard to read:
* The code to find the ~/.lldbinit file is duplicated across the cwd
and non-cwd branch.
* The ./.lldbinit is once computed by resolving .lldbinit and once by
resolving ./.lldbinit.
* It wasn't clear to me what happened when you're sourcing the
.lldbinit file in the current working directory. Apparently we do
nothing when we property to control that is set to warn (makes sense)
and we don't care when the property is set to true (debatable).
* There were at least two branches where the status of the
CommandReturnObject were not set.
This patch attempts to simplify that code.
Differential revision: https://reviews.llvm.org/D61994
llvm-svn: 361080
Diffstat (limited to 'lldb/source/API/SBCommandInterpreter.cpp')
-rw-r--r-- | lldb/source/API/SBCommandInterpreter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/API/SBCommandInterpreter.cpp b/lldb/source/API/SBCommandInterpreter.cpp index e6d7ac6..c07dffc 100644 --- a/lldb/source/API/SBCommandInterpreter.cpp +++ b/lldb/source/API/SBCommandInterpreter.cpp @@ -540,7 +540,7 @@ void SBCommandInterpreter::SourceInitFileInHomeDirectory( std::unique_lock<std::recursive_mutex> lock; if (target_sp) lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex()); - m_opaque_ptr->SourceInitFile(false, result.ref()); + m_opaque_ptr->SourceInitFileHome(result.ref()); } else { result->AppendError("SBCommandInterpreter is not valid"); result->SetStatus(eReturnStatusFailed); @@ -559,7 +559,7 @@ void SBCommandInterpreter::SourceInitFileInCurrentWorkingDirectory( std::unique_lock<std::recursive_mutex> lock; if (target_sp) lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex()); - m_opaque_ptr->SourceInitFile(true, result.ref()); + m_opaque_ptr->SourceInitFileCwd(result.ref()); } else { result->AppendError("SBCommandInterpreter is not valid"); result->SetStatus(eReturnStatusFailed); |