[Lldb-commits] [PATCH] D112973: [lldb] make it easier to find LLDB's python

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 2 18:19:53 PDT 2021


JDevlieghere added a comment.

I was talking to Jim about this offline and one potential solution would be to have a flag that asks the current script interpreter for some of this relevant information. What that means would be different for every language, so the output would have to be able to define its own keys and values. (JSON could be a good candidate for this?) For Python, this would include the python path and the prefix, while for lua this might be something totally different. Both could include a version.

So the way I imagine this working is something like this:

  $ lldb -l python --print-script-interpreter-info
  { 
    "prefix": "/foo/bar",
    "path": "/baz/quux",
     "version": "3.9"
  }
  $ lldb -l lua --print-script-interpreter-info
  { 
     "version": "5.4"
  }

>From an SB API perspective, this would be a function in `SBDebugger` that would return a string or populate a buffer. The driver would then simply print that, and the Python script would parse it and do the right thing.

WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112973



More information about the lldb-commits mailing list