summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2016-12-26 20:36:37 +0000
committerdim <dim@FreeBSD.org>2016-12-26 20:36:37 +0000
commit06210ae42d418d50d8d9365d5c9419308ae9e7ee (patch)
treeab60b4cdd6e430dda1f292a46a77ddb744723f31 /contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
parent2dd166267f53df1c3748b4325d294b9b839de74b (diff)
downloadFreeBSD-src-06210ae42d418d50d8d9365d5c9419308ae9e7ee.zip
FreeBSD-src-06210ae42d418d50d8d9365d5c9419308ae9e7ee.tar.gz
MFC r309124:
Upgrade our copies of clang, llvm, lldb, compiler-rt and libc++ to 3.9.0 release, and add lld 3.9.0. Also completely revamp the build system for clang, llvm, lldb and their related tools. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Release notes for llvm, clang and lld are available here: <http://llvm.org/releases/3.9.0/docs/ReleaseNotes.html> <http://llvm.org/releases/3.9.0/tools/clang/docs/ReleaseNotes.html> <http://llvm.org/releases/3.9.0/tools/lld/docs/ReleaseNotes.html> Thanks to Ed Maste, Bryan Drewery, Andrew Turner, Antoine Brodin and Jan Beich for their help. Relnotes: yes MFC r309147: Pull in r282174 from upstream llvm trunk (by Krzysztof Parzyszek): [PPC] Set SP after loading data from stack frame, if no red zone is present Follow-up to r280705: Make sure that the SP is only restored after all data is loaded from the stack frame, if there is no red zone. This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24466 Reported by: Mark Millard PR: 214433 MFC r309149: Pull in r283060 from upstream llvm trunk (by Hal Finkel): [PowerPC] Refactor soft-float support, and enable PPC64 soft float This change enables soft-float for PowerPC64, and also makes soft-float disable all vector instruction sets for both 32-bit and 64-bit modes. This latter part is necessary because the PPC backend canonicalizes many Altivec vector types to floating-point types, and so soft-float breaks scalarization support for many operations. Both for embedded targets and for operating-system kernels desiring soft-float support, it seems reasonable that disabling hardware floating-point also disables vector instructions (embedded targets without hardware floating point support are unlikely to have Altivec, etc. and operating system kernels desiring not to use floating-point registers to lower syscall cost are unlikely to want to use vector registers either). If someone needs this to work, we'll need to change the fact that we promote many Altivec operations to act on v4f32. To make it possible to disable Altivec when soft-float is enabled, hardware floating-point support needs to be expressed as a positive feature, like the others, and not a negative feature, because target features cannot have dependencies on the disabling of some other feature. So +soft-float has now become -hard-float. Fixes PR26970. Pull in r283061 from upstream clang trunk (by Hal Finkel): [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. Reported by: Mark Millard PR: 214433 MFC r309212: Add a few missed clang 3.9.0 files to OptionalObsoleteFiles. MFC r309262: Fix packaging for clang, lldb and lld 3.9.0 During the upgrade of clang/llvm etc to 3.9.0 in r309124, the PACKAGE directive in the usr.bin/clang/*.mk files got dropped accidentally. Restore it, with a few minor changes and additions: * Correct license in clang.ucl to NCSA * Add PACKAGE=clang for clang and most of the "ll" tools * Put lldb in its own package * Put lld in its own package Reviewed by: gjb, jmallett Differential Revision: https://reviews.freebsd.org/D8666 MFC r309656: During the bootstrap phase, when building the minimal llvm library on PowerPC, add lib/Support/Atomic.cpp. This is needed because upstream llvm revision r271821 disabled the use of std::call_once, which causes some fallback functions from Atomic.cpp to be used instead. Reported by: Mark Millard PR: 214902 MFC r309835: Tentatively apply https://reviews.llvm.org/D18730 to work around gcc PR 70528 (bogus error: constructor required before non-static data member). This should fix buildworld with the external gcc package. Reported by: https://jenkins.freebsd.org/job/FreeBSD_HEAD_amd64_gcc/ MFC r310194: Upgrade our copies of clang, llvm, lld, lldb, compiler-rt and libc++ to 3.9.1 release. Please note that from 3.5.0 onwards, clang, llvm and lldb require C++11 support to build; see UPDATING for more information. Release notes for llvm, clang and lld will be available here: <http://releases.llvm.org/3.9.1/docs/ReleaseNotes.html> <http://releases.llvm.org/3.9.1/tools/clang/docs/ReleaseNotes.html> <http://releases.llvm.org/3.9.1/tools/lld/docs/ReleaseNotes.html> Relnotes: yes
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp306
1 files changed, 142 insertions, 164 deletions
diff --git a/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp b/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
index 890d770..b76af20 100644
--- a/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
+++ b/contrib/llvm/tools/lldb/source/Commands/CommandObjectSettings.cpp
@@ -12,6 +12,8 @@
// C Includes
// C++ Includes
// Other libraries and framework includes
+#include "llvm/ADT/StringRef.h"
+
// Project includes
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -20,7 +22,6 @@
using namespace lldb;
using namespace lldb_private;
-#include "llvm/ADT/StringRef.h"
//-------------------------------------------------------------------------
// CommandObjectSettingsSet
@@ -29,12 +30,9 @@ using namespace lldb_private;
class CommandObjectSettingsSet : public CommandObjectRaw
{
public:
- CommandObjectSettingsSet (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "settings set",
- "Set or change the value of a single debugger setting variable.",
- NULL),
- m_options (interpreter)
+ CommandObjectSettingsSet(CommandInterpreter &interpreter)
+ : CommandObjectRaw(interpreter, "settings set", "Set the value of the specified debugger setting.", nullptr),
+ m_options(interpreter)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -82,8 +80,7 @@ insert-before or insert-after."
}
-
- ~CommandObjectSettingsSet () override {}
+ ~CommandObjectSettingsSet() override = default;
// Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
bool
@@ -98,14 +95,13 @@ insert-before or insert-after."
class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options (interpreter),
m_global (false)
{
}
- ~CommandOptions () override {}
+ ~CommandOptions() override = default;
Error
SetOptionValue (uint32_t option_idx, const char *option_arg) override
@@ -160,7 +156,7 @@ insert-before or insert-after."
std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
const size_t argc = input.GetArgumentCount();
- const char *arg = NULL;
+ const char *arg = nullptr;
int setting_var_idx;
for (setting_var_idx = 1; setting_var_idx < static_cast<int>(argc);
++setting_var_idx)
@@ -172,14 +168,14 @@ insert-before or insert-after."
if (cursor_index == setting_var_idx)
{
// Attempting to complete setting variable name
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
}
else
{
@@ -231,7 +227,7 @@ protected:
}
const char *var_name = cmd_args.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings set' command requires a valid variable name");
result.SetStatus (eReturnStatusFailed);
@@ -246,10 +242,10 @@ protected:
Error error;
if (m_options.m_global)
{
- error = m_interpreter.GetDebugger().SetPropertyValue (NULL,
- eVarSetOperationAssign,
- var_name,
- var_value_cstr);
+ error = m_interpreter.GetDebugger().SetPropertyValue(nullptr,
+ eVarSetOperationAssign,
+ var_name,
+ var_value_cstr);
}
if (error.Success())
@@ -280,6 +276,7 @@ protected:
return result.Succeeded();
}
+
private:
CommandOptions m_options;
};
@@ -287,11 +284,10 @@ private:
OptionDefinition
CommandObjectSettingsSet::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_2, false, "global", 'g', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Apply the new value to the global default value." },
- { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_2, false, "global", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Apply the new value to the global default value." },
+ { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr }
};
-
//-------------------------------------------------------------------------
// CommandObjectSettingsShow -- Show current values
//-------------------------------------------------------------------------
@@ -299,11 +295,10 @@ CommandObjectSettingsSet::CommandOptions::g_option_table[] =
class CommandObjectSettingsShow : public CommandObjectParsed
{
public:
- CommandObjectSettingsShow (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "settings show",
- "Show the specified internal debugger setting variable and its value, or show all the currently set variables and their values, if nothing is specified.",
- NULL)
+ CommandObjectSettingsShow(CommandInterpreter &interpreter)
+ : CommandObjectParsed(
+ interpreter, "settings show",
+ "Show matching debugger settings and their current values. Defaults to showing all settings.", nullptr)
{
CommandArgumentEntry arg1;
CommandArgumentData var_name_arg;
@@ -319,8 +314,7 @@ public:
m_arguments.push_back (arg1);
}
- ~CommandObjectSettingsShow () override {}
-
+ ~CommandObjectSettingsShow() override = default;
int
HandleArgumentCompletion (Args &input,
@@ -334,14 +328,14 @@ public:
{
std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -354,7 +348,7 @@ protected:
const size_t argc = args.GetArgumentCount ();
if (argc > 0)
{
- for (size_t i=0; i<argc; ++i)
+ for (size_t i = 0; i < argc; ++i)
{
const char *property_path = args.GetArgumentAtIndex (i);
@@ -385,12 +379,11 @@ protected:
class CommandObjectSettingsList : public CommandObjectParsed
{
-public:
- CommandObjectSettingsList (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "settings list",
- "List and describe all the internal debugger settings variables that are available to the user to 'set' or 'show', or describe a particular variable or set of variables (by specifying the variable name or a common prefix).",
- NULL)
+public:
+ CommandObjectSettingsList(CommandInterpreter &interpreter)
+ : CommandObjectParsed(interpreter, "settings list",
+ "List and describe matching debugger settings. Defaults to all listing all settings.",
+ nullptr)
{
CommandArgumentEntry arg;
CommandArgumentData var_name_arg;
@@ -411,7 +404,7 @@ public:
m_arguments.push_back (arg);
}
- ~CommandObjectSettingsList () override {}
+ ~CommandObjectSettingsList() override = default;
int
HandleArgumentCompletion (Args &input,
@@ -425,14 +418,14 @@ public:
{
std::string completion_str (input.GetArgumentAtIndex (cursor_index), cursor_char_position);
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -448,7 +441,7 @@ protected:
{
const bool dump_qualified_name = true;
- for (size_t i=0; i<argc; ++i)
+ for (size_t i = 0; i < argc; ++i)
{
const char *property_path = args.GetArgumentAtIndex (i);
@@ -481,11 +474,9 @@ protected:
class CommandObjectSettingsRemove : public CommandObjectRaw
{
public:
- CommandObjectSettingsRemove (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "settings remove",
- "Remove the specified element from an array or dictionary settings variable.",
- NULL)
+ CommandObjectSettingsRemove(CommandInterpreter &interpreter)
+ : CommandObjectRaw(interpreter, "settings remove",
+ "Remove a value from a setting, specified by array index or dictionary key.", nullptr)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -517,7 +508,7 @@ public:
m_arguments.push_back (arg2);
}
- ~CommandObjectSettingsRemove () override {}
+ ~CommandObjectSettingsRemove() override = default;
int
HandleArgumentCompletion (Args &input,
@@ -533,14 +524,14 @@ public:
// Attempting to complete variable name
if (cursor_index < 2)
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -566,7 +557,7 @@ protected:
}
const char *var_name = cmd_args.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings set' command requires a valid variable name");
result.SetStatus (eReturnStatusFailed);
@@ -600,11 +591,9 @@ protected:
class CommandObjectSettingsReplace : public CommandObjectRaw
{
public:
- CommandObjectSettingsReplace (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "settings replace",
- "Replace the specified element from an internal debugger settings array or dictionary variable with the specified new value.",
- NULL)
+ CommandObjectSettingsReplace(CommandInterpreter &interpreter)
+ : CommandObjectRaw(interpreter, "settings replace",
+ "Replace the debugger setting value specified by array index or dictionary key.", nullptr)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -646,8 +635,7 @@ public:
m_arguments.push_back (arg3);
}
-
- ~CommandObjectSettingsReplace () override {}
+ ~CommandObjectSettingsReplace() override = default;
// Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
bool
@@ -667,14 +655,14 @@ public:
// Attempting to complete variable name
if (cursor_index < 2)
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -687,14 +675,13 @@ protected:
Args cmd_args(command);
const char *var_name = cmd_args.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings replace' command requires a valid variable name; No value supplied");
result.SetStatus (eReturnStatusFailed);
return false;
}
-
// Split the raw command into var_name, index_value, and value triple.
llvm::StringRef raw_str(command);
std::string var_value_string = raw_str.split(var_name).second.str();
@@ -727,11 +714,11 @@ protected:
class CommandObjectSettingsInsertBefore : public CommandObjectRaw
{
public:
- CommandObjectSettingsInsertBefore (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "settings insert-before",
- "Insert value(s) into an internal debugger settings array variable, immediately before the specified element.",
- NULL)
+ CommandObjectSettingsInsertBefore(CommandInterpreter &interpreter)
+ : CommandObjectRaw(interpreter, "settings insert-before", "Insert one or more values into an debugger array "
+ "setting immediately before the specified element "
+ "index.",
+ nullptr)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -767,7 +754,7 @@ public:
m_arguments.push_back (arg3);
}
- ~CommandObjectSettingsInsertBefore () override {}
+ ~CommandObjectSettingsInsertBefore() override = default;
// Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
bool
@@ -787,14 +774,14 @@ public:
// Attempting to complete variable name
if (cursor_index < 2)
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -816,7 +803,7 @@ protected:
}
const char *var_name = cmd_args.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings insert-before' command requires a valid variable name; No value supplied");
result.SetStatus (eReturnStatusFailed);
@@ -850,11 +837,10 @@ protected:
class CommandObjectSettingsInsertAfter : public CommandObjectRaw
{
public:
- CommandObjectSettingsInsertAfter (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "settings insert-after",
- "Insert value(s) into an internal debugger settings array variable, immediately after the specified element.",
- NULL)
+ CommandObjectSettingsInsertAfter(CommandInterpreter &interpreter)
+ : CommandObjectRaw(
+ interpreter, "settings insert-after",
+ "Insert one or more values into a debugger array settings after the specified element index.", nullptr)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -890,7 +876,7 @@ public:
m_arguments.push_back (arg3);
}
- ~CommandObjectSettingsInsertAfter () override {}
+ ~CommandObjectSettingsInsertAfter() override = default;
// Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
bool
@@ -910,14 +896,14 @@ public:
// Attempting to complete variable name
if (cursor_index < 2)
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -939,7 +925,7 @@ protected:
}
const char *var_name = cmd_args.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings insert-after' command requires a valid variable name; No value supplied");
result.SetStatus (eReturnStatusFailed);
@@ -973,11 +959,9 @@ protected:
class CommandObjectSettingsAppend : public CommandObjectRaw
{
public:
- CommandObjectSettingsAppend (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "settings append",
- "Append a new value to the end of an internal debugger settings array, dictionary or string variable.",
- NULL)
+ CommandObjectSettingsAppend(CommandInterpreter &interpreter)
+ : CommandObjectRaw(interpreter, "settings append",
+ "Append one or more values to a debugger array, dictionary, or string setting.", nullptr)
{
CommandArgumentEntry arg1;
CommandArgumentEntry arg2;
@@ -1003,7 +987,7 @@ public:
m_arguments.push_back (arg2);
}
- ~CommandObjectSettingsAppend () override {}
+ ~CommandObjectSettingsAppend() override = default;
// Overrides base class's behavior where WantsCompletion = !WantsRawCommandString.
bool
@@ -1023,14 +1007,14 @@ public:
// Attempting to complete variable name
if (cursor_index < 2)
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -1051,7 +1035,7 @@ protected:
}
const char *var_name = cmd_args.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings append' command requires a valid variable name; No value supplied");
result.SetStatus (eReturnStatusFailed);
@@ -1088,11 +1072,9 @@ protected:
class CommandObjectSettingsClear : public CommandObjectParsed
{
public:
- CommandObjectSettingsClear (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "settings clear",
- "Erase all the contents of an internal debugger settings variables; this is only valid for variables with clearable types, i.e. strings, arrays or dictionaries.",
- NULL)
+ CommandObjectSettingsClear(CommandInterpreter &interpreter)
+ : CommandObjectParsed(interpreter, "settings clear", "Clear a debugger setting array, dictionary, or string.",
+ nullptr)
{
CommandArgumentEntry arg;
CommandArgumentData var_name_arg;
@@ -1108,7 +1090,7 @@ public:
m_arguments.push_back (arg);
}
- ~CommandObjectSettingsClear () override {}
+ ~CommandObjectSettingsClear() override = default;
int
HandleArgumentCompletion (Args &input,
@@ -1124,14 +1106,14 @@ public:
// Attempting to complete variable name
if (cursor_index < 2)
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eSettingsNameCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -1151,17 +1133,17 @@ protected:
}
const char *var_name = command.GetArgumentAtIndex (0);
- if ((var_name == NULL) || (var_name[0] == '\0'))
+ if ((var_name == nullptr) || (var_name[0] == '\0'))
{
result.AppendError ("'settings clear' command requires a valid variable name; No value supplied");
result.SetStatus (eReturnStatusFailed);
return false;
}
- Error error (m_interpreter.GetDebugger().SetPropertyValue (&m_exe_ctx,
- eVarSetOperationClear,
- var_name,
- NULL));
+ Error error(m_interpreter.GetDebugger().SetPropertyValue(&m_exe_ctx,
+ eVarSetOperationClear,
+ var_name,
+ nullptr));
if (error.Fail())
{
result.AppendError (error.AsCString());
@@ -1177,11 +1159,9 @@ protected:
// CommandObjectMultiwordSettings
//-------------------------------------------------------------------------
-CommandObjectMultiwordSettings::CommandObjectMultiwordSettings (CommandInterpreter &interpreter) :
- CommandObjectMultiword (interpreter,
- "settings",
- "A set of commands for manipulating internal settable debugger variables.",
- "settings <command> [<command-options>]")
+CommandObjectMultiwordSettings::CommandObjectMultiwordSettings(CommandInterpreter &interpreter)
+ : CommandObjectMultiword(interpreter, "settings", "Commands for managing LLDB settings.",
+ "settings <subcommand> [<command-options>]")
{
LoadSubCommand ("set", CommandObjectSP (new CommandObjectSettingsSet (interpreter)));
LoadSubCommand ("show", CommandObjectSP (new CommandObjectSettingsShow (interpreter)));
@@ -1194,6 +1174,4 @@ CommandObjectMultiwordSettings::CommandObjectMultiwordSettings (CommandInterpret
LoadSubCommand ("clear", CommandObjectSP (new CommandObjectSettingsClear (interpreter)));
}
-CommandObjectMultiwordSettings::~CommandObjectMultiwordSettings ()
-{
-}
+CommandObjectMultiwordSettings::~CommandObjectMultiwordSettings() = default;
OpenPOWER on IntegriCloud