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

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to