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

2020-10-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. In D89295#2327905 , @labath wrote: > In D89295#2327767 , @teemperor wrote: > >> In D89295#2327751 , @kastiglione >> wrote: >> >>> For lldbinit

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

2020-10-13 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. In D89295#2327767 , @teemperor wrote: > In D89295#2327751 , @kastiglione > wrote: > >> For lldbinit files, and any file that gets `command source`'d, I think it >> would be useful if they

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

2020-10-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. In 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

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

2020-10-13 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment. > 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

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

2020-10-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. PS: when I created this patch I used `$HOME` in the title, I didn't expect that to get expanded?! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89295/new/ https://reviews.llvm.org/D89295 ___ lldb-commits

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

2020-10-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment. I misunderstood what was being asked for. In LLDB there are two places we look for an `.lldbinit` file, in the home directory and in the current working directory. We already add `.` to the system path so I don't think it's that unreasonable to do the same for

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

2020-10-13 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment. > (and whether we should make this implicit a relative path vs for example some > kind of placeholder 'variable' or something like that). I'm not sure either, but if we do it could probably be as a `./` as prefix? CHANGES SINCE LAST ACTION

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

2020-10-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D89295#2327751 , @kastiglione wrote: > For lldbinit files, and any file that gets `command source`'d, I think it > would be useful if they could perform `command script import > some/path/to/command.py`, where `some` is

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

2020-10-13 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment. For lldbinit files, and any file that gets `command source`'d, I think it would be useful if they could perform `command script import some/path/to/command.py`, where `some` is resolved relative to the dirname of the lldb file. For example, given an lldbinit file

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

2020-10-13 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment. In D89295#2327367 , @labath wrote: > That actually seems to work (if you add .py to the end). Yes that was my (poorly explained) point, I use this form regularly. Is it not better to require an explicit `~` instead of

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

2020-10-13 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. Interesting. I think that implementing a project-specific script repository would be indeed best done in xcode, since that's the thing which knows what a "project" is. I'm not sure if this needs any special kind of support from lldb (it sounds like xcode could just

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

2020-10-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment. In D89295#2327367 , @labath wrote: > What exactly is the use case for this? Xcode running a project-specific lldbinit file but users can't specify a `command script import relative/path/script.py` as the CWD for the

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

2020-10-13 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment. What exactly is the use case for this? Having a place where the user can place lldb python scripts and have them be automatically accessible seems like a nice feature, but I am not convinced that $HOME is the right place for it. I definitely wouldn't want lldb scripts

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

2020-10-13 Thread Dave Lee via Phabricator via lldb-commits
kastiglione added a comment. Could this have undesirable side effects? I wouldn't expect `command script import` to be searching my home dir. Second question: is there value in requiring the explicit use of `~`, for ex: `command script import ~/path`. CHANGES SINCE LAST ACTION

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

2020-10-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision. JDevlieghere added reviewers: LLDB, labath, lawrence_danna. JDevlieghere requested review of this revision. Add support for importing scripts relative the current home directory. rdar://68310384 https://reviews.llvm.org/D89295 Files: