mirror of
https://github.com/intel/llvm.git
synced 2026-01-14 03:50:17 +08:00
[lldb/Commands] Fix bogus enum entry and add Lua (NFC)
Fixes a bogus enum value for the scripting language options, adds an entry for Lua and refactored the code to use an exhaustive switch.
This commit is contained in:
@@ -38,7 +38,12 @@ static constexpr OptionEnumValueElement g_script_option_enumeration[] = {
|
||||
"Commands are in the Python language.",
|
||||
},
|
||||
{
|
||||
eSortOrderByName,
|
||||
eScriptLanguageLua,
|
||||
"lua",
|
||||
"Commands are in the Lua language.",
|
||||
},
|
||||
{
|
||||
eScriptLanguageDefault,
|
||||
"default-script",
|
||||
"Commands are in the default scripting language.",
|
||||
},
|
||||
@@ -297,12 +302,14 @@ are no syntax errors may indicate that a function was declared but never called.
|
||||
option_arg,
|
||||
g_breakpoint_command_add_options[option_idx].enum_values,
|
||||
eScriptLanguageNone, error);
|
||||
|
||||
if (m_script_language == eScriptLanguagePython ||
|
||||
m_script_language == eScriptLanguageDefault) {
|
||||
switch (m_script_language) {
|
||||
case eScriptLanguagePython:
|
||||
case eScriptLanguageLua:
|
||||
m_use_script_language = true;
|
||||
} else {
|
||||
break;
|
||||
case eScriptLanguageNone:
|
||||
m_use_script_language = false;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user