HomePhabricator

[CommandInterpreter] Refactor SourceInitFile

Authored by JDevlieghere on May 17 2019, 3:53 PM.

Description

[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

Details

Committed
JDevlieghereMay 17 2019, 3:53 PM
Differential Revision
D61994: [CommandInterpreter] Refactor SourceInitFile
Parents
rGd84d02e1973a: Fix IPv6 support on lldb-server platform
Branches
Unknown
Tags
Unknown