[Lldb-commits] [PATCH] D61090: [SBHostOS} Remove getting the python script interpreter path

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 26 01:29:16 PDT 2019


labath added a comment.

In D61090#1479049 <https://reviews.llvm.org/D61090#1479049>, @jingham wrote:

> I really thought there was one at the SB layer, because in terms of design that is what makes sense.  I guess we never really needed it until now, so we didn't add it.  Once there's more than one hard-coded script interpreter, we will need to add some way to select & direct scripts at the various script interpreters so we will need SBScriptInterpreter at the SB layer.  So maybe now is the time to add it in preparation...
>
> Also, the fact that at the lldb_private layer, the ScriptInterpreter is held onto by the CommandInterpreter is clearly wrong.  The CommandInterpreter should have a member that tells it the currently selected ScriptInterpreter, but the list of script interpreters should belong to the Debugger.  We should probably disentangle that at the same time.


Yes, it sounds like we should have a SBScriptInterpreter at some point. Though, right now, it's not really clear to me what will it's exact role be, so I would tend to agree with Greg that we wait until we have a real use case for it (so we don't commit to a design we may want to change later).

> As an aside, IIUC, the current work to support either Python flavor only supports one interpreter at a time because Python doesn't support loading Python 2 & 3 into the same process?

I've heard someone say that, and I can believe that is the official party line of the python project, but I haven't investigated how "true" that statement is. E.g., I'm pretty sure we could get it to work by using some of the fancier flags of dlopen (RTLD_LOCAL, or the new namespace thingies present on linux), but that may take more effort than it's worth..


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

https://reviews.llvm.org/D61090





More information about the lldb-commits mailing list