HomePhabricator

[CommandInterpreter] Refactor SourceInitFile
737074b4cacdUnpublished

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

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

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
sidorovdMay 24 2019, 5:43 AM
Differential Revision
D61994: [CommandInterpreter] Refactor SourceInitFile
Parents
rG024247f2f826: Fix IPv6 support on lldb-server platform
Branches
Unknown
Tags
Unknown