[Lldb-commits] [PATCH] D89295: [lldb] Add /Users/jonas to Python's sys.path

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Oct 13 08:58:32 PDT 2020


JDevlieghere added a comment.

In D89295#2327809 <https://reviews.llvm.org/D89295#2327809>, @kastiglione wrote:

>> I don't think it's that unreasonable to do the same for `$HOME` to be able to use imports relative to the `.lldbinit` file in both cases.
>
> In theory I agree, but in practice I think it's unnecessary because `~` can be used (and possibly should be explicit), and because `$HOME` is a weird place to put lldb python scripts, as @labath stated.

Other than as a way to the test this change I never advocated putting Python scripts in your home directory. And playing the Devil's advocate: I think the same argument could be made for using `./` as for `~`. If it were up to me I still think there's some value in making the two consistent, but I like I said I misunderstood the request so I don't feel strongly enough to fight for it.

> Should we create some kind of `$PATH` variable for lldb to use for loading scripts? People could set this in their `~/.lldbinit`? This still wouldn't resolve the original bug report, but it may be a nice general addition.

They could already do what `AddToSysPath` does by hand if they really wanted to. I think this is more about improving the UX.

  script sys.path.append("$SRCROOT")


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89295/new/

https://reviews.llvm.org/D89295



More information about the lldb-commits mailing list