[Lldb-commits] [lldb] r261356 - Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.
Eugene Zelenko via lldb-commits
lldb-commits at lists.llvm.org
Fri Feb 19 11:33:46 PST 2016
Author: eugenezelenko
Date: Fri Feb 19 13:33:46 2016
New Revision: 261356
URL: http://llvm.org/viewvc/llvm-project?rev=261356&view=rev
Log:
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.
Modified:
lldb/trunk/source/Commands/CommandCompletions.cpp
lldb/trunk/source/Commands/CommandObjectApropos.cpp
lldb/trunk/source/Commands/CommandObjectArgs.cpp
lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
lldb/trunk/source/Commands/CommandObjectExpression.cpp
lldb/trunk/source/Commands/CommandObjectFrame.cpp
Modified: lldb/trunk/source/Commands/CommandCompletions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandCompletions.cpp?rev=261356&r1=261355&r2=261356&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandCompletions.cpp (original)
+++ lldb/trunk/source/Commands/CommandCompletions.cpp Fri Feb 19 13:33:46 2016
@@ -15,6 +15,8 @@
// C++ Includes
// Other libraries and framework includes
+#include "llvm/ADT/SmallString.h"
+
// Project includes
#include "lldb/Host/FileSpec.h"
#include "lldb/Core/FileSpecList.h"
@@ -29,14 +31,12 @@
#include "lldb/Target/Target.h"
#include "lldb/Utility/CleanUp.h"
-#include "llvm/ADT/SmallString.h"
-
using namespace lldb_private;
CommandCompletions::CommonCompletionElement
CommandCompletions::g_common_completions[] =
{
- {eCustomCompletion, NULL},
+ {eCustomCompletion, nullptr},
{eSourceFileCompletion, CommandCompletions::SourceFiles},
{eDiskFileCompletion, CommandCompletions::DiskFiles},
{eDiskDirectoryCompletion, CommandCompletions::DiskDirectories},
@@ -46,21 +46,18 @@ CommandCompletions::g_common_completions
{ePlatformPluginCompletion, CommandCompletions::PlatformPluginNames},
{eArchitectureCompletion, CommandCompletions::ArchitectureNames},
{eVariablePathCompletion, CommandCompletions::VariablePath},
- {eNoCompletion, NULL} // This one has to be last in the list.
+ {eNoCompletion, nullptr} // This one has to be last in the list.
};
bool
-CommandCompletions::InvokeCommonCompletionCallbacks
-(
- CommandInterpreter &interpreter,
- uint32_t completion_mask,
- const char *completion_str,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher,
- bool &word_complete,
- StringList &matches
-)
+CommandCompletions::InvokeCommonCompletionCallbacks(CommandInterpreter &interpreter,
+ uint32_t completion_mask,
+ const char *completion_str,
+ int match_start_point,
+ int max_return_elements,
+ SearchFilter *searcher,
+ bool &word_complete,
+ StringList &matches)
{
bool handled = false;
@@ -72,7 +69,7 @@ CommandCompletions::InvokeCommonCompleti
if (g_common_completions[i].type == eNoCompletion)
break;
else if ((g_common_completions[i].type & completion_mask) == g_common_completions[i].type
- && g_common_completions[i].callback != NULL)
+ && g_common_completions[i].callback != nullptr)
{
handled = true;
g_common_completions[i].callback (interpreter,
@@ -88,16 +85,13 @@ CommandCompletions::InvokeCommonCompleti
}
int
-CommandCompletions::SourceFiles
-(
- CommandInterpreter &interpreter,
- const char *partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher,
- bool &word_complete,
- StringList &matches
-)
+CommandCompletions::SourceFiles(CommandInterpreter &interpreter,
+ const char *partial_file_name,
+ int match_start_point,
+ int max_return_elements,
+ SearchFilter *searcher,
+ bool &word_complete,
+ StringList &matches)
{
word_complete = true;
// Find some way to switch "include support files..."
@@ -108,7 +102,7 @@ CommandCompletions::SourceFiles
max_return_elements,
matches);
- if (searcher == NULL)
+ if (searcher == nullptr)
{
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
SearchFilterForUnconstrainedSearches null_searcher (target_sp);
@@ -187,13 +181,10 @@ FileSpec::EnumerateDirectoryResult DiskF
}
static int
-DiskFilesOrDirectories
-(
- const char *partial_file_name,
- bool only_directories,
- bool &saw_directory,
- StringList &matches
-)
+DiskFilesOrDirectories(const char *partial_file_name,
+ bool only_directories,
+ bool &saw_directory,
+ StringList &matches)
{
// I'm going to use the "glob" function with GLOB_TILDE for user directory expansion.
// If it is not defined on your host system, you'll need to implement it yourself...
@@ -224,7 +215,7 @@ DiskFilesOrDirectories
// This will store the resolved form of the containing directory
llvm::SmallString<64> containing_part;
- if (end_ptr == NULL)
+ if (end_ptr == nullptr)
{
// There's no directory. If the thing begins with a "~" then this is a bare
// user name.
@@ -312,18 +303,14 @@ DiskFilesOrDirectories
}
int
-CommandCompletions::DiskFiles
-(
- CommandInterpreter &interpreter,
- const char *partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher,
- bool &word_complete,
- StringList &matches
-)
+CommandCompletions::DiskFiles(CommandInterpreter &interpreter,
+ const char *partial_file_name,
+ int match_start_point,
+ int max_return_elements,
+ SearchFilter *searcher,
+ bool &word_complete,
+ StringList &matches)
{
-
int ret_val = DiskFilesOrDirectories (partial_file_name,
false,
word_complete,
@@ -333,16 +320,13 @@ CommandCompletions::DiskFiles
}
int
-CommandCompletions::DiskDirectories
-(
- CommandInterpreter &interpreter,
- const char *partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher,
- bool &word_complete,
- StringList &matches
-)
+CommandCompletions::DiskDirectories(CommandInterpreter &interpreter,
+ const char *partial_file_name,
+ int match_start_point,
+ int max_return_elements,
+ SearchFilter *searcher,
+ bool &word_complete,
+ StringList &matches)
{
int ret_val = DiskFilesOrDirectories (partial_file_name,
true,
@@ -353,16 +337,13 @@ CommandCompletions::DiskDirectories
}
int
-CommandCompletions::Modules
-(
- CommandInterpreter &interpreter,
- const char *partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher,
- bool &word_complete,
- StringList &matches
-)
+CommandCompletions::Modules(CommandInterpreter &interpreter,
+ const char *partial_file_name,
+ int match_start_point,
+ int max_return_elements,
+ SearchFilter *searcher,
+ bool &word_complete,
+ StringList &matches)
{
word_complete = true;
ModuleCompleter completer (interpreter,
@@ -371,7 +352,7 @@ CommandCompletions::Modules
max_return_elements,
matches);
- if (searcher == NULL)
+ if (searcher == nullptr)
{
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
SearchFilterForUnconstrainedSearches null_searcher (target_sp);
@@ -385,15 +366,13 @@ CommandCompletions::Modules
}
int
-CommandCompletions::Symbols
-(
- CommandInterpreter &interpreter,
- const char *partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher,
- bool &word_complete,
- StringList &matches)
+CommandCompletions::Symbols(CommandInterpreter &interpreter,
+ const char *partial_file_name,
+ int match_start_point,
+ int max_return_elements,
+ SearchFilter *searcher,
+ bool &word_complete,
+ StringList &matches)
{
word_complete = true;
SymbolCompleter completer (interpreter,
@@ -402,7 +381,7 @@ CommandCompletions::Symbols
max_return_elements,
matches);
- if (searcher == NULL)
+ if (searcher == nullptr)
{
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
SearchFilterForUnconstrainedSearches null_searcher (target_sp);
@@ -433,7 +412,7 @@ CommandCompletions::SettingsNames (Comma
if (properties_sp)
{
StreamString strm;
- properties_sp->DumpValue(NULL, strm, OptionValue::eDumpOptionName);
+ properties_sp->DumpValue(nullptr, strm, OptionValue::eDumpOptionName);
const std::string &str = strm.GetString();
g_property_names.SplitIntoLines(str.c_str(), str.size());
}
@@ -445,7 +424,6 @@ CommandCompletions::SettingsNames (Comma
return num_matches;
}
-
int
CommandCompletions::PlatformPluginNames (CommandInterpreter &interpreter,
const char *partial_name,
@@ -474,7 +452,6 @@ CommandCompletions::ArchitectureNames (C
return num_matches;
}
-
int
CommandCompletions::VariablePath (CommandInterpreter &interpreter,
const char *partial_name,
@@ -487,15 +464,11 @@ CommandCompletions::VariablePath (Comman
return Variable::AutoComplete (interpreter.GetExecutionContext(), partial_name, matches, word_complete);
}
-
-CommandCompletions::Completer::Completer
-(
- CommandInterpreter &interpreter,
- const char *completion_str,
- int match_start_point,
- int max_return_elements,
- StringList &matches
-) :
+CommandCompletions::Completer::Completer(CommandInterpreter &interpreter,
+ const char *completion_str,
+ int match_start_point,
+ int max_return_elements,
+ StringList &matches) :
m_interpreter (interpreter),
m_completion_str (completion_str),
m_match_start_point (match_start_point),
@@ -504,24 +477,18 @@ CommandCompletions::Completer::Completer
{
}
-CommandCompletions::Completer::~Completer ()
-{
-
-}
+CommandCompletions::Completer::~Completer() = default;
//----------------------------------------------------------------------
// SourceFileCompleter
//----------------------------------------------------------------------
-CommandCompletions::SourceFileCompleter::SourceFileCompleter
-(
- CommandInterpreter &interpreter,
- bool include_support_files,
- const char *completion_str,
- int match_start_point,
- int max_return_elements,
- StringList &matches
-) :
+CommandCompletions::SourceFileCompleter::SourceFileCompleter(CommandInterpreter &interpreter,
+ bool include_support_files,
+ const char *completion_str,
+ int match_start_point,
+ int max_return_elements,
+ StringList &matches) :
CommandCompletions::Completer (interpreter, completion_str, match_start_point, max_return_elements, matches),
m_include_support_files (include_support_files),
m_matching_files()
@@ -538,14 +505,12 @@ CommandCompletions::SourceFileCompleter:
}
Searcher::CallbackReturn
-CommandCompletions::SourceFileCompleter::SearchCallback (
- SearchFilter &filter,
- SymbolContext &context,
- Address *addr,
- bool complete
-)
+CommandCompletions::SourceFileCompleter::SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr,
+ bool complete)
{
- if (context.comp_unit != NULL)
+ if (context.comp_unit != nullptr)
{
if (m_include_support_files)
{
@@ -568,7 +533,6 @@ CommandCompletions::SourceFileCompleter:
m_matching_files.AppendIfUnique(sfile_spec);
}
}
-
}
else
{
@@ -603,7 +567,6 @@ CommandCompletions::SourceFileCompleter:
m_matches.AppendString (m_matching_files.GetFileSpecAtIndex(i).GetFilename().GetCString());
}
return m_matches.GetSize();
-
}
//----------------------------------------------------------------------
@@ -613,29 +576,24 @@ CommandCompletions::SourceFileCompleter:
static bool
regex_chars (const char comp)
{
- if (comp == '[' || comp == ']' ||
- comp == '(' || comp == ')' ||
- comp == '{' || comp == '}' ||
- comp == '+' ||
- comp == '.' ||
- comp == '*' ||
- comp == '|' ||
- comp == '^' ||
- comp == '$' ||
- comp == '\\' ||
- comp == '?')
- return true;
- else
- return false;
-}
-CommandCompletions::SymbolCompleter::SymbolCompleter
-(
- CommandInterpreter &interpreter,
- const char *completion_str,
- int match_start_point,
- int max_return_elements,
- StringList &matches
-) :
+ return (comp == '[' || comp == ']' ||
+ comp == '(' || comp == ')' ||
+ comp == '{' || comp == '}' ||
+ comp == '+' ||
+ comp == '.' ||
+ comp == '*' ||
+ comp == '|' ||
+ comp == '^' ||
+ comp == '$' ||
+ comp == '\\' ||
+ comp == '?');
+}
+
+CommandCompletions::SymbolCompleter::SymbolCompleter(CommandInterpreter &interpreter,
+ const char *completion_str,
+ int match_start_point,
+ int max_return_elements,
+ StringList &matches) :
CommandCompletions::Completer (interpreter, completion_str, match_start_point, max_return_elements, matches)
{
std::string regex_str;
@@ -665,12 +623,10 @@ CommandCompletions::SymbolCompleter::Get
}
Searcher::CallbackReturn
-CommandCompletions::SymbolCompleter::SearchCallback (
- SearchFilter &filter,
- SymbolContext &context,
- Address *addr,
- bool complete
-)
+CommandCompletions::SymbolCompleter::SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr,
+ bool complete)
{
if (context.module_sp)
{
@@ -709,14 +665,11 @@ CommandCompletions::SymbolCompleter::DoC
//----------------------------------------------------------------------
// ModuleCompleter
//----------------------------------------------------------------------
-CommandCompletions::ModuleCompleter::ModuleCompleter
-(
- CommandInterpreter &interpreter,
- const char *completion_str,
- int match_start_point,
- int max_return_elements,
- StringList &matches
-) :
+CommandCompletions::ModuleCompleter::ModuleCompleter(CommandInterpreter &interpreter,
+ const char *completion_str,
+ int match_start_point,
+ int max_return_elements,
+ StringList &matches) :
CommandCompletions::Completer (interpreter, completion_str, match_start_point, max_return_elements, matches)
{
FileSpec partial_spec (m_completion_str.c_str(), false);
@@ -731,12 +684,10 @@ CommandCompletions::ModuleCompleter::Get
}
Searcher::CallbackReturn
-CommandCompletions::ModuleCompleter::SearchCallback (
- SearchFilter &filter,
- SymbolContext &context,
- Address *addr,
- bool complete
-)
+CommandCompletions::ModuleCompleter::SearchCallback(SearchFilter &filter,
+ SymbolContext &context,
+ Address *addr,
+ bool complete)
{
if (context.module_sp)
{
Modified: lldb/trunk/source/Commands/CommandObjectApropos.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectApropos.cpp?rev=261356&r1=261355&r2=261356&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectApropos.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectApropos.cpp Fri Feb 19 13:33:46 2016
@@ -7,16 +7,14 @@
//
//===----------------------------------------------------------------------===//
-#include "CommandObjectApropos.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "CommandObjectApropos.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/Property.h"
-
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -28,10 +26,10 @@ using namespace lldb_private;
//-------------------------------------------------------------------------
CommandObjectApropos::CommandObjectApropos (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "apropos",
- "Find a list of debugger commands related to a particular word/subject.",
- NULL)
+ CommandObjectParsed(interpreter,
+ "apropos",
+ "Find a list of debugger commands related to a particular word/subject.",
+ nullptr)
{
CommandArgumentEntry arg;
CommandArgumentData search_word_arg;
@@ -47,10 +45,7 @@ CommandObjectApropos::CommandObjectAprop
m_arguments.push_back (arg);
}
-CommandObjectApropos::~CommandObjectApropos()
-{
-}
-
+CommandObjectApropos::~CommandObjectApropos() = default;
bool
CommandObjectApropos::DoExecute (Args& args, CommandReturnObject &result)
@@ -60,7 +55,7 @@ CommandObjectApropos::DoExecute (Args& a
if (argc == 1)
{
const char *search_word = args.GetArgumentAtIndex(0);
- if ((search_word != NULL)
+ if ((search_word != nullptr)
&& (strlen (search_word) > 0))
{
// The bulk of the work must be done inside the Command Interpreter, since the command dictionary
@@ -120,10 +115,8 @@ CommandObjectApropos::DoExecute (Args& a
user_commands_help.GetStringAtIndex(i),
max_len);
}
-
}
-
std::vector<const Property *> properties;
const size_t num_properties = m_interpreter.GetDebugger().Apropos(search_word, properties);
if (num_properties)
Modified: lldb/trunk/source/Commands/CommandObjectArgs.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectArgs.cpp?rev=261356&r1=261355&r2=261356&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectArgs.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectArgs.cpp Fri Feb 19 13:33:46 2016
@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "CommandObjectArgs.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "CommandObjectArgs.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
@@ -44,10 +43,7 @@ CommandObjectArgs::CommandOptions::Comma
OptionParsingStarting();
}
-
-CommandObjectArgs::CommandOptions::~CommandOptions ()
-{
-}
+CommandObjectArgs::CommandOptions::~CommandOptions() = default;
Error
CommandObjectArgs::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
@@ -80,9 +76,7 @@ CommandObjectArgs::CommandObjectArgs (Co
{
}
-CommandObjectArgs::~CommandObjectArgs ()
-{
-}
+CommandObjectArgs::~CommandObjectArgs() = default;
Options *
CommandObjectArgs::GetOptions ()
@@ -94,8 +88,7 @@ bool
CommandObjectArgs::DoExecute (Args& args, CommandReturnObject &result)
{
ConstString target_triple;
-
-
+
Process *process = m_exe_ctx.GetProcessPtr();
if (!process)
{
@@ -263,7 +256,6 @@ CommandObjectArgs::DoExecute (Args& args
OptionDefinition
CommandObjectArgs::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, false, "debug", 'g', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone, "Enable verbose debug logging of the expression parsing and evaluation."},
- { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_1, false, "debug", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Enable verbose debug logging of the expression parsing and evaluation."},
+ { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr }
};
-
Modified: lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp?rev=261356&r1=261355&r2=261356&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectBreakpointCommand.cpp Fri Feb 19 13:33:46 2016
@@ -9,11 +9,10 @@
// C Includes
// C++ Includes
-
-
+// Other libraries and framework includes
+// Project includes
#include "CommandObjectBreakpointCommand.h"
#include "CommandObjectBreakpoint.h"
-
#include "lldb/Core/IOHandler.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -32,19 +31,17 @@ using namespace lldb_private;
// CommandObjectBreakpointCommandAdd
//-------------------------------------------------------------------------
-
class CommandObjectBreakpointCommandAdd :
public CommandObjectParsed,
public IOHandlerDelegateMultiline
{
public:
-
CommandObjectBreakpointCommandAdd (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "add",
- "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit."
- " If no breakpoint is specified, adds the commands to the last created breakpoint.",
- NULL),
+ CommandObjectParsed(interpreter,
+ "add",
+ "Add a set of commands to a breakpoint, to be executed whenever the breakpoint is hit."
+ " If no breakpoint is specified, adds the commands to the last created breakpoint.",
+ nullptr),
IOHandlerDelegateMultiline ("DONE", IOHandlerDelegate::Completion::LLDBCommand),
m_options (interpreter)
{
@@ -178,7 +175,7 @@ are no syntax errors may indicate that a
m_arguments.push_back (arg);
}
- ~CommandObjectBreakpointCommandAdd () override {}
+ ~CommandObjectBreakpointCommandAdd() override = default;
Options *
GetOptions () override
@@ -196,8 +193,7 @@ are no syntax errors may indicate that a
output_sp->Flush();
}
}
-
-
+
void
IOHandlerInputComplete (IOHandler &io_handler, std::string &line) override
{
@@ -210,7 +206,7 @@ are no syntax errors may indicate that a
continue;
std::unique_ptr<BreakpointOptions::CommandData> data_ap(new BreakpointOptions::CommandData());
- if (data_ap.get())
+ if (data_ap)
{
data_ap->user_source.SplitIntoLines (line.c_str(), line.size());
BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release()));
@@ -248,7 +244,6 @@ are no syntax errors may indicate that a
BatonSP baton_sp (new BreakpointOptions::CommandBaton (data_ap.release()));
bp_options->SetCallback (BreakpointOptionsCallbackFunction, baton_sp);
}
- return;
}
static bool
@@ -258,10 +253,9 @@ are no syntax errors may indicate that a
lldb::user_id_t break_loc_id)
{
bool ret_value = true;
- if (baton == NULL)
+ if (baton == nullptr)
return true;
-
-
+
BreakpointOptions::CommandData *data = (BreakpointOptions::CommandData *) baton;
StringList &commands = data->user_source;
@@ -302,7 +296,6 @@ are no syntax errors may indicate that a
class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options (interpreter),
m_use_commands (false),
@@ -314,7 +307,7 @@ are no syntax errors may indicate that a
{
}
- ~CommandOptions () override {}
+ ~CommandOptions() override = default;
Error
SetOptionValue (uint32_t option_idx, const char *option_arg) override
@@ -355,11 +348,9 @@ are no syntax errors may indicate that a
break;
case 'F':
- {
- m_use_one_liner = false;
- m_use_script_language = true;
- m_function_name.assign(option_arg);
- }
+ m_use_one_liner = false;
+ m_use_script_language = true;
+ m_function_name.assign(option_arg);
break;
case 'D':
@@ -371,6 +362,7 @@ are no syntax errors may indicate that a
}
return error;
}
+
void
OptionParsingStarting () override
{
@@ -415,7 +407,7 @@ protected:
{
Target *target = GetSelectedOrDummyTarget(m_options.m_use_dummy);
- if (target == NULL)
+ if (target == nullptr)
{
result.AppendError ("There is not a current executable; there are no breakpoints to which to add commands");
result.SetStatus (eReturnStatusFailed);
@@ -432,7 +424,7 @@ protected:
return false;
}
- if (m_options.m_use_script_language == false && m_options.m_function_name.size())
+ if (!m_options.m_use_script_language && !m_options.m_function_name.empty())
{
result.AppendError ("need to enable scripting to have a function run as a breakpoint command");
result.SetStatus (eReturnStatusFailed);
@@ -454,7 +446,7 @@ protected:
if (cur_bp_id.GetBreakpointID() != LLDB_INVALID_BREAK_ID)
{
Breakpoint *bp = target->GetBreakpointByID (cur_bp_id.GetBreakpointID()).get();
- BreakpointOptions *bp_options = NULL;
+ BreakpointOptions *bp_options = nullptr;
if (cur_bp_id.GetLocationID() == LLDB_INVALID_BREAK_ID)
{
// This breakpoint does not have an associated location.
@@ -485,7 +477,7 @@ protected:
script_interp->SetBreakpointCommandCallback (m_bp_options_vec,
m_options.m_one_liner.c_str());
}
- else if (m_options.m_function_name.size())
+ else if (!m_options.m_function_name.empty())
{
script_interp->SetBreakpointCommandCallbackFunction (m_bp_options_vec,
m_options.m_function_name.c_str());
@@ -506,7 +498,6 @@ protected:
CollectDataForBreakpointCommandCallback (m_bp_options_vec,
result);
}
-
}
return result.Succeeded();
@@ -526,7 +517,6 @@ private:
// so it isn't worthwhile to come up with a more complex mechanism
// to address this particular weakness right now.
static const char *g_reader_instructions;
-
};
const char *
@@ -541,28 +531,28 @@ g_script_option_enumeration[4] =
{ eScriptLanguageNone, "command", "Commands are in the lldb command interpreter language"},
{ eScriptLanguagePython, "python", "Commands are in the Python language."},
{ eSortOrderByName, "default-script", "Commands are in the default scripting language."},
- { 0, NULL, NULL }
+ { 0, nullptr, nullptr }
};
OptionDefinition
CommandObjectBreakpointCommandAdd::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, false, "one-liner", 'o', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeOneLiner,
+ { LLDB_OPT_SET_1, false, "one-liner", 'o', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeOneLiner,
"Specify a one-line breakpoint command inline. Be sure to surround it with quotes." },
- { LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean,
+ { LLDB_OPT_SET_ALL, false, "stop-on-error", 'e', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBoolean,
"Specify whether breakpoint command execution should terminate on error." },
- { LLDB_OPT_SET_ALL, false, "script-type", 's', OptionParser::eRequiredArgument, NULL, g_script_option_enumeration, 0, eArgTypeNone,
+ { LLDB_OPT_SET_ALL, false, "script-type", 's', OptionParser::eRequiredArgument, nullptr, g_script_option_enumeration, 0, eArgTypeNone,
"Specify the language for the commands - if none is specified, the lldb command interpreter will be used."},
- { LLDB_OPT_SET_2, false, "python-function", 'F', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypePythonFunction,
+ { LLDB_OPT_SET_2, false, "python-function", 'F', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypePythonFunction,
"Give the name of a Python function to run as command for this breakpoint. Be sure to give a module name if appropriate."},
- { LLDB_OPT_SET_ALL, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone,
+ { LLDB_OPT_SET_ALL, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone,
"Sets Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."},
- { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
+ { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr }
};
//-------------------------------------------------------------------------
@@ -573,10 +563,10 @@ class CommandObjectBreakpointCommandDele
{
public:
CommandObjectBreakpointCommandDelete (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "delete",
- "Delete the set of commands from a breakpoint.",
- NULL),
+ CommandObjectParsed(interpreter,
+ "delete",
+ "Delete the set of commands from a breakpoint.",
+ nullptr),
m_options (interpreter)
{
CommandArgumentEntry arg;
@@ -593,8 +583,7 @@ public:
m_arguments.push_back (arg);
}
-
- ~CommandObjectBreakpointCommandDelete () override {}
+ ~CommandObjectBreakpointCommandDelete() override = default;
Options *
GetOptions () override
@@ -605,14 +594,13 @@ public:
class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options (interpreter),
m_use_dummy (false)
{
}
- ~CommandOptions () override {}
+ ~CommandOptions() override = default;
Error
SetOptionValue (uint32_t option_idx, const char *option_arg) override
@@ -660,7 +648,7 @@ protected:
{
Target *target = GetSelectedOrDummyTarget(m_options.m_use_dummy);
- if (target == NULL)
+ if (target == nullptr)
{
result.AppendError ("There is not a current executable; there are no breakpoints from which to delete commands");
result.SetStatus (eReturnStatusFailed);
@@ -719,6 +707,7 @@ protected:
}
return result.Succeeded();
}
+
private:
CommandOptions m_options;
};
@@ -726,13 +715,12 @@ private:
OptionDefinition
CommandObjectBreakpointCommandDelete::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, NULL, NULL, 0, eArgTypeNone,
+ { LLDB_OPT_SET_1, false, "dummy-breakpoints", 'D', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone,
"Delete commands from Dummy breakpoints - i.e. breakpoints set before a file is provided, which prime new targets."},
- { 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
+ { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr }
};
-
//-------------------------------------------------------------------------
// CommandObjectBreakpointCommandList
//-------------------------------------------------------------------------
@@ -741,10 +729,10 @@ class CommandObjectBreakpointCommandList
{
public:
CommandObjectBreakpointCommandList (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "list",
- "List the script or set of commands to be executed when the breakpoint is hit.",
- NULL)
+ CommandObjectParsed(interpreter,
+ "list",
+ "List the script or set of commands to be executed when the breakpoint is hit.",
+ nullptr)
{
CommandArgumentEntry arg;
CommandArgumentData bp_id_arg;
@@ -760,7 +748,7 @@ public:
m_arguments.push_back (arg);
}
- ~CommandObjectBreakpointCommandList () override {}
+ ~CommandObjectBreakpointCommandList() override = default;
protected:
bool
@@ -769,7 +757,7 @@ protected:
{
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
- if (target == NULL)
+ if (target == nullptr)
{
result.AppendError ("There is not a current executable; there are no breakpoints for which to list commands");
result.SetStatus (eReturnStatusFailed);
@@ -808,7 +796,7 @@ protected:
if (bp)
{
- const BreakpointOptions *bp_options = NULL;
+ const BreakpointOptions *bp_options = nullptr;
if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID)
{
BreakpointLocationSP bp_loc_sp(bp->FindLocationByID (cur_bp_id.GetLocationID()));
@@ -855,7 +843,6 @@ protected:
result.AppendErrorWithFormat("Invalid breakpoint ID: %u.\n", cur_bp_id.GetBreakpointID());
result.SetStatus (eReturnStatusFailed);
}
-
}
}
}
@@ -887,8 +874,4 @@ CommandObjectBreakpointCommand::CommandO
LoadSubCommand ("list", list_command_object);
}
-CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand ()
-{
-}
-
-
+CommandObjectBreakpointCommand::~CommandObjectBreakpointCommand() = default;
Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=261356&r1=261355&r2=261356&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Fri Feb 19 13:33:46 2016
@@ -7,12 +7,14 @@
//
//===----------------------------------------------------------------------===//
-#include "CommandObjectExpression.h"
-
// C Includes
// C++ Includes
// Other libraries and framework includes
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
+
// Project includes
+#include "CommandObjectExpression.h"
#include "lldb/Core/Value.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/DataFormatters/ValueObjectPrinter.h"
@@ -32,8 +34,6 @@
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringRef.h"
using namespace lldb;
using namespace lldb_private;
@@ -43,31 +43,27 @@ CommandObjectExpression::CommandOptions:
{
}
-
-CommandObjectExpression::CommandOptions::~CommandOptions ()
-{
-}
+CommandObjectExpression::CommandOptions::~CommandOptions() = default;
static OptionEnumValueElement g_description_verbosity_type[] =
{
{ eLanguageRuntimeDescriptionDisplayVerbosityCompact, "compact", "Only show the description string"},
{ eLanguageRuntimeDescriptionDisplayVerbosityFull, "full", "Show the full output, including persistent variable's name and type"},
- { 0, NULL, NULL }
+ { 0, nullptr, nullptr }
};
OptionDefinition
CommandObjectExpression::CommandOptions::g_option_table[] =
{
- { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "all-threads", 'a', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, "Should we run all threads if the execution doesn't complete on one thread."},
- { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "ignore-breakpoints", 'i', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, "Ignore breakpoint hits while running expressions"},
- { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "timeout", 't', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeUnsignedInteger, "Timeout value (in microseconds) for running the expression."},
- { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "unwind-on-error", 'u', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeBoolean, "Clean up program state if the expression causes a crash, or raises a signal. Note, unlike gdb hitting a breakpoint is controlled by another option (-i)."},
- { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "debug", 'g', OptionParser::eNoArgument , NULL, NULL, 0, eArgTypeNone, "When specified, debug the JIT code by setting a breakpoint on the first instruction and forcing breakpoints to not be ignored (-i0) and no unwinding to happen on error (-u0)."},
- { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "language", 'l', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeLanguage, "Specifies the Language to use when parsing the expression. If not set the target.language setting is used." },
- { LLDB_OPT_SET_1, false, "description-verbosity", 'v', OptionParser::eOptionalArgument, NULL, g_description_verbosity_type, 0, eArgTypeDescriptionVerbosity, "How verbose should the output of this expression be, if the object description is asked for."},
+ { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "all-threads", 'a', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBoolean, "Should we run all threads if the execution doesn't complete on one thread."},
+ { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "ignore-breakpoints", 'i', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBoolean, "Ignore breakpoint hits while running expressions"},
+ { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "timeout", 't', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeUnsignedInteger, "Timeout value (in microseconds) for running the expression."},
+ { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "unwind-on-error", 'u', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeBoolean, "Clean up program state if the expression causes a crash, or raises a signal. Note, unlike gdb hitting a breakpoint is controlled by another option (-i)."},
+ { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "debug", 'g', OptionParser::eNoArgument , nullptr, nullptr, 0, eArgTypeNone, "When specified, debug the JIT code by setting a breakpoint on the first instruction and forcing breakpoints to not be ignored (-i0) and no unwinding to happen on error (-u0)."},
+ { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "language", 'l', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeLanguage, "Specifies the Language to use when parsing the expression. If not set the target.language setting is used." },
+ { LLDB_OPT_SET_1, false, "description-verbosity", 'v', OptionParser::eOptionalArgument, nullptr, g_description_verbosity_type, 0, eArgTypeDescriptionVerbosity, "How verbose should the output of this expression be, if the object description is asked for."},
};
-
uint32_t
CommandObjectExpression::CommandOptions::GetNumDefinitions ()
{
@@ -165,7 +161,7 @@ void
CommandObjectExpression::CommandOptions::OptionParsingStarting (CommandInterpreter &interpreter)
{
Process *process = interpreter.GetExecutionContext().GetProcessPtr();
- if (process != NULL)
+ if (process != nullptr)
{
ignore_breakpoints = process->GetIgnoreBreakpointsInExpressions();
unwind_on_error = process->GetUnwindOnErrorInExpressions();
@@ -191,11 +187,11 @@ CommandObjectExpression::CommandOptions:
}
CommandObjectExpression::CommandObjectExpression (CommandInterpreter &interpreter) :
- CommandObjectRaw (interpreter,
- "expression",
- "Evaluate an expression in the current program context, using user defined variables and variables currently in scope.",
- NULL,
- eCommandProcessMustBePaused | eCommandTryTargetAPILock),
+ CommandObjectRaw(interpreter,
+ "expression",
+ "Evaluate an expression in the current program context, using user defined variables and variables currently in scope.",
+ nullptr,
+ eCommandProcessMustBePaused | eCommandTryTargetAPILock),
IOHandlerDelegate (IOHandlerDelegate::Completion::Expression),
m_option_group (interpreter),
m_format_options (eFormatDefault),
@@ -259,9 +255,7 @@ Examples:
m_option_group.Finalize();
}
-CommandObjectExpression::~CommandObjectExpression ()
-{
-}
+CommandObjectExpression::~CommandObjectExpression() = default;
Options *
CommandObjectExpression::GetOptions ()
@@ -270,13 +264,10 @@ CommandObjectExpression::GetOptions ()
}
bool
-CommandObjectExpression::EvaluateExpression
-(
- const char *expr,
- Stream *output_stream,
- Stream *error_stream,
- CommandReturnObject *result
-)
+CommandObjectExpression::EvaluateExpression(const char *expr,
+ Stream *output_stream,
+ Stream *error_stream,
+ CommandReturnObject *result)
{
// Don't use m_exe_ctx as this might be called asynchronously
// after the command object DoExecute has finished when doing
@@ -433,15 +424,15 @@ CommandObjectExpression::GetMultilineExp
Debugger &debugger = GetCommandInterpreter().GetDebugger();
bool color_prompt = debugger.GetUseColor();
const bool multiple_lines = true; // Get multiple lines
- IOHandlerSP io_handler_sp (new IOHandlerEditline (debugger,
- IOHandler::Type::Expression,
- "lldb-expr", // Name of input reader for history
- NULL, // No prompt
- NULL, // Continuation prompt
- multiple_lines,
- color_prompt,
- 1, // Show line numbers starting at 1
- *this));
+ IOHandlerSP io_handler_sp(new IOHandlerEditline(debugger,
+ IOHandler::Type::Expression,
+ "lldb-expr", // Name of input reader for history
+ nullptr, // No prompt
+ nullptr, // Continuation prompt
+ multiple_lines,
+ color_prompt,
+ 1, // Show line numbers starting at 1
+ *this));
StreamFileSP output_sp(io_handler_sp->GetOutputStreamFile());
if (output_sp)
@@ -453,15 +444,12 @@ CommandObjectExpression::GetMultilineExp
}
bool
-CommandObjectExpression::DoExecute
-(
- const char *command,
- CommandReturnObject &result
-)
+CommandObjectExpression::DoExecute(const char *command,
+ CommandReturnObject &result)
{
m_option_group.NotifyOptionParsingStarting();
- const char * expr = NULL;
+ const char * expr = nullptr;
if (command[0] == '\0')
{
@@ -472,7 +460,7 @@ CommandObjectExpression::DoExecute
if (command[0] == '-')
{
// We have some options and these options MUST end with --.
- const char *end_options = NULL;
+ const char *end_options = nullptr;
const char *s = command;
while (s && s[0])
{
@@ -568,7 +556,7 @@ CommandObjectExpression::DoExecute
}
}
// No expression following options
- else if (expr == NULL || expr[0] == '\0')
+ else if (expr == nullptr || expr[0] == '\0')
{
GetMultilineExpression ();
return result.Succeeded();
@@ -576,7 +564,7 @@ CommandObjectExpression::DoExecute
}
}
- if (expr == NULL)
+ if (expr == nullptr)
expr = command;
if (EvaluateExpression (expr, &(result.GetOutputStream()), &(result.GetErrorStream()), &result))
@@ -585,4 +573,3 @@ CommandObjectExpression::DoExecute
result.SetStatus (eReturnStatusFailed);
return false;
}
-
Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=261356&r1=261355&r2=261356&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Fri Feb 19 13:33:46 2016
@@ -7,13 +7,13 @@
//
//===----------------------------------------------------------------------===//
-#include "CommandObjectFrame.h"
-
// C Includes
// C++ Includes
#include <string>
+
// Other libraries and framework includes
// Project includes
+#include "CommandObjectFrame.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/StreamFile.h"
@@ -58,7 +58,6 @@ using namespace lldb_private;
class CommandObjectFrameInfo : public CommandObjectParsed
{
public:
-
CommandObjectFrameInfo (CommandInterpreter &interpreter) :
CommandObjectParsed (interpreter,
"frame info",
@@ -71,9 +70,7 @@ public:
{
}
- ~CommandObjectFrameInfo () override
- {
- }
+ ~CommandObjectFrameInfo() override = default;
protected:
bool
@@ -94,20 +91,16 @@ protected:
class CommandObjectFrameSelect : public CommandObjectParsed
{
public:
-
- class CommandOptions : public Options
+ class CommandOptions : public Options
{
public:
-
CommandOptions (CommandInterpreter &interpreter) :
Options(interpreter)
{
OptionParsingStarting ();
}
- ~CommandOptions () override
- {
- }
+ ~CommandOptions() override = default;
Error
SetOptionValue (uint32_t option_idx, const char *option_arg) override
@@ -150,14 +143,14 @@ public:
};
CommandObjectFrameSelect (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "frame select",
- "Select a frame by index from within the current thread and make it the current frame.",
- NULL,
- eCommandRequiresThread |
- eCommandTryTargetAPILock |
- eCommandProcessMustBeLaunched |
- eCommandProcessMustBePaused ),
+ CommandObjectParsed(interpreter,
+ "frame select",
+ "Select a frame by index from within the current thread and make it the current frame.",
+ nullptr,
+ eCommandRequiresThread |
+ eCommandTryTargetAPILock |
+ eCommandProcessMustBeLaunched |
+ eCommandProcessMustBePaused ),
m_options (interpreter)
{
CommandArgumentEntry arg;
@@ -174,9 +167,7 @@ public:
m_arguments.push_back (arg);
}
- ~CommandObjectFrameSelect () override
- {
- }
+ ~CommandObjectFrameSelect() override = default;
Options *
GetOptions () override
@@ -184,7 +175,6 @@ public:
return &m_options;
}
-
protected:
bool
DoExecute (Args& command, CommandReturnObject &result) override
@@ -283,16 +273,16 @@ protected:
return result.Succeeded();
}
-protected:
+protected:
CommandOptions m_options;
};
OptionDefinition
CommandObjectFrameSelect::CommandOptions::g_option_table[] =
{
-{ LLDB_OPT_SET_1, false, "relative", 'r', OptionParser::eRequiredArgument, NULL, NULL, 0, eArgTypeOffset, "A relative frame index offset from the current frame index."},
-{ 0, false, NULL, 0, 0, NULL, NULL, 0, eArgTypeNone, NULL }
+ { LLDB_OPT_SET_1, false, "relative", 'r', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeOffset, "A relative frame index offset from the current frame index."},
+ { 0, false, nullptr, 0, 0, nullptr, nullptr, 0, eArgTypeNone, nullptr }
};
#pragma mark CommandObjectFrameVariable
@@ -302,22 +292,21 @@ CommandObjectFrameSelect::CommandOptions
class CommandObjectFrameVariable : public CommandObjectParsed
{
public:
-
CommandObjectFrameVariable (CommandInterpreter &interpreter) :
- CommandObjectParsed (interpreter,
- "frame variable",
- "Show frame variables. All argument and local variables "
- "that are in scope will be shown when no arguments are given. "
- "If any arguments are specified, they can be names of "
- "argument, local, file static and file global variables. "
- "Children of aggregate variables can be specified such as "
- "'var->child.x'.",
- NULL,
- eCommandRequiresFrame |
- eCommandTryTargetAPILock |
- eCommandProcessMustBeLaunched |
- eCommandProcessMustBePaused |
- eCommandRequiresProcess),
+ CommandObjectParsed(interpreter,
+ "frame variable",
+ "Show frame variables. All argument and local variables "
+ "that are in scope will be shown when no arguments are given. "
+ "If any arguments are specified, they can be names of "
+ "argument, local, file static and file global variables. "
+ "Children of aggregate variables can be specified such as "
+ "'var->child.x'.",
+ nullptr,
+ eCommandRequiresFrame |
+ eCommandTryTargetAPILock |
+ eCommandProcessMustBeLaunched |
+ eCommandProcessMustBePaused |
+ eCommandRequiresProcess),
m_option_group (interpreter),
m_option_variable(true), // Include the frame specific options by passing "true"
m_option_format (eFormatDefault),
@@ -342,9 +331,7 @@ public:
m_option_group.Finalize();
}
- ~CommandObjectFrameVariable () override
- {
- }
+ ~CommandObjectFrameVariable() override = default;
Options *
GetOptions () override
@@ -352,7 +339,6 @@ public:
return &m_option_group;
}
-
int
HandleArgumentCompletion (Args &input,
int &cursor_index,
@@ -367,14 +353,14 @@ public:
std::string completion_str (input.GetArgumentAtIndex(cursor_index));
completion_str.erase (cursor_char_position);
- CommandCompletions::InvokeCommonCompletionCallbacks (m_interpreter,
- CommandCompletions::eVariablePathCompletion,
- completion_str.c_str(),
- match_start_point,
- max_return_elements,
- NULL,
- word_complete,
- matches);
+ CommandCompletions::InvokeCommonCompletionCallbacks(m_interpreter,
+ CommandCompletions::eVariablePathCompletion,
+ completion_str.c_str(),
+ match_start_point,
+ max_return_elements,
+ nullptr,
+ word_complete,
+ matches);
return matches.GetSize();
}
@@ -397,7 +383,7 @@ protected:
VariableSP var_sp;
ValueObjectSP valobj_sp;
- const char *name_cstr = NULL;
+ const char *name_cstr = nullptr;
size_t idx;
TypeSummaryImplSP summary_format_sp;
@@ -423,7 +409,7 @@ protected:
// If we have any args to the variable command, we will make
// variable objects from them...
- for (idx = 0; (name_cstr = command.GetArgumentAtIndex(idx)) != NULL; ++idx)
+ for (idx = 0; (name_cstr = command.GetArgumentAtIndex(idx)) != nullptr; ++idx)
{
if (m_option_variable.use_regex)
{
@@ -502,12 +488,12 @@ protected:
options.SetVariableFormatDisplayLanguage(valobj_sp->GetPreferredDisplayLanguage());
Stream &output_stream = result.GetOutputStream();
- options.SetRootValueObjectName(valobj_sp->GetParent() ? name_cstr : NULL);
+ options.SetRootValueObjectName(valobj_sp->GetParent() ? name_cstr : nullptr);
valobj_sp->Dump(output_stream,options);
}
else
{
- const char *error_cstr = error.AsCString(NULL);
+ const char *error_cstr = error.AsCString(nullptr);
if (error_cstr)
result.GetErrorStream().Printf("error: %s\n", error_cstr);
else
@@ -572,8 +558,8 @@ protected:
// that are not in scope to avoid extra unneeded output
if (valobj_sp->IsInScope ())
{
- if (false == valobj_sp->GetTargetSP()->GetDisplayRuntimeSupportValues() &&
- true == valobj_sp->IsRuntimeSupportValue())
+ if (!valobj_sp->GetTargetSP()->GetDisplayRuntimeSupportValues() &&
+ valobj_sp->IsRuntimeSupportValue())
continue;
if (!scope_string.empty())
@@ -607,15 +593,14 @@ protected:
return result.Succeeded();
}
-protected:
+protected:
OptionGroupOptions m_option_group;
OptionGroupVariable m_option_variable;
OptionGroupFormat m_option_format;
OptionGroupValueObjectDisplay m_varobj_options;
};
-
#pragma mark CommandObjectMultiwordFrame
//-------------------------------------------------------------------------
@@ -633,7 +618,4 @@ CommandObjectMultiwordFrame::CommandObje
LoadSubCommand ("variable", CommandObjectSP (new CommandObjectFrameVariable (interpreter)));
}
-CommandObjectMultiwordFrame::~CommandObjectMultiwordFrame ()
-{
-}
-
+CommandObjectMultiwordFrame::~CommandObjectMultiwordFrame() = default;
More information about the lldb-commits
mailing list