Re: [lldb-dev] Default script language
I agree with Jim - it should be a cmake setting, defaulting to Python. If the person building lldb wants to change the default scripting language from Python to Lua, it should be easy. Since we now support 2 scripting languages, we should have an easy way for the user to see which are supported, and which is the default if there are more than 1 supported. Maybe in lldb --version? Ted -Original Message- From: lldb-dev On Behalf Of Jim Ingham via lldb-dev Sent: Wednesday, April 1, 2020 5:43 PM To: Ed Maste Cc: LLDB Subject: [EXT] Re: [lldb-dev] Default script language Right now, Lua is not nearly as well supported as Python, so it makes sense that if both Python and Lua are available Python should be the default. But at some point Lua will become an equal to Python. When that happens, it seems to me the default scripting language choice should be up to the package distributor. I don’t see why we need to weigh in on that. That would imply that the default should be an independent build setting. Not sure that means we need to do it that way now, but if we don’t want to do it twice… Jim > On Apr 1, 2020, at 2:09 PM, Ed Maste via lldb-dev > wrote: > > In lldb/include/lldb/lldb-enumerations.h we have: > eScriptLanguageDefault = eScriptLanguagePython > > I'd like to do something like: > #if LLDB_ENABLE_PYTHON > eScriptLanguageDefault = eScriptLanguagePython #elif LLDB_ENABLE_LUA > eScriptLanguageDefault = eScriptLanguageLua #else > eScriptLanguageDefault = eScriptLanguageNone #endif > > if we could include Config.h, or achieve the same effect in some other > way if we cannot. Does this seem reasonable? > > I'm interested in this for lldb in the FreeBSD base system. We have > lua available already (and no python) and I've integrated our liblua > it into lldb, but it required "--script-language lua" on the command > line. For now I'll just change the default to be eScriptLanguageLua in > our tree, but would like to have this "just work" upstream. > ___ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
Re: [lldb-dev] Default script language
Right now, Lua is not nearly as well supported as Python, so it makes sense that if both Python and Lua are available Python should be the default. But at some point Lua will become an equal to Python. When that happens, it seems to me the default scripting language choice should be up to the package distributor. I don’t see why we need to weigh in on that. That would imply that the default should be an independent build setting. Not sure that means we need to do it that way now, but if we don’t want to do it twice… Jim > On Apr 1, 2020, at 2:09 PM, Ed Maste via lldb-dev > wrote: > > In lldb/include/lldb/lldb-enumerations.h we have: > eScriptLanguageDefault = eScriptLanguagePython > > I'd like to do something like: > #if LLDB_ENABLE_PYTHON > eScriptLanguageDefault = eScriptLanguagePython > #elif LLDB_ENABLE_LUA > eScriptLanguageDefault = eScriptLanguageLua > #else > eScriptLanguageDefault = eScriptLanguageNone > #endif > > if we could include Config.h, or achieve the same effect in some other > way if we cannot. Does this seem reasonable? > > I'm interested in this for lldb in the FreeBSD base system. We have > lua available already (and no python) and I've integrated our liblua > it into lldb, but it required "--script-language lua" on the command > line. For now I'll just change the default to be eScriptLanguageLua in > our tree, but would like to have this "just work" upstream. > ___ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
Re: [lldb-dev] Default script language
I'd be fine with your #ifdef approach. Anyone else? > On Apr 1, 2020, at 2:09 PM, Ed Maste via lldb-dev > wrote: > > In lldb/include/lldb/lldb-enumerations.h we have: > eScriptLanguageDefault = eScriptLanguagePython > > I'd like to do something like: > #if LLDB_ENABLE_PYTHON > eScriptLanguageDefault = eScriptLanguagePython > #elif LLDB_ENABLE_LUA > eScriptLanguageDefault = eScriptLanguageLua > #else > eScriptLanguageDefault = eScriptLanguageNone > #endif > > if we could include Config.h, or achieve the same effect in some other > way if we cannot. Does this seem reasonable? > > I'm interested in this for lldb in the FreeBSD base system. We have > lua available already (and no python) and I've integrated our liblua > it into lldb, but it required "--script-language lua" on the command > line. For now I'll just change the default to be eScriptLanguageLua in > our tree, but would like to have this "just work" upstream. > ___ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
Re: [lldb-dev] Default script language
For scripting to working it must support classes and Swig must support creating bindings for the entire public API. Don't think shell scripting can do that. Greg > On Apr 1, 2020, at 3:24 PM, Marcus Johnson via lldb-dev > wrote: > > Why default to none if python and lua aren't available instead of defaulting > to shell scripting? > >> On Apr 1, 2020, at 5:09 PM, Ed Maste via lldb-dev >> wrote: >> >> In lldb/include/lldb/lldb-enumerations.h we have: >> eScriptLanguageDefault = eScriptLanguagePython >> >> I'd like to do something like: >> #if LLDB_ENABLE_PYTHON >> eScriptLanguageDefault = eScriptLanguagePython >> #elif LLDB_ENABLE_LUA >> eScriptLanguageDefault = eScriptLanguageLua >> #else >> eScriptLanguageDefault = eScriptLanguageNone >> #endif >> >> if we could include Config.h, or achieve the same effect in some other >> way if we cannot. Does this seem reasonable? >> >> I'm interested in this for lldb in the FreeBSD base system. We have >> lua available already (and no python) and I've integrated our liblua >> it into lldb, but it required "--script-language lua" on the command >> line. For now I'll just change the default to be eScriptLanguageLua in >> our tree, but would like to have this "just work" upstream. >> ___ >> lldb-dev mailing list >> lldb-dev@lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev > > ___ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
Re: [lldb-dev] Default script language
Why default to none if python and lua aren't available instead of defaulting to shell scripting? > On Apr 1, 2020, at 5:09 PM, Ed Maste via lldb-dev > wrote: > > In lldb/include/lldb/lldb-enumerations.h we have: > eScriptLanguageDefault = eScriptLanguagePython > > I'd like to do something like: > #if LLDB_ENABLE_PYTHON > eScriptLanguageDefault = eScriptLanguagePython > #elif LLDB_ENABLE_LUA > eScriptLanguageDefault = eScriptLanguageLua > #else > eScriptLanguageDefault = eScriptLanguageNone > #endif > > if we could include Config.h, or achieve the same effect in some other > way if we cannot. Does this seem reasonable? > > I'm interested in this for lldb in the FreeBSD base system. We have > lua available already (and no python) and I've integrated our liblua > it into lldb, but it required "--script-language lua" on the command > line. For now I'll just change the default to be eScriptLanguageLua in > our tree, but would like to have this "just work" upstream. > ___ > lldb-dev mailing list > lldb-dev@lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
[lldb-dev] Default script language
In lldb/include/lldb/lldb-enumerations.h we have: eScriptLanguageDefault = eScriptLanguagePython I'd like to do something like: #if LLDB_ENABLE_PYTHON eScriptLanguageDefault = eScriptLanguagePython #elif LLDB_ENABLE_LUA eScriptLanguageDefault = eScriptLanguageLua #else eScriptLanguageDefault = eScriptLanguageNone #endif if we could include Config.h, or achieve the same effect in some other way if we cannot. Does this seem reasonable? I'm interested in this for lldb in the FreeBSD base system. We have lua available already (and no python) and I've integrated our liblua it into lldb, but it required "--script-language lua" on the command line. For now I'll just change the default to be eScriptLanguageLua in our tree, but would like to have this "just work" upstream. ___ lldb-dev mailing list lldb-dev@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev