summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-12-21 17:21:30 -0800
committerJonas Devlieghere <jonas@devlieghere.com>2019-12-21 17:21:32 -0800
commit8983d69144d14d6477c377bb91e9c7224e32f753 (patch)
treeedced6ee7a2b680493d68a4738dc88dadb4de983 /lldb/source/Commands/CommandObjectBreakpointCommand.cpp
parentbbf70c046789f4403a9c02fc5558708ef19073cf (diff)
downloadbcm5719-llvm-8983d69144d14d6477c377bb91e9c7224e32f753.tar.gz
bcm5719-llvm-8983d69144d14d6477c377bb91e9c7224e32f753.zip
[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.
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpointCommand.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectBreakpointCommand.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
index 5151181a622..0cc46a96489 100644
--- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -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;
OpenPOWER on IntegriCloud