diff options
33 files changed, 399 insertions, 399 deletions
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp index 2bd382c222e..0e9e5631938 100644 --- a/lldb/source/Interpreter/Args.cpp +++ b/lldb/source/Interpreter/Args.cpp @@ -166,7 +166,7 @@ Args::SetCommandString (const char *command) { static const char *k_space_separators = " \t"; static const char *k_space_separators_with_slash_and_quotes = " \t \\'\""; - const char *arg_end = NULL; + const char *arg_end = nullptr; const char *arg_pos; for (arg_pos = command; arg_pos && arg_pos[0]; @@ -371,7 +371,7 @@ Args::UpdateArgsAfterOptionParsing() ++argv_pos) { const char *argv_cstr = *argv_pos; - if (argv_cstr == NULL) + if (argv_cstr == nullptr) break; while (args_pos != m_args.end()) @@ -407,7 +407,7 @@ Args::UpdateArgvFromArgs() arg_sstr_collection::const_iterator pos, end = m_args.end(); for (pos = m_args.begin(); pos != end; ++pos) m_argv.push_back(pos->c_str()); - m_argv.push_back(NULL); + m_argv.push_back(nullptr); // Make sure we have enough arg quote chars in the array if (m_args_quote_char.size() < m_args.size()) m_args_quote_char.resize (m_argv.size()); @@ -426,7 +426,7 @@ Args::GetArgumentAtIndex (size_t idx) const { if (idx < m_argv.size()) return m_argv[idx]; - return NULL; + return nullptr; } char @@ -442,7 +442,7 @@ Args::GetArgumentVector() { if (!m_argv.empty()) return (char **)&m_argv[0]; - return NULL; + return nullptr; } const char ** @@ -450,7 +450,7 @@ Args::GetConstArgumentVector() const { if (!m_argv.empty()) return (const char **)&m_argv[0]; - return NULL; + return nullptr; } void @@ -545,7 +545,7 @@ Args::ReplaceArgumentAtIndex (size_t idx, const char *arg_cstr, char quote_char) m_args_quote_char[idx] = quote_char; return GetArgumentAtIndex(idx); } - return NULL; + return nullptr; } void @@ -621,15 +621,15 @@ Args::ParseOptions (Options &options) StreamString sstr; Error error; Option *long_options = options.GetLongOptions(); - if (long_options == NULL) + if (long_options == nullptr) { error.SetErrorStringWithFormat("invalid long options"); return error; } - for (int i=0; long_options[i].name != NULL; ++i) + for (int i=0; long_options[i].name != nullptr; ++i) { - if (long_options[i].flag == NULL) + if (long_options[i].flag == nullptr) { if (isprint8(long_options[i].val)) { @@ -687,7 +687,7 @@ Args::ParseOptions (Options &options) if (long_options_index >= 0) { error = options.SetOptionValue(long_options_index, - long_options[long_options_index].has_arg == OptionParser::eNoArgument ? NULL : OptionParser::GetOptionArgument()); + long_options[long_options_index].has_arg == OptionParser::eNoArgument ? nullptr : OptionParser::GetOptionArgument()); } else { @@ -716,7 +716,7 @@ Args::StringToSInt32 (const char *s, int32_t fail_value, int base, bool *success { if (s && s[0]) { - char *end = NULL; + char *end = nullptr; const long sval = ::strtol (s, &end, base); if (*end == '\0') { @@ -734,7 +734,7 @@ Args::StringToUInt32 (const char *s, uint32_t fail_value, int base, bool *succes { if (s && s[0]) { - char *end = NULL; + char *end = nullptr; const unsigned long uval = ::strtoul (s, &end, base); if (*end == '\0') { @@ -753,7 +753,7 @@ Args::StringToSInt64 (const char *s, int64_t fail_value, int base, bool *success { if (s && s[0]) { - char *end = NULL; + char *end = nullptr; int64_t uval = ::strtoll (s, &end, base); if (*end == '\0') { @@ -770,7 +770,7 @@ Args::StringToUInt64 (const char *s, uint64_t fail_value, int base, bool *succes { if (s && s[0]) { - char *end = NULL; + char *end = nullptr; uint64_t uval = ::strtoull (s, &end, base); if (*end == '\0') { @@ -788,7 +788,7 @@ Args::StringToAddress (const ExecutionContext *exe_ctx, const char *s, lldb::add bool error_set = false; if (s && s[0]) { - char *end = NULL; + char *end = nullptr; lldb::addr_t addr = ::strtoull (s, &end, 0); if (*end == '\0') { @@ -923,7 +923,7 @@ Args::StripSpaces (std::string &s, bool leading, bool trailing, bool return_null } } if (return_null_if_empty && s.empty()) - return NULL; + return nullptr; return s.c_str(); } @@ -964,7 +964,7 @@ Args::StringToVersion (const char *s, uint32_t &major, uint32_t &minor, uint32_t if (s && s[0]) { - char *pos = NULL; + char *pos = nullptr; unsigned long uval32 = ::strtoul (s, &pos, 0); if (pos == s) return s; @@ -991,7 +991,7 @@ Args::StringToVersion (const char *s, uint32_t &major, uint32_t &minor, uint32_t return pos; } } - return 0; + return nullptr; } const char * @@ -1022,7 +1022,7 @@ Args::StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, in { if (s && s[0]) { - for (int i = 0; enum_values[i].string_value != NULL ; i++) + for (int i = 0; enum_values[i].string_value != nullptr ; i++) { if (strstr(enum_values[i].string_value, s) == enum_values[i].string_value) { @@ -1034,7 +1034,7 @@ Args::StringToOptionEnum (const char *s, OptionEnumValueElement *enum_values, in StreamString strm; strm.PutCString ("invalid enumeration value, valid values are: "); - for (int i = 0; enum_values[i].string_value != NULL; i++) + for (int i = 0; enum_values[i].string_value != nullptr; i++) { strm.Printf ("%s\"%s\"", i > 0 ? ", " : "", @@ -1087,7 +1087,7 @@ Args::StringToFormat { if (isdigit (s[0])) { - char *format_char = NULL; + char *format_char = nullptr; unsigned long byte_size = ::strtoul (s, &format_char, 0); if (byte_size != ULONG_MAX) *byte_size_ptr = byte_size; @@ -1241,7 +1241,7 @@ Args::FindArgumentIndexForOption (Option *long_options, int long_options_index) bool Args::IsPositionalArgument (const char *arg) { - if (arg == NULL) + if (arg == nullptr) return false; bool is_positional = true; @@ -1271,16 +1271,16 @@ Args::ParseAliasOptions (Options &options, int i; Option *long_options = options.GetLongOptions(); - if (long_options == NULL) + if (long_options == nullptr) { result.AppendError ("invalid long options"); result.SetStatus (eReturnStatusFailed); return; } - for (i = 0; long_options[i].name != NULL; ++i) + for (i = 0; long_options[i].name != nullptr; ++i) { - if (long_options[i].flag == NULL) + if (long_options[i].flag == nullptr) { sstr << (char) long_options[i].val; switch (long_options[i].has_arg) @@ -1353,7 +1353,7 @@ Args::ParseAliasOptions (Options &options, result.SetStatus (eReturnStatusSuccessFinishNoResult); break; case OptionParser::eRequiredArgument: - if (OptionParser::GetOptionArgument() != NULL) + if (OptionParser::GetOptionArgument() != nullptr) { option_arg_vector->push_back (OptionArgPair (std::string (option_str.GetData()), OptionArgValue (OptionParser::eRequiredArgument, @@ -1368,7 +1368,7 @@ Args::ParseAliasOptions (Options &options, } break; case OptionParser::eOptionalArgument: - if (OptionParser::GetOptionArgument() != NULL) + if (OptionParser::GetOptionArgument() != nullptr) { option_arg_vector->push_back (OptionArgPair (std::string (option_str.GetData()), OptionArgValue (OptionParser::eOptionalArgument, @@ -1411,7 +1411,7 @@ Args::ParseAliasOptions (Options &options, } ReplaceArgumentAtIndex (idx, ""); if ((long_options[long_options_index].has_arg != OptionParser::eNoArgument) - && (OptionParser::GetOptionArgument() != NULL) + && (OptionParser::GetOptionArgument() != nullptr) && (idx+1 < GetArgumentCount()) && (strcmp (OptionParser::GetOptionArgument(), GetArgumentAtIndex(idx+1)) == 0)) { @@ -1444,7 +1444,7 @@ Args::ParseArgsForCompletion Option *long_options = options.GetLongOptions(); option_element_vector.clear(); - if (long_options == NULL) + if (long_options == nullptr) { return; } @@ -1453,9 +1453,9 @@ Args::ParseArgsForCompletion // to suppress error messages. sstr << ":"; - for (int i = 0; long_options[i].name != NULL; ++i) + for (int i = 0; long_options[i].name != nullptr; ++i) { - if (long_options[i].flag == NULL) + if (long_options[i].flag == nullptr) { sstr << (char) long_options[i].val; switch (long_options[i].has_arg) @@ -1587,7 +1587,7 @@ Args::ParseArgsForCompletion option_element_vector.push_back (OptionArgElement (opt_defs_index, OptionParser::GetOptionIndex() - 1, 0)); break; case OptionParser::eRequiredArgument: - if (OptionParser::GetOptionArgument() != NULL) + if (OptionParser::GetOptionArgument() != nullptr) { int arg_index; if (missing_argument) @@ -1603,7 +1603,7 @@ Args::ParseArgsForCompletion } break; case OptionParser::eOptionalArgument: - if (OptionParser::GetOptionArgument() != NULL) + if (OptionParser::GetOptionArgument() != nullptr) { option_element_vector.push_back (OptionArgElement (opt_defs_index, OptionParser::GetOptionIndex() - 2, OptionParser::GetOptionIndex() - 1)); } @@ -1686,7 +1686,7 @@ Args::EncodeEscapeSequences (const char *src, std::string &dst) // the main for loop will do this for us, so we advance p by // one less than i (even if i is zero) p += i - 1; - unsigned long octal_value = ::strtoul (oct_str, NULL, 8); + unsigned long octal_value = ::strtoul (oct_str, nullptr, 8); if (octal_value <= UINT8_MAX) { dst.append(1, (char)octal_value); @@ -1709,7 +1709,7 @@ Args::EncodeEscapeSequences (const char *src, std::string &dst) hex_str[1] = *p; } - unsigned long hex_value = strtoul (hex_str, NULL, 16); + unsigned long hex_value = strtoul (hex_str, nullptr, 16); if (hex_value <= UINT8_MAX) dst.append (1, (char)hex_value); } diff --git a/lldb/source/Interpreter/CommandHistory.cpp b/lldb/source/Interpreter/CommandHistory.cpp index 07ba6f14c28..26996a62564 100644 --- a/lldb/source/Interpreter/CommandHistory.cpp +++ b/lldb/source/Interpreter/CommandHistory.cpp @@ -41,17 +41,17 @@ CommandHistory::FindString (const char* input_str) const { Mutex::Locker locker(m_mutex); if (!input_str) - return NULL; + return nullptr; if (input_str[0] != g_repeat_char) - return NULL; + return nullptr; if (input_str[1] == '-') { bool success; size_t idx = Args::StringToUInt32 (input_str+2, 0, 0, &success); if (!success) - return NULL; + return nullptr; if (idx > m_history.size()) - return NULL; + return nullptr; idx = m_history.size() - idx; return m_history[idx].c_str(); @@ -59,7 +59,7 @@ CommandHistory::FindString (const char* input_str) const else if (input_str[1] == g_repeat_char) { if (m_history.empty()) - return NULL; + return nullptr; else return m_history.back().c_str(); } @@ -68,9 +68,9 @@ CommandHistory::FindString (const char* input_str) const bool success; uint32_t idx = Args::StringToUInt32 (input_str+1, 0, 0, &success); if (!success) - return NULL; + return nullptr; if (idx >= m_history.size()) - return NULL; + return nullptr; return m_history[idx].c_str(); } } @@ -81,7 +81,7 @@ CommandHistory::GetStringAtIndex (size_t idx) const Mutex::Locker locker(m_mutex); if (idx < m_history.size()) return m_history[idx].c_str(); - return NULL; + return nullptr; } const char* @@ -95,7 +95,7 @@ CommandHistory::GetRecentmostString () const { Mutex::Locker locker(m_mutex); if (m_history.empty()) - return NULL; + return nullptr; return m_history.back().c_str(); } diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp index 6dfb2ca7280..1ee5736160b 100644 --- a/lldb/source/Interpreter/CommandInterpreter.cpp +++ b/lldb/source/Interpreter/CommandInterpreter.cpp @@ -73,10 +73,10 @@ using namespace lldb_private; static PropertyDefinition g_properties[] = { - { "expand-regex-aliases", OptionValue::eTypeBoolean, true, false, NULL, NULL, "If true, regular expression alias commands will show the expanded command that will be executed. This can be used to debug new regular expression alias commands." }, - { "prompt-on-quit", OptionValue::eTypeBoolean, true, true, NULL, NULL, "If true, LLDB will prompt you before quitting if there are any live processes being debugged. If false, LLDB will quit without asking in any case." }, - { "stop-command-source-on-error", OptionValue::eTypeBoolean, true, true, NULL, NULL, "If true, LLDB will stop running a 'command source' script upon encountering an error." }, - { NULL , OptionValue::eTypeInvalid, true, 0 , NULL, NULL, NULL } + { "expand-regex-aliases", OptionValue::eTypeBoolean, true, false, nullptr, nullptr, "If true, regular expression alias commands will show the expanded command that will be executed. This can be used to debug new regular expression alias commands." }, + { "prompt-on-quit", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "If true, LLDB will prompt you before quitting if there are any live processes being debugged. If false, LLDB will quit without asking in any case." }, + { "stop-command-source-on-error", OptionValue::eTypeBoolean, true, true, nullptr, nullptr, "If true, LLDB will stop running a 'command source' script upon encountering an error." }, + { nullptr , OptionValue::eTypeInvalid, true, 0 , nullptr, nullptr, nullptr } }; enum @@ -125,21 +125,21 @@ bool CommandInterpreter::GetExpandRegexAliases () const { const uint32_t idx = ePropertyExpandRegexAliases; - return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0); + return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr, idx, g_properties[idx].default_uint_value != 0); } bool CommandInterpreter::GetPromptOnQuit () const { const uint32_t idx = ePropertyPromptOnQuit; - return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0); + return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr, idx, g_properties[idx].default_uint_value != 0); } bool CommandInterpreter::GetStopCmdSourceOnError () const { const uint32_t idx = ePropertyStopCmdSourceOnError; - return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0); + return m_collection_sp->GetPropertyAtIndexAsBoolean (nullptr, idx, g_properties[idx].default_uint_value != 0); } void @@ -702,7 +702,7 @@ CommandInterpreter::GetCommandSP (const char *cmd_cstr, bool include_aliases, bo CommandObjectSP user_match_sp, alias_match_sp, real_match_sp; StringList local_matches; - if (matches == NULL) + if (matches == nullptr) matches = &local_matches; unsigned int num_cmd_matches = 0; @@ -830,17 +830,17 @@ CommandInterpreter::GetCommandSPExact (const char *cmd_cstr, bool include_aliase Args cmd_words (cmd_cstr); // Break up the command string into words, in case it's a multi-word command. CommandObjectSP ret_val; // Possibly empty return value. - if (cmd_cstr == NULL) + if (cmd_cstr == nullptr) return ret_val; if (cmd_words.GetArgumentCount() == 1) - return GetCommandSP(cmd_cstr, include_aliases, true, NULL); + return GetCommandSP(cmd_cstr, include_aliases, true, nullptr); else { // We have a multi-word command (seemingly), so we need to do more work. // First, get the cmd_obj_sp for the first word in the command. - CommandObjectSP cmd_obj_sp = GetCommandSP (cmd_words.GetArgumentAtIndex (0), include_aliases, true, NULL); - if (cmd_obj_sp.get() != NULL) + CommandObjectSP cmd_obj_sp = GetCommandSP (cmd_words.GetArgumentAtIndex (0), include_aliases, true, nullptr); + if (cmd_obj_sp.get() != nullptr) { // Loop through the rest of the words in the command (everything passed in was supposed to be part of a // command name), and find the appropriate sub-command SP for each command word.... @@ -850,7 +850,7 @@ CommandInterpreter::GetCommandSPExact (const char *cmd_cstr, bool include_aliase if (cmd_obj_sp->IsMultiwordObject()) { cmd_obj_sp = cmd_obj_sp->GetSubcommandSP (cmd_words.GetArgumentAtIndex (j)); - if (cmd_obj_sp.get() == NULL) + if (cmd_obj_sp.get() == nullptr) // The sub-command name was invalid. Fail and return the empty 'ret_val'. return ret_val; } @@ -890,7 +890,7 @@ CommandInterpreter::GetCommandObject (const char *cmd_cstr, StringList *matches) return command_obj; // If there wasn't an exact match then look for an inexact one in just the commands - command_obj = GetCommandSP(cmd_cstr, false, false, NULL).get(); + command_obj = GetCommandSP(cmd_cstr, false, false, nullptr).get(); // Finally, if there wasn't an inexact match among the commands, look for an inexact // match in both the commands and aliases. @@ -1156,7 +1156,7 @@ CommandInterpreter::GetCommandObjectForCommand (std::string &command_string) // This function finds the final, lowest-level, alias-resolved command object whose 'Execute' function will // eventually be invoked by the given command line. - CommandObject *cmd_obj = NULL; + CommandObject *cmd_obj = nullptr; std::string white_space (" \t\v"); size_t start = command_string.find_first_not_of (white_space); size_t end = 0; @@ -1171,7 +1171,7 @@ CommandInterpreter::GetCommandObjectForCommand (std::string &command_string) end = command_string.size(); std::string cmd_word = command_string.substr (start, end - start); - if (cmd_obj == NULL) + if (cmd_obj == nullptr) // Since cmd_obj is NULL we are on our first time through this loop. Check to see if cmd_word is a valid // command or alias. cmd_obj = GetCommandObject (cmd_word.c_str()); @@ -1325,7 +1325,7 @@ CommandInterpreter::BuildAliasResult (const char *alias_name, std::string &alias_result, CommandReturnObject &result) { - CommandObject *alias_cmd_obj = NULL; + CommandObject *alias_cmd_obj = nullptr; Args cmd_args (raw_input_string.c_str()); alias_cmd_obj = GetCommandObject (alias_name); StreamString result_str; @@ -1530,7 +1530,7 @@ CommandInterpreter::HandleCommand (const char *command_line, { bool done = false; - CommandObject *cmd_obj = NULL; + CommandObject *cmd_obj = nullptr; bool wants_raw_input = false; std::string command_string (command_line); std::string original_command_string (command_line); @@ -1540,7 +1540,7 @@ CommandInterpreter::HandleCommand (const char *command_line, // Make a scoped cleanup object that will clear the crash description string // on exit of this function. - lldb_utility::CleanUp <const char *> crash_description_cleanup(NULL, Host::SetCrashDescription); + lldb_utility::CleanUp <const char *> crash_description_cleanup(nullptr, Host::SetCrashDescription); if (log) log->Printf ("Processing command: %s", command_line); @@ -1574,7 +1574,7 @@ CommandInterpreter::HandleCommand (const char *command_line, else if (command_string[non_space] == CommandHistory::g_repeat_char) { const char *history_string = m_command_history.FindString(command_string.c_str() + non_space); - if (history_string == NULL) + if (history_string == nullptr) { result.AppendErrorWithFormat ("Could not find entry: %s in history", command_string.c_str()); result.SetStatus(eReturnStatusFailed); @@ -1650,7 +1650,7 @@ CommandInterpreter::HandleCommand (const char *command_line, char quote_char = '\0'; std::string suffix; ExtractCommand (command_string, next_word, suffix, quote_char); - if (cmd_obj == NULL) + if (cmd_obj == nullptr) { std::string full_name; if (GetAliasFullName(next_word.c_str(), full_name)) @@ -1710,7 +1710,7 @@ CommandInterpreter::HandleCommand (const char *command_line, } } - if (cmd_obj == NULL) + if (cmd_obj == nullptr) { const size_t num_matches = matches.GetSize(); if (matches.GetSize() > 1) { @@ -1823,13 +1823,13 @@ CommandInterpreter::HandleCommand (const char *command_line, // Take care of things like setting up the history command & calling the appropriate Execute method on the // CommandObject, with the appropriate arguments. - if (cmd_obj != NULL) + if (cmd_obj != nullptr) { if (add_to_history) { Args command_args (revised_command_line.GetData()); const char *repeat_command = cmd_obj->GetRepeatCommand(command_args, 0); - if (repeat_command != NULL) + if (repeat_command != nullptr) m_repeat_command.assign(repeat_command); else m_repeat_command.assign(original_command_string.c_str()); @@ -1931,7 +1931,7 @@ CommandInterpreter::HandleCompletionMatches (Args &parsed_line, if (num_command_matches == 1 && cmd_obj && cmd_obj->IsMultiwordObject() - && matches.GetStringAtIndex(0) != NULL + && matches.GetStringAtIndex(0) != nullptr && strcmp (parsed_line.GetArgumentAtIndex(0), matches.GetStringAtIndex(0)) == 0) { if (parsed_line.GetArgumentCount() == 1) @@ -1956,7 +1956,7 @@ CommandInterpreter::HandleCompletionMatches (Args &parsed_line, // to complete the command. // First see if there is a matching initial command: CommandObject *command_object = GetCommandObject (parsed_line.GetArgumentAtIndex(0)); - if (command_object == NULL) + if (command_object == nullptr) { return 0; } @@ -2002,7 +2002,7 @@ CommandInterpreter::HandleCompletion (const char *current_line, else if (first_arg[0] == CommandHistory::g_repeat_char) { const char *history_string = m_command_history.FindString (first_arg); - if (history_string != NULL) + if (history_string != nullptr) { matches.Clear(); matches.InsertStringAtIndex(0, history_string); @@ -2392,7 +2392,7 @@ CommandInterpreter::SourceInitFile (bool in_cwd, CommandReturnObject &result) { const bool saved_batch = SetBatchCommandMode (true); HandleCommandsFromFile (init_file, - NULL, // Execution context + nullptr, // Execution context eLazyBoolYes, // Stop on continue eLazyBoolNo, // Stop on error eLazyBoolNo, // Don't echo commands @@ -2445,7 +2445,7 @@ CommandInterpreter::HandleCommands (const StringList &commands, // If we've been given an execution context, set it at the start, but don't keep resetting it or we will // cause series of commands that change the context, then do an operation that relies on that context to fail. - if (override_context != NULL) + if (override_context != nullptr) UpdateExecutionContext (override_context); if (!stop_on_continue) @@ -2475,9 +2475,9 @@ CommandInterpreter::HandleCommands (const StringList &commands, if (!add_to_history) m_command_source_depth++; bool success = HandleCommand(cmd, add_to_history, tmp_result, - NULL, /* override_context */ + nullptr, /* override_context */ true, /* repeat_on_empty_command */ - override_context != NULL /* no_context_switching */); + override_context != nullptr /* no_context_switching */); if (!add_to_history) m_command_source_depth--; @@ -2490,7 +2490,7 @@ CommandInterpreter::HandleCommands (const StringList &commands, if (!success || !tmp_result.Succeeded()) { const char *error_msg = tmp_result.GetErrorData(); - if (error_msg == NULL || error_msg[0] == '\0') + if (error_msg == nullptr || error_msg[0] == '\0') error_msg = "<unknown error>.\n"; if (stop_on_error) { @@ -2660,7 +2660,7 @@ CommandInterpreter::HandleCommandsFromFile (FileSpec &cmd_file, empty_stream_sp, // Pass in an empty stream so we inherit the top input reader output stream empty_stream_sp, // Pass in an empty stream so we inherit the top input reader error stream flags, - NULL, // Pass in NULL for "editline_name" so no history is saved, or written + nullptr, // Pass in NULL for "editline_name" so no history is saved, or written debugger.GetPrompt(), false, // Not multi-line 0, @@ -2700,11 +2700,11 @@ CommandInterpreter::HandleCommandsFromFile (FileSpec &cmd_file, ScriptInterpreter * CommandInterpreter::GetScriptInterpreter (bool can_create) { - if (m_script_interpreter_ap.get() != NULL) + if (m_script_interpreter_ap.get() != nullptr) return m_script_interpreter_ap.get(); if (!can_create) - return NULL; + return nullptr; // <rdar://problem/11751427> // we need to protect the initialization of the script interpreter @@ -2929,7 +2929,7 @@ CommandInterpreter::FindCommandsForApropos (const char *search_word, StringList void CommandInterpreter::UpdateExecutionContext (ExecutionContext *override_context) { - if (override_context != NULL) + if (override_context != nullptr) { m_exe_ctx_ref = *override_context; } diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp index 0dba2a3283f..cb2e5d5e8d7 100644 --- a/lldb/source/Interpreter/CommandObject.cpp +++ b/lldb/source/Interpreter/CommandObject.cpp @@ -56,8 +56,8 @@ CommandObject::CommandObject m_is_alias (false), m_flags (flags), m_arguments(), - m_command_override_callback (NULL), - m_command_override_baton (NULL) + m_command_override_callback (nullptr), + m_command_override_baton (nullptr) { if (help && help[0]) m_cmd_help_short = help; @@ -88,7 +88,7 @@ CommandObject::GetSyntax () { StreamString syntax_str; syntax_str.Printf ("%s", GetCommandName()); - if (GetOptions() != NULL) + if (GetOptions() != nullptr) syntax_str.Printf (" <cmd-options>"); if (m_arguments.size() > 0) { @@ -144,7 +144,7 @@ CommandObject::GetOptions () { // By default commands don't have options unless this virtual function // is overridden by base classes. - return NULL; + return nullptr; } bool @@ -156,7 +156,7 @@ CommandObject::ParseOptions { // See if the subclass has options? Options *options = GetOptions(); - if (options != NULL) + if (options != nullptr) { Error error; options->NotifyOptionParsingStarting(); @@ -251,7 +251,7 @@ CommandObject::CheckRequirements (CommandReturnObject &result) return false; } - if ((flags & eFlagRequiresRegContext) && (m_exe_ctx.GetRegisterContext() == NULL)) + if ((flags & eFlagRequiresRegContext) && (m_exe_ctx.GetRegisterContext() == nullptr)) { result.AppendError (GetInvalidRegContextDescription()); return false; @@ -268,7 +268,7 @@ CommandObject::CheckRequirements (CommandReturnObject &result) if (GetFlags().AnySet (CommandObject::eFlagProcessMustBeLaunched | CommandObject::eFlagProcessMustBePaused)) { Process *process = m_interpreter.GetExecutionContext().GetProcessPtr(); - if (process == NULL) + if (process == nullptr) { // A process that is not running is considered paused. if (GetFlags().Test(CommandObject::eFlagProcessMustBeLaunched)) @@ -335,7 +335,7 @@ class CommandDictCommandPartialMatch bool operator() (const std::pair<std::string, lldb::CommandObjectSP> map_element) const { // A NULL or empty string matches everything. - if (m_match_str == NULL || *m_match_str == '\0') + if (m_match_str == nullptr || *m_match_str == '\0') return true; return map_element.first.find (m_match_str, 0) == 0; @@ -392,7 +392,7 @@ CommandObject::HandleCompletion CommandReturnObject result; OptionElementVector opt_element_vector; - if (cur_options != NULL) + if (cur_options != nullptr) { // Re-insert the dummy command name string which will have been // stripped off: @@ -453,7 +453,7 @@ CommandObject::HelpTextContainsWord (const char *search_word) found_word = true; if (!found_word - && GetOptions() != NULL) + && GetOptions() != nullptr) { StreamString usage_help; GetOptions()->GenerateOptionUsage (usage_help, this); @@ -480,7 +480,7 @@ CommandObject::GetArgumentEntryAtIndex (int idx) if (static_cast<size_t>(idx) < m_arguments.size()) return &(m_arguments[idx]); - return NULL; + return nullptr; } CommandObject::ArgumentTableEntry * @@ -492,7 +492,7 @@ CommandObject::FindArgumentDataByType (CommandArgumentType arg_type) if (table[i].arg_type == arg_type) return (ArgumentTableEntry *) &(table[i]); - return NULL; + return nullptr; } void @@ -771,7 +771,7 @@ static const char * FormatHelpTextCallback () { - static char* help_text_ptr = NULL; + static char* help_text_ptr = nullptr; if (help_text_ptr) return help_text_ptr; @@ -804,7 +804,7 @@ FormatHelpTextCallback () static const char * LanguageTypeHelpTextCallback () { - static char* help_text_ptr = NULL; + static char* help_text_ptr = nullptr; if (help_text_ptr) return help_text_ptr; @@ -900,7 +900,7 @@ void CommandObject::GenerateHelpText (Stream &output_strm) { CommandInterpreter& interpreter = GetCommandInterpreter(); - if (GetOptions() != NULL) + if (GetOptions() != nullptr) { if (WantsRawCommandString()) { @@ -913,7 +913,7 @@ CommandObject::GenerateHelpText (Stream &output_strm) output_strm.Printf ("\nSyntax: %s\n", GetSyntax()); GetOptions()->GenerateOptionUsage (output_strm, this); const char *long_help = GetHelpLong(); - if ((long_help != NULL) + if ((long_help != nullptr) && (strlen (long_help) > 0)) output_strm.Printf ("\n%s", long_help); if (WantsRawCommandString() && !WantsCompletion()) @@ -950,7 +950,7 @@ CommandObject::GenerateHelpText (Stream &output_strm) else { const char *long_help = GetHelpLong(); - if ((long_help != NULL) + if ((long_help != nullptr) && (strlen (long_help) > 0)) output_strm.Printf ("%s", long_help); else if (WantsRawCommandString()) @@ -990,7 +990,7 @@ CommandObject::GetArgumentTypeAsCString (const lldb::CommandArgumentType arg_typ { if (arg_type >=0 && arg_type < eArgTypeLastArg) return g_arguments_data[arg_type].arg_name; - return NULL; + return nullptr; } @@ -999,7 +999,7 @@ CommandObject::GetArgumentDescriptionAsCString (const lldb::CommandArgumentType { if (arg_type >=0 && arg_type < eArgTypeLastArg) return g_arguments_data[arg_type].help_text; - return NULL; + return nullptr; } bool @@ -1047,7 +1047,7 @@ CommandObjectRaw::Execute (const char *args_string, CommandReturnObject &result) std::string full_command (GetCommandName ()); full_command += ' '; full_command += args_string; - const char *argv[2] = { NULL, NULL }; + const char *argv[2] = { nullptr, nullptr }; argv[0] = full_command.c_str(); handled = command_callback (GetOverrideCallbackBaton(), argv); } @@ -1068,7 +1068,7 @@ const char *arch_helper() if (g_archs_help.Empty()) { StringList archs; - ArchSpec::AutoComplete(NULL, archs); + ArchSpec::AutoComplete(nullptr, archs); g_archs_help.Printf("These are the supported architecture names:\n"); archs.Join("\n", g_archs_help); } @@ -1078,86 +1078,86 @@ const char *arch_helper() CommandObject::ArgumentTableEntry CommandObject::g_arguments_data[] = { - { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { NULL, false }, "A valid address in the target program's execution space." }, - { eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, { NULL, false }, "An expression that resolves to an address." }, - { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of an abbreviation (alias) for a debugger command." }, - { eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, { NULL, false }, "Command options to be used as part of an alias (abbreviation) definition. (See 'help commands alias' for more information.)" }, + { eArgTypeAddress, "address", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid address in the target program's execution space." }, + { eArgTypeAddressOrExpression, "address-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "An expression that resolves to an address." }, + { eArgTypeAliasName, "alias-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of an abbreviation (alias) for a debugger command." }, + { eArgTypeAliasOptions, "options-for-aliased-command", CommandCompletions::eNoCompletion, { nullptr, false }, "Command options to be used as part of an alias (abbreviation) definition. (See 'help commands alias' for more information.)" }, { eArgTypeArchitecture, "arch", CommandCompletions::eArchitectureCompletion, { arch_helper, true }, "The architecture name, e.g. i386 or x86_64." }, - { eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, { NULL, false }, "A Boolean value: 'true' or 'false'" }, - { eArgTypeBreakpointID, "breakpt-id", CommandCompletions::eNoCompletion, { BreakpointIDHelpTextCallback, false }, NULL }, - { eArgTypeBreakpointIDRange, "breakpt-id-list", CommandCompletions::eNoCompletion, { BreakpointIDRangeHelpTextCallback, false }, NULL }, - { eArgTypeByteSize, "byte-size", CommandCompletions::eNoCompletion, { NULL, false }, "Number of bytes to use." }, - { eArgTypeClassName, "class-name", CommandCompletions::eNoCompletion, { NULL, false }, "Then name of a class from the debug information in the program." }, - { eArgTypeCommandName, "cmd-name", CommandCompletions::eNoCompletion, { NULL, false }, "A debugger command (may be multiple words), without any options or arguments." }, - { eArgTypeCount, "count", CommandCompletions::eNoCompletion, { NULL, false }, "An unsigned integer." }, - { eArgTypeDirectoryName, "directory", CommandCompletions::eDiskDirectoryCompletion, { NULL, false }, "A directory name." }, - { eArgTypeDisassemblyFlavor, "disassembly-flavor", CommandCompletions::eNoCompletion, { NULL, false }, "A disassembly flavor recognized by your disassembly plugin. Currently the only valid options are \"att\" and \"intel\" for Intel targets" }, - { eArgTypeDescriptionVerbosity, "description-verbosity", CommandCompletions::eNoCompletion, { NULL, false }, "How verbose the output of 'po' should be." }, - { eArgTypeEndAddress, "end-address", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeExpression, "expr", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeExpressionPath, "expr-path", CommandCompletions::eNoCompletion, { ExprPathHelpTextCallback, true }, NULL }, - { eArgTypeExprFormat, "expression-format", CommandCompletions::eNoCompletion, { NULL, false }, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]" }, - { eArgTypeFilename, "filename", CommandCompletions::eDiskFileCompletion, { NULL, false }, "The name of a file (can include path)." }, - { eArgTypeFormat, "format", CommandCompletions::eNoCompletion, { FormatHelpTextCallback, true }, NULL }, - { eArgTypeFrameIndex, "frame-index", CommandCompletions::eNoCompletion, { NULL, false }, "Index into a thread's list of frames." }, - { eArgTypeFullName, "fullname", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a function." }, - { eArgTypeFunctionOrSymbol, "function-or-symbol", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a function or symbol." }, - { eArgTypeGDBFormat, "gdb-format", CommandCompletions::eNoCompletion, { GDBFormatHelpTextCallback, true }, NULL }, - { eArgTypeIndex, "index", CommandCompletions::eNoCompletion, { NULL, false }, "An index into a list." }, - { eArgTypeLanguage, "language", CommandCompletions::eNoCompletion, { LanguageTypeHelpTextCallback, true }, NULL }, - { eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, { NULL, false }, "Line number in a source file." }, - { eArgTypeLogCategory, "log-category", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a category within a log channel, e.g. all (try \"log list\" to see a list of all channels and their categories." }, - { eArgTypeLogChannel, "log-channel", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a log channel, e.g. process.gdb-remote (try \"log list\" to see a list of all channels and their categories)." }, - { eArgTypeMethod, "method", CommandCompletions::eNoCompletion, { NULL, false }, "A C++ method name." }, - { eArgTypeName, "name", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeNewPathPrefix, "new-path-prefix", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeNumLines, "num-lines", CommandCompletions::eNoCompletion, { NULL, false }, "The number of lines to use." }, - { eArgTypeNumberPerLine, "number-per-line", CommandCompletions::eNoCompletion, { NULL, false }, "The number of items per line to display." }, - { eArgTypeOffset, "offset", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeOldPathPrefix, "old-path-prefix", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeOneLiner, "one-line-command", CommandCompletions::eNoCompletion, { NULL, false }, "A command that is entered as a single line of text." }, - { eArgTypePath, "path", CommandCompletions::eDiskFileCompletion, { NULL, false }, "Path." }, - { eArgTypePermissionsNumber, "perms-numeric", CommandCompletions::eNoCompletion, { NULL, false }, "Permissions given as an octal number (e.g. 755)." }, - { eArgTypePermissionsString, "perms=string", CommandCompletions::eNoCompletion, { NULL, false }, "Permissions given as a string value (e.g. rw-r-xr--)." }, - { eArgTypePid, "pid", CommandCompletions::eNoCompletion, { NULL, false }, "The process ID number." }, - { eArgTypePlugin, "plugin", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeProcessName, "process-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of the process." }, - { eArgTypePythonClass, "python-class", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a Python class." }, - { eArgTypePythonFunction, "python-function", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a Python function." }, - { eArgTypePythonScript, "python-script", CommandCompletions::eNoCompletion, { NULL, false }, "Source code written in Python." }, - { eArgTypeQueueName, "queue-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of the thread queue." }, - { eArgTypeRegisterName, "register-name", CommandCompletions::eNoCompletion, { RegisterNameHelpTextCallback, true }, NULL }, - { eArgTypeRegularExpression, "regular-expression", CommandCompletions::eNoCompletion, { NULL, false }, "A regular expression." }, - { eArgTypeRunArgs, "run-args", CommandCompletions::eNoCompletion, { NULL, false }, "Arguments to be passed to the target program when it starts executing." }, - { eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", CommandCompletions::eNoCompletion, { NULL, false }, "The synchronicity to use to run scripted commands with regard to LLDB event system." }, - { eArgTypeScriptLang, "script-language", CommandCompletions::eNoCompletion, { NULL, false }, "The scripting language to be used for script-based commands. Currently only Python is valid." }, - { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { NULL, false }, "The word for which you wish to search for information about." }, - { eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, { NULL, false }, "An Objective-C selector name." }, - { eArgTypeSettingIndex, "setting-index", CommandCompletions::eNoCompletion, { NULL, false }, "An index into a settings variable that is an array (try 'settings list' to see all the possible settings variables and their types)." }, - { eArgTypeSettingKey, "setting-key", CommandCompletions::eNoCompletion, { NULL, false }, "A key into a settings variables that is a dictionary (try 'settings list' to see all the possible settings variables and their types)." }, - { eArgTypeSettingPrefix, "setting-prefix", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a settable internal debugger variable up to a dot ('.'), e.g. 'target.process.'" }, - { eArgTypeSettingVariableName, "setting-variable-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a settable internal debugger variable. Type 'settings list' to see a complete list of such variables." }, - { eArgTypeShlibName, "shlib-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a shared library." }, - { eArgTypeSourceFile, "source-file", CommandCompletions::eSourceFileCompletion, { NULL, false }, "The name of a source file.." }, - { eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, { NULL, false }, "Specify a sort order when dumping lists." }, - { eArgTypeStartAddress, "start-address", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeSummaryString, "summary-string", CommandCompletions::eNoCompletion, { SummaryStringHelpTextCallback, true }, NULL }, - { eArgTypeSymbol, "symbol", CommandCompletions::eSymbolCompletion, { NULL, false }, "Any symbol name (function name, variable, argument, etc.)" }, - { eArgTypeThreadID, "thread-id", CommandCompletions::eNoCompletion, { NULL, false }, "Thread ID number." }, - { eArgTypeThreadIndex, "thread-index", CommandCompletions::eNoCompletion, { NULL, false }, "Index into the process' list of threads." }, - { eArgTypeThreadName, "thread-name", CommandCompletions::eNoCompletion, { NULL, false }, "The thread's name." }, - { eArgTypeUnsignedInteger, "unsigned-integer", CommandCompletions::eNoCompletion, { NULL, false }, "An unsigned integer." }, - { eArgTypeUnixSignal, "unix-signal", CommandCompletions::eNoCompletion, { NULL, false }, "A valid Unix signal name or number (e.g. SIGKILL, KILL or 9)." }, - { eArgTypeVarName, "variable-name", CommandCompletions::eNoCompletion, { NULL, false }, "The name of a variable in your program." }, - { eArgTypeValue, "value", CommandCompletions::eNoCompletion, { NULL, false }, "A value could be anything, depending on where and how it is used." }, - { eArgTypeWidth, "width", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." }, - { eArgTypeNone, "none", CommandCompletions::eNoCompletion, { NULL, false }, "No help available for this." }, - { eArgTypePlatform, "platform-name", CommandCompletions::ePlatformPluginCompletion, { NULL, false }, "The name of an installed platform plug-in . Type 'platform list' to see a complete list of installed platforms." }, - { eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, { NULL, false }, "Watchpoint IDs are positive integers." }, - { eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { NULL, false }, "For example, '1-3' or '1 to 3'." }, - { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { NULL, false }, "Specify the type for a watchpoint." } + { eArgTypeBoolean, "boolean", CommandCompletions::eNoCompletion, { nullptr, false }, "A Boolean value: 'true' or 'false'" }, + { eArgTypeBreakpointID, "breakpt-id", CommandCompletions::eNoCompletion, { BreakpointIDHelpTextCallback, false }, nullptr }, + { eArgTypeBreakpointIDRange, "breakpt-id-list", CommandCompletions::eNoCompletion, { BreakpointIDRangeHelpTextCallback, false }, nullptr }, + { eArgTypeByteSize, "byte-size", CommandCompletions::eNoCompletion, { nullptr, false }, "Number of bytes to use." }, + { eArgTypeClassName, "class-name", CommandCompletions::eNoCompletion, { nullptr, false }, "Then name of a class from the debug information in the program." }, + { eArgTypeCommandName, "cmd-name", CommandCompletions::eNoCompletion, { nullptr, false }, "A debugger command (may be multiple words), without any options or arguments." }, + { eArgTypeCount, "count", CommandCompletions::eNoCompletion, { nullptr, false }, "An unsigned integer." }, + { eArgTypeDirectoryName, "directory", CommandCompletions::eDiskDirectoryCompletion, { nullptr, false }, "A directory name." }, + { eArgTypeDisassemblyFlavor, "disassembly-flavor", CommandCompletions::eNoCompletion, { nullptr, false }, "A disassembly flavor recognized by your disassembly plugin. Currently the only valid options are \"att\" and \"intel\" for Intel targets" }, + { eArgTypeDescriptionVerbosity, "description-verbosity", CommandCompletions::eNoCompletion, { nullptr, false }, "How verbose the output of 'po' should be." }, + { eArgTypeEndAddress, "end-address", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeExpression, "expr", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeExpressionPath, "expr-path", CommandCompletions::eNoCompletion, { ExprPathHelpTextCallback, true }, nullptr }, + { eArgTypeExprFormat, "expression-format", CommandCompletions::eNoCompletion, { nullptr, false }, "[ [bool|b] | [bin] | [char|c] | [oct|o] | [dec|i|d|u] | [hex|x] | [float|f] | [cstr|s] ]" }, + { eArgTypeFilename, "filename", CommandCompletions::eDiskFileCompletion, { nullptr, false }, "The name of a file (can include path)." }, + { eArgTypeFormat, "format", CommandCompletions::eNoCompletion, { FormatHelpTextCallback, true }, nullptr }, + { eArgTypeFrameIndex, "frame-index", CommandCompletions::eNoCompletion, { nullptr, false }, "Index into a thread's list of frames." }, + { eArgTypeFullName, "fullname", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeFunctionName, "function-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function." }, + { eArgTypeFunctionOrSymbol, "function-or-symbol", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a function or symbol." }, + { eArgTypeGDBFormat, "gdb-format", CommandCompletions::eNoCompletion, { GDBFormatHelpTextCallback, true }, nullptr }, + { eArgTypeIndex, "index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a list." }, + { eArgTypeLanguage, "language", CommandCompletions::eNoCompletion, { LanguageTypeHelpTextCallback, true }, nullptr }, + { eArgTypeLineNum, "linenum", CommandCompletions::eNoCompletion, { nullptr, false }, "Line number in a source file." }, + { eArgTypeLogCategory, "log-category", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a category within a log channel, e.g. all (try \"log list\" to see a list of all channels and their categories." }, + { eArgTypeLogChannel, "log-channel", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a log channel, e.g. process.gdb-remote (try \"log list\" to see a list of all channels and their categories)." }, + { eArgTypeMethod, "method", CommandCompletions::eNoCompletion, { nullptr, false }, "A C++ method name." }, + { eArgTypeName, "name", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeNewPathPrefix, "new-path-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeNumLines, "num-lines", CommandCompletions::eNoCompletion, { nullptr, false }, "The number of lines to use." }, + { eArgTypeNumberPerLine, "number-per-line", CommandCompletions::eNoCompletion, { nullptr, false }, "The number of items per line to display." }, + { eArgTypeOffset, "offset", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeOldPathPrefix, "old-path-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeOneLiner, "one-line-command", CommandCompletions::eNoCompletion, { nullptr, false }, "A command that is entered as a single line of text." }, + { eArgTypePath, "path", CommandCompletions::eDiskFileCompletion, { nullptr, false }, "Path." }, + { eArgTypePermissionsNumber, "perms-numeric", CommandCompletions::eNoCompletion, { nullptr, false }, "Permissions given as an octal number (e.g. 755)." }, + { eArgTypePermissionsString, "perms=string", CommandCompletions::eNoCompletion, { nullptr, false }, "Permissions given as a string value (e.g. rw-r-xr--)." }, + { eArgTypePid, "pid", CommandCompletions::eNoCompletion, { nullptr, false }, "The process ID number." }, + { eArgTypePlugin, "plugin", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeProcessName, "process-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of the process." }, + { eArgTypePythonClass, "python-class", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a Python class." }, + { eArgTypePythonFunction, "python-function", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a Python function." }, + { eArgTypePythonScript, "python-script", CommandCompletions::eNoCompletion, { nullptr, false }, "Source code written in Python." }, + { eArgTypeQueueName, "queue-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of the thread queue." }, + { eArgTypeRegisterName, "register-name", CommandCompletions::eNoCompletion, { RegisterNameHelpTextCallback, true }, nullptr }, + { eArgTypeRegularExpression, "regular-expression", CommandCompletions::eNoCompletion, { nullptr, false }, "A regular expression." }, + { eArgTypeRunArgs, "run-args", CommandCompletions::eNoCompletion, { nullptr, false }, "Arguments to be passed to the target program when it starts executing." }, + { eArgTypeRunMode, "run-mode", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeScriptedCommandSynchronicity, "script-cmd-synchronicity", CommandCompletions::eNoCompletion, { nullptr, false }, "The synchronicity to use to run scripted commands with regard to LLDB event system." }, + { eArgTypeScriptLang, "script-language", CommandCompletions::eNoCompletion, { nullptr, false }, "The scripting language to be used for script-based commands. Currently only Python is valid." }, + { eArgTypeSearchWord, "search-word", CommandCompletions::eNoCompletion, { nullptr, false }, "The word for which you wish to search for information about." }, + { eArgTypeSelector, "selector", CommandCompletions::eNoCompletion, { nullptr, false }, "An Objective-C selector name." }, + { eArgTypeSettingIndex, "setting-index", CommandCompletions::eNoCompletion, { nullptr, false }, "An index into a settings variable that is an array (try 'settings list' to see all the possible settings variables and their types)." }, + { eArgTypeSettingKey, "setting-key", CommandCompletions::eNoCompletion, { nullptr, false }, "A key into a settings variables that is a dictionary (try 'settings list' to see all the possible settings variables and their types)." }, + { eArgTypeSettingPrefix, "setting-prefix", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a settable internal debugger variable up to a dot ('.'), e.g. 'target.process.'" }, + { eArgTypeSettingVariableName, "setting-variable-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a settable internal debugger variable. Type 'settings list' to see a complete list of such variables." }, + { eArgTypeShlibName, "shlib-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a shared library." }, + { eArgTypeSourceFile, "source-file", CommandCompletions::eSourceFileCompletion, { nullptr, false }, "The name of a source file.." }, + { eArgTypeSortOrder, "sort-order", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify a sort order when dumping lists." }, + { eArgTypeStartAddress, "start-address", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeSummaryString, "summary-string", CommandCompletions::eNoCompletion, { SummaryStringHelpTextCallback, true }, nullptr }, + { eArgTypeSymbol, "symbol", CommandCompletions::eSymbolCompletion, { nullptr, false }, "Any symbol name (function name, variable, argument, etc.)" }, + { eArgTypeThreadID, "thread-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Thread ID number." }, + { eArgTypeThreadIndex, "thread-index", CommandCompletions::eNoCompletion, { nullptr, false }, "Index into the process' list of threads." }, + { eArgTypeThreadName, "thread-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The thread's name." }, + { eArgTypeUnsignedInteger, "unsigned-integer", CommandCompletions::eNoCompletion, { nullptr, false }, "An unsigned integer." }, + { eArgTypeUnixSignal, "unix-signal", CommandCompletions::eNoCompletion, { nullptr, false }, "A valid Unix signal name or number (e.g. SIGKILL, KILL or 9)." }, + { eArgTypeVarName, "variable-name", CommandCompletions::eNoCompletion, { nullptr, false }, "The name of a variable in your program." }, + { eArgTypeValue, "value", CommandCompletions::eNoCompletion, { nullptr, false }, "A value could be anything, depending on where and how it is used." }, + { eArgTypeWidth, "width", CommandCompletions::eNoCompletion, { nullptr, false }, "Help text goes here." }, + { eArgTypeNone, "none", CommandCompletions::eNoCompletion, { nullptr, false }, "No help available for this." }, + { eArgTypePlatform, "platform-name", CommandCompletions::ePlatformPluginCompletion, { nullptr, false }, "The name of an installed platform plug-in . Type 'platform list' to see a complete list of installed platforms." }, + { eArgTypeWatchpointID, "watchpt-id", CommandCompletions::eNoCompletion, { nullptr, false }, "Watchpoint IDs are positive integers." }, + { eArgTypeWatchpointIDRange, "watchpt-id-list", CommandCompletions::eNoCompletion, { nullptr, false }, "For example, '1-3' or '1 to 3'." }, + { eArgTypeWatchType, "watch-type", CommandCompletions::eNoCompletion, { nullptr, false }, "Specify the type for a watchpoint." } }; const CommandObject::ArgumentTableEntry* diff --git a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp index 59cf1f05fb6..d27320dd1f3 100644 --- a/lldb/source/Interpreter/CommandObjectRegexCommand.cpp +++ b/lldb/source/Interpreter/CommandObjectRegexCommand.cpp @@ -86,11 +86,11 @@ CommandObjectRegexCommand::DoExecute result.GetOutputStream().Printf("%s\n", new_command.c_str()); // Pass in true for "no context switching". The command that called us should have set up the context // appropriately, we shouldn't have to redo that. - return m_interpreter.HandleCommand(new_command.c_str(), eLazyBoolCalculate, result, NULL, true, true); + return m_interpreter.HandleCommand(new_command.c_str(), eLazyBoolCalculate, result, nullptr, true, true); } } result.SetStatus(eReturnStatusFailed); - if (GetSyntax() != NULL) + if (GetSyntax() != nullptr) result.AppendError (GetSyntax()); else result.AppendErrorWithFormat ("Command contents '%s' failed to match any regular expression in the '%s' regex command.\n", @@ -136,7 +136,7 @@ CommandObjectRegexCommand::HandleCompletion (Args &input, completion_str.c_str(), match_start_point, max_return_elements, - NULL, + nullptr, word_complete, matches); return matches.GetSize(); diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Interpreter/CommandObjectScript.cpp index aff507d9858..9c67e425330 100644 --- a/lldb/source/Interpreter/CommandObjectScript.cpp +++ b/lldb/source/Interpreter/CommandObjectScript.cpp @@ -66,7 +66,7 @@ CommandObjectScript::DoExecute ScriptInterpreter *script_interpreter = m_interpreter.GetScriptInterpreter (); - if (script_interpreter == NULL) + if (script_interpreter == nullptr) { result.AppendError("no script interpreter"); result.SetStatus (eReturnStatusFailed); @@ -75,7 +75,7 @@ CommandObjectScript::DoExecute DataVisualization::ForceUpdate(); // script might change Python code we use for formatting.. make sure we keep up to date with it - if (command == NULL || command[0] == '\0') + if (command == nullptr || command[0] == '\0') { script_interpreter->ExecuteInterpreterLoop (); result.SetStatus (eReturnStatusSuccessFinishNoResult); diff --git a/lldb/source/Interpreter/CommandReturnObject.cpp b/lldb/source/Interpreter/CommandReturnObject.cpp index 9c63753a23f..af9196f2894 100644 --- a/lldb/source/Interpreter/CommandReturnObject.cpp +++ b/lldb/source/Interpreter/CommandReturnObject.cpp @@ -141,7 +141,7 @@ void CommandReturnObject::SetError (const Error &error, const char *fallback_error_cstr) { const char *error_cstr = error.AsCString(); - if (error_cstr == NULL) + if (error_cstr == nullptr) error_cstr = fallback_error_cstr; SetError(error_cstr); } diff --git a/lldb/source/Interpreter/OptionGroupArchitecture.cpp b/lldb/source/Interpreter/OptionGroupArchitecture.cpp index d8f35675fba..4c9d8ab28f6 100644 --- a/lldb/source/Interpreter/OptionGroupArchitecture.cpp +++ b/lldb/source/Interpreter/OptionGroupArchitecture.cpp @@ -30,7 +30,7 @@ OptionGroupArchitecture::~OptionGroupArchitecture () static OptionDefinition g_option_table[] = { - { LLDB_OPT_SET_1 , false, "arch" , 'a', OptionParser::eRequiredArgument, NULL, 0, eArgTypeArchitecture , "Specify the architecture for the target."}, + { LLDB_OPT_SET_1 , false, "arch" , 'a', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeArchitecture , "Specify the architecture for the target."}, }; uint32_t diff --git a/lldb/source/Interpreter/OptionGroupBoolean.cpp b/lldb/source/Interpreter/OptionGroupBoolean.cpp index feb135315e1..af2ba7ca057 100644 --- a/lldb/source/Interpreter/OptionGroupBoolean.cpp +++ b/lldb/source/Interpreter/OptionGroupBoolean.cpp @@ -31,7 +31,7 @@ OptionGroupBoolean::OptionGroupBoolean (uint32_t usage_mask, m_option_definition.long_option = long_option; m_option_definition.short_option = short_option; m_option_definition.option_has_arg = no_argument_toggle_default ? OptionParser::eNoArgument : OptionParser::eRequiredArgument; - m_option_definition.enum_values = NULL; + m_option_definition.enum_values = nullptr; m_option_definition.completion_type = 0; m_option_definition.argument_type = eArgTypeBoolean; m_option_definition.usage_text = usage_text; diff --git a/lldb/source/Interpreter/OptionGroupFile.cpp b/lldb/source/Interpreter/OptionGroupFile.cpp index 48469a80417..a80ed926470 100644 --- a/lldb/source/Interpreter/OptionGroupFile.cpp +++ b/lldb/source/Interpreter/OptionGroupFile.cpp @@ -31,7 +31,7 @@ OptionGroupFile::OptionGroupFile (uint32_t usage_mask, m_option_definition.long_option = long_option; m_option_definition.short_option = short_option; m_option_definition.option_has_arg = OptionParser::eRequiredArgument; - m_option_definition.enum_values = NULL; + m_option_definition.enum_values = nullptr; m_option_definition.completion_type = completion_type; m_option_definition.argument_type = argument_type; m_option_definition.usage_text = usage_text; @@ -71,7 +71,7 @@ OptionGroupFileList::OptionGroupFileList (uint32_t usage_mask, m_option_definition.long_option = long_option; m_option_definition.short_option = short_option; m_option_definition.option_has_arg = OptionParser::eRequiredArgument; - m_option_definition.enum_values = NULL; + m_option_definition.enum_values = nullptr; m_option_definition.completion_type = completion_type; m_option_definition.argument_type = argument_type; m_option_definition.usage_text = usage_text; diff --git a/lldb/source/Interpreter/OptionGroupFormat.cpp b/lldb/source/Interpreter/OptionGroupFormat.cpp index 5cae3788f3b..f929b55bd56 100644 --- a/lldb/source/Interpreter/OptionGroupFormat.cpp +++ b/lldb/source/Interpreter/OptionGroupFormat.cpp @@ -42,10 +42,10 @@ OptionGroupFormat::~OptionGroupFormat () static OptionDefinition g_option_table[] = { -{ LLDB_OPT_SET_1, false, "format" ,'f', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFormat , "Specify a format to be used for display."}, -{ LLDB_OPT_SET_2, false, "gdb-format",'G', OptionParser::eRequiredArgument, NULL, 0, eArgTypeGDBFormat, "Specify a format using a GDB format specifier string."}, -{ LLDB_OPT_SET_3, false, "size" ,'s', OptionParser::eRequiredArgument, NULL, 0, eArgTypeByteSize , "The size in bytes to use when displaying with the selected format."}, -{ LLDB_OPT_SET_4, false, "count" ,'c', OptionParser::eRequiredArgument, NULL, 0, eArgTypeCount , "The number of total items to display."}, +{ LLDB_OPT_SET_1, false, "format" ,'f', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeFormat , "Specify a format to be used for display."}, +{ LLDB_OPT_SET_2, false, "gdb-format",'G', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeGDBFormat, "Specify a format using a GDB format specifier string."}, +{ LLDB_OPT_SET_3, false, "size" ,'s', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeByteSize , "The size in bytes to use when displaying with the selected format."}, +{ LLDB_OPT_SET_4, false, "count" ,'c', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeCount , "The number of total items to display."}, }; uint32_t @@ -109,7 +109,7 @@ OptionGroupFormat::SetOptionValue (CommandInterpreter &interpreter, case 'G': { - char *end = NULL; + char *end = nullptr; const char *gdb_format_cstr = option_arg; uint64_t count = 0; if (::isdigit (gdb_format_cstr[0])) diff --git a/lldb/source/Interpreter/OptionGroupOutputFile.cpp b/lldb/source/Interpreter/OptionGroupOutputFile.cpp index 59bd82e79d1..f3ffb8a75c8 100644 --- a/lldb/source/Interpreter/OptionGroupOutputFile.cpp +++ b/lldb/source/Interpreter/OptionGroupOutputFile.cpp @@ -33,9 +33,9 @@ static const uint32_t SHORT_OPTION_APND = 0x61706e64; // 'apnd' static OptionDefinition g_option_table[] = { - { LLDB_OPT_SET_1 , false, "outfile", 'o', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFilename , "Specify a path for capturing command output."}, + { LLDB_OPT_SET_1 , false, "outfile", 'o', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeFilename , "Specify a path for capturing command output."}, { LLDB_OPT_SET_1 , false, "append-outfile" , SHORT_OPTION_APND, - OptionParser::eNoArgument, NULL, 0, eArgTypeNone , + OptionParser::eNoArgument, nullptr, 0, eArgTypeNone , "Append to the the file specified with '--outfile <path>'."}, }; diff --git a/lldb/source/Interpreter/OptionGroupPlatform.cpp b/lldb/source/Interpreter/OptionGroupPlatform.cpp index 83e28bdd02c..a97249c2f07 100644 --- a/lldb/source/Interpreter/OptionGroupPlatform.cpp +++ b/lldb/source/Interpreter/OptionGroupPlatform.cpp @@ -85,10 +85,10 @@ OptionGroupPlatform::OptionParsingStarting (CommandInterpreter &interpreter) static OptionDefinition g_option_table[] = { - { LLDB_OPT_SET_ALL, false, "platform", 'p', OptionParser::eRequiredArgument, NULL, 0, eArgTypePlatform, "Specify name of the platform to use for this target, creating the platform if necessary."}, - { LLDB_OPT_SET_ALL, false, "version" , 'v', OptionParser::eRequiredArgument, NULL, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." }, - { LLDB_OPT_SET_ALL, false, "build" , 'b', OptionParser::eRequiredArgument, NULL, 0, eArgTypeNone, "Specify the initial SDK build number." }, - { LLDB_OPT_SET_ALL, false, "sysroot" , 'S', OptionParser::eRequiredArgument, NULL, 0, eArgTypeFilename, "Specify the SDK root directory that contains a root of all remote system files." } + { LLDB_OPT_SET_ALL, false, "platform", 'p', OptionParser::eRequiredArgument, nullptr, 0, eArgTypePlatform, "Specify name of the platform to use for this target, creating the platform if necessary."}, + { LLDB_OPT_SET_ALL, false, "version" , 'v', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeNone, "Specify the initial SDK version to use prior to connecting." }, + { LLDB_OPT_SET_ALL, false, "build" , 'b', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeNone, "Specify the initial SDK build number." }, + { LLDB_OPT_SET_ALL, false, "sysroot" , 'S', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeFilename, "Specify the SDK root directory that contains a root of all remote system files." } }; const OptionDefinition* diff --git a/lldb/source/Interpreter/OptionGroupString.cpp b/lldb/source/Interpreter/OptionGroupString.cpp index 37a70d0bb24..3c013c6d621 100644 --- a/lldb/source/Interpreter/OptionGroupString.cpp +++ b/lldb/source/Interpreter/OptionGroupString.cpp @@ -32,7 +32,7 @@ OptionGroupString::OptionGroupString (uint32_t usage_mask, m_option_definition.long_option = long_option; m_option_definition.short_option = short_option; m_option_definition.option_has_arg = OptionParser::eRequiredArgument; - m_option_definition.enum_values = NULL; + m_option_definition.enum_values = nullptr; m_option_definition.completion_type = completion_type; m_option_definition.argument_type = argument_type; m_option_definition.usage_text = usage_text; diff --git a/lldb/source/Interpreter/OptionGroupUInt64.cpp b/lldb/source/Interpreter/OptionGroupUInt64.cpp index b66c8457923..38d037309fa 100644 --- a/lldb/source/Interpreter/OptionGroupUInt64.cpp +++ b/lldb/source/Interpreter/OptionGroupUInt64.cpp @@ -32,7 +32,7 @@ OptionGroupUInt64::OptionGroupUInt64 (uint32_t usage_mask, m_option_definition.long_option = long_option; m_option_definition.short_option = short_option; m_option_definition.option_has_arg = OptionParser::eRequiredArgument; - m_option_definition.enum_values = NULL; + m_option_definition.enum_values = nullptr; m_option_definition.completion_type = completion_type; m_option_definition.argument_type = argument_type; m_option_definition.usage_text = usage_text; diff --git a/lldb/source/Interpreter/OptionGroupUUID.cpp b/lldb/source/Interpreter/OptionGroupUUID.cpp index fb3ebcf7745..91b5fafc54b 100644 --- a/lldb/source/Interpreter/OptionGroupUUID.cpp +++ b/lldb/source/Interpreter/OptionGroupUUID.cpp @@ -30,7 +30,7 @@ OptionGroupUUID::~OptionGroupUUID () static OptionDefinition g_option_table[] = { - { LLDB_OPT_SET_1 , false, "uuid", 'u', OptionParser::eRequiredArgument, NULL, 0, eArgTypeNone, "A module UUID value."}, + { LLDB_OPT_SET_1 , false, "uuid", 'u', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeNone, "A module UUID value."}, }; uint32_t diff --git a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp index c79f49dc1d9..3badc0fa5a4 100644 --- a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp +++ b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp @@ -35,17 +35,17 @@ static OptionDefinition g_option_table[] = { { LLDB_OPT_SET_1, false, "dynamic-type", 'd', OptionParser::eRequiredArgument, g_dynamic_value_types, 0, eArgTypeNone, "Show the object as its full dynamic type, not its static type, if available."}, - { LLDB_OPT_SET_1, false, "synthetic-type", 'S', OptionParser::eRequiredArgument, NULL, 0, eArgTypeBoolean, "Show the object obeying its synthetic provider, if available."}, - { LLDB_OPT_SET_1, false, "depth", 'D', OptionParser::eRequiredArgument, NULL, 0, eArgTypeCount, "Set the max recurse depth when dumping aggregate types (default is infinity)."}, - { LLDB_OPT_SET_1, false, "flat", 'F', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Display results in a flat format that uses expression paths for each variable or member."}, - { LLDB_OPT_SET_1, false, "location", 'L', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Show variable location information."}, - { LLDB_OPT_SET_1, false, "object-description", 'O', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Print as an Objective-C object."}, - { LLDB_OPT_SET_1, false, "ptr-depth", 'P', OptionParser::eRequiredArgument, NULL, 0, eArgTypeCount, "The number of pointers to be traversed when dumping values (default is zero)."}, - { LLDB_OPT_SET_1, false, "show-types", 'T', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Show variable types when dumping values."}, - { LLDB_OPT_SET_1, false, "no-summary-depth", 'Y', OptionParser::eOptionalArgument, NULL, 0, eArgTypeCount, "Set the depth at which omitting summary information stops (default is 1)."}, - { LLDB_OPT_SET_1, false, "raw-output", 'R', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Don't use formatting options."}, - { LLDB_OPT_SET_1, false, "show-all-children", 'A', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Ignore the upper bound on the number of children to show."}, - { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL } + { LLDB_OPT_SET_1, false, "synthetic-type", 'S', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeBoolean, "Show the object obeying its synthetic provider, if available."}, + { LLDB_OPT_SET_1, false, "depth", 'D', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeCount, "Set the max recurse depth when dumping aggregate types (default is infinity)."}, + { LLDB_OPT_SET_1, false, "flat", 'F', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Display results in a flat format that uses expression paths for each variable or member."}, + { LLDB_OPT_SET_1, false, "location", 'L', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Show variable location information."}, + { LLDB_OPT_SET_1, false, "object-description", 'O', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Print as an Objective-C object."}, + { LLDB_OPT_SET_1, false, "ptr-depth", 'P', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeCount, "The number of pointers to be traversed when dumping values (default is zero)."}, + { LLDB_OPT_SET_1, false, "show-types", 'T', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Show variable types when dumping values."}, + { LLDB_OPT_SET_1, false, "no-summary-depth", 'Y', OptionParser::eOptionalArgument, nullptr, 0, eArgTypeCount, "Set the depth at which omitting summary information stops (default is 1)."}, + { LLDB_OPT_SET_1, false, "raw-output", 'R', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Don't use formatting options."}, + { LLDB_OPT_SET_1, false, "show-all-children", 'A', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Ignore the upper bound on the number of children to show."}, + { 0, false, nullptr, 0, 0, nullptr, 0, eArgTypeNone, nullptr } }; uint32_t @@ -139,7 +139,7 @@ OptionGroupValueObjectDisplay::OptionParsingStarting (CommandInterpreter &interp ignore_cap = false; Target *target = interpreter.GetExecutionContext().GetTargetPtr(); - if (target != NULL) + if (target != nullptr) use_dynamic = target->GetPreferDynamicValue(); else { diff --git a/lldb/source/Interpreter/OptionGroupVariable.cpp b/lldb/source/Interpreter/OptionGroupVariable.cpp index 31c2547e2c3..e2acc94df20 100644 --- a/lldb/source/Interpreter/OptionGroupVariable.cpp +++ b/lldb/source/Interpreter/OptionGroupVariable.cpp @@ -28,14 +28,14 @@ using namespace lldb_private; static OptionDefinition g_option_table[] = { - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args", 'a', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Omit function arguments."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals", 'l', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Omit local variables."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals", 'g', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Show the current frame source file global and static variables."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration",'c', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Show variable declaration information (source file and line where the variable was declared)."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex", 'r', OptionParser::eNoArgument, NULL, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."}, - { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope", 's', OptionParser::eNoArgument, NULL, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."}, - { LLDB_OPT_SET_1, false, "summary", 'y', OptionParser::eRequiredArgument, NULL, 0, eArgTypeName, "Specify the summary that the variable output should use."}, - { LLDB_OPT_SET_2, false, "summary-string", 'z', OptionParser::eRequiredArgument, NULL, 0, eArgTypeName, "Specify a summary string to use to format the variable output."}, + { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-args", 'a', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Omit function arguments."}, + { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "no-locals", 'l', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Omit local variables."}, + { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-globals", 'g', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Show the current frame source file global and static variables."}, + { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "show-declaration",'c', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Show variable declaration information (source file and line where the variable was declared)."}, + { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "regex", 'r', OptionParser::eNoArgument, nullptr, 0, eArgTypeRegularExpression, "The <variable-name> argument for name lookups are regular expressions."}, + { LLDB_OPT_SET_1 | LLDB_OPT_SET_2, false, "scope", 's', OptionParser::eNoArgument, nullptr, 0, eArgTypeNone, "Show variable scope (argument, local, global, static)."}, + { LLDB_OPT_SET_1, false, "summary", 'y', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeName, "Specify the summary that the variable output should use."}, + { LLDB_OPT_SET_2, false, "summary-string", 'z', OptionParser::eRequiredArgument, nullptr, 0, eArgTypeName, "Specify a summary string to use to format the variable output."}, }; static Error diff --git a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp index 09dc8ed88d2..bc2548e4445 100644 --- a/lldb/source/Interpreter/OptionGroupWatchpoint.cpp +++ b/lldb/source/Interpreter/OptionGroupWatchpoint.cpp @@ -25,7 +25,7 @@ static OptionEnumValueElement g_watch_type[] = { OptionGroupWatchpoint::eWatchRead, "read", "Watch for read"}, { OptionGroupWatchpoint::eWatchWrite, "write", "Watch for write"}, { OptionGroupWatchpoint::eWatchReadWrite, "read_write", "Watch for read/write"}, - { 0, NULL, NULL } + { 0, nullptr, nullptr } }; static OptionEnumValueElement g_watch_size[] = @@ -34,7 +34,7 @@ static OptionEnumValueElement g_watch_size[] = { 2, "2", "Watch for byte size of 2"}, { 4, "4", "Watch for byte size of 4"}, { 8, "8", "Watch for byte size of 8"}, - { 0, NULL, NULL } + { 0, nullptr, nullptr } }; static OptionDefinition diff --git a/lldb/source/Interpreter/OptionValue.cpp b/lldb/source/Interpreter/OptionValue.cpp index 1f6b03ddac1..bc1e1c4c477 100644 --- a/lldb/source/Interpreter/OptionValue.cpp +++ b/lldb/source/Interpreter/OptionValue.cpp @@ -60,7 +60,7 @@ OptionValue::GetAsBoolean () { if (GetType () == OptionValue::eTypeBoolean) return static_cast<OptionValueBoolean *>(this); - return NULL; + return nullptr; } const OptionValueBoolean * @@ -68,7 +68,7 @@ OptionValue::GetAsBoolean () const { if (GetType () == OptionValue::eTypeBoolean) return static_cast<const OptionValueBoolean *>(this); - return NULL; + return nullptr; } @@ -77,7 +77,7 @@ OptionValue::GetAsFileSpec () { if (GetType () == OptionValue::eTypeFileSpec) return static_cast<OptionValueFileSpec *>(this); - return NULL; + return nullptr; } @@ -86,7 +86,7 @@ OptionValue::GetAsFileSpec () const { if (GetType () == OptionValue::eTypeFileSpec) return static_cast<const OptionValueFileSpec *>(this); - return NULL; + return nullptr; } @@ -95,7 +95,7 @@ OptionValue::GetAsFileSpecList () { if (GetType () == OptionValue::eTypeFileSpecList) return static_cast<OptionValueFileSpecList *>(this); - return NULL; + return nullptr; } @@ -104,7 +104,7 @@ OptionValue::GetAsFileSpecList () const { if (GetType () == OptionValue::eTypeFileSpecList) return static_cast<const OptionValueFileSpecList *>(this); - return NULL; + return nullptr; } @@ -113,7 +113,7 @@ OptionValue::GetAsArch () { if (GetType () == OptionValue::eTypeArch) return static_cast<OptionValueArch *>(this); - return NULL; + return nullptr; } @@ -122,7 +122,7 @@ OptionValue::GetAsArch () const { if (GetType () == OptionValue::eTypeArch) return static_cast<const OptionValueArch *>(this); - return NULL; + return nullptr; } OptionValueArray * @@ -130,7 +130,7 @@ OptionValue::GetAsArray () { if (GetType () == OptionValue::eTypeArray) return static_cast<OptionValueArray *>(this); - return NULL; + return nullptr; } @@ -139,7 +139,7 @@ OptionValue::GetAsArray () const { if (GetType () == OptionValue::eTypeArray) return static_cast<const OptionValueArray *>(this); - return NULL; + return nullptr; } OptionValueArgs * @@ -147,7 +147,7 @@ OptionValue::GetAsArgs () { if (GetType () == OptionValue::eTypeArgs) return static_cast<OptionValueArgs *>(this); - return NULL; + return nullptr; } @@ -156,7 +156,7 @@ OptionValue::GetAsArgs () const { if (GetType () == OptionValue::eTypeArgs) return static_cast<const OptionValueArgs *>(this); - return NULL; + return nullptr; } OptionValueDictionary * @@ -164,7 +164,7 @@ OptionValue::GetAsDictionary () { if (GetType () == OptionValue::eTypeDictionary) return static_cast<OptionValueDictionary *>(this); - return NULL; + return nullptr; } const OptionValueDictionary * @@ -172,7 +172,7 @@ OptionValue::GetAsDictionary () const { if (GetType () == OptionValue::eTypeDictionary) return static_cast<const OptionValueDictionary *>(this); - return NULL; + return nullptr; } OptionValueEnumeration * @@ -180,7 +180,7 @@ OptionValue::GetAsEnumeration () { if (GetType () == OptionValue::eTypeEnum) return static_cast<OptionValueEnumeration *>(this); - return NULL; + return nullptr; } const OptionValueEnumeration * @@ -188,7 +188,7 @@ OptionValue::GetAsEnumeration () const { if (GetType () == OptionValue::eTypeEnum) return static_cast<const OptionValueEnumeration *>(this); - return NULL; + return nullptr; } OptionValueFormat * @@ -196,7 +196,7 @@ OptionValue::GetAsFormat () { if (GetType () == OptionValue::eTypeFormat) return static_cast<OptionValueFormat *>(this); - return NULL; + return nullptr; } const OptionValueFormat * @@ -204,7 +204,7 @@ OptionValue::GetAsFormat () const { if (GetType () == OptionValue::eTypeFormat) return static_cast<const OptionValueFormat *>(this); - return NULL; + return nullptr; } OptionValuePathMappings * @@ -212,7 +212,7 @@ OptionValue::GetAsPathMappings () { if (GetType () == OptionValue::eTypePathMap) return static_cast<OptionValuePathMappings *>(this); - return NULL; + return nullptr; } const OptionValuePathMappings * @@ -220,7 +220,7 @@ OptionValue::GetAsPathMappings () const { if (GetType () == OptionValue::eTypePathMap) return static_cast<const OptionValuePathMappings *>(this); - return NULL; + return nullptr; } OptionValueProperties * @@ -228,7 +228,7 @@ OptionValue::GetAsProperties () { if (GetType () == OptionValue::eTypeProperties) return static_cast<OptionValueProperties *>(this); - return NULL; + return nullptr; } const OptionValueProperties * @@ -236,7 +236,7 @@ OptionValue::GetAsProperties () const { if (GetType () == OptionValue::eTypeProperties) return static_cast<const OptionValueProperties *>(this); - return NULL; + return nullptr; } OptionValueRegex * @@ -244,7 +244,7 @@ OptionValue::GetAsRegex () { if (GetType () == OptionValue::eTypeRegex) return static_cast<OptionValueRegex *>(this); - return NULL; + return nullptr; } const OptionValueRegex * @@ -252,7 +252,7 @@ OptionValue::GetAsRegex () const { if (GetType () == OptionValue::eTypeRegex) return static_cast<const OptionValueRegex *>(this); - return NULL; + return nullptr; } OptionValueSInt64 * @@ -260,7 +260,7 @@ OptionValue::GetAsSInt64 () { if (GetType () == OptionValue::eTypeSInt64) return static_cast<OptionValueSInt64 *>(this); - return NULL; + return nullptr; } const OptionValueSInt64 * @@ -268,7 +268,7 @@ OptionValue::GetAsSInt64 () const { if (GetType () == OptionValue::eTypeSInt64) return static_cast<const OptionValueSInt64 *>(this); - return NULL; + return nullptr; } OptionValueString * @@ -276,7 +276,7 @@ OptionValue::GetAsString () { if (GetType () == OptionValue::eTypeString) return static_cast<OptionValueString *>(this); - return NULL; + return nullptr; } const OptionValueString * @@ -284,7 +284,7 @@ OptionValue::GetAsString () const { if (GetType () == OptionValue::eTypeString) return static_cast<const OptionValueString *>(this); - return NULL; + return nullptr; } OptionValueUInt64 * @@ -292,7 +292,7 @@ OptionValue::GetAsUInt64 () { if (GetType () == OptionValue::eTypeUInt64) return static_cast<OptionValueUInt64 *>(this); - return NULL; + return nullptr; } const OptionValueUInt64 * @@ -300,7 +300,7 @@ OptionValue::GetAsUInt64 () const { if (GetType () == OptionValue::eTypeUInt64) return static_cast<const OptionValueUInt64 *>(this); - return NULL; + return nullptr; } OptionValueUUID * @@ -308,7 +308,7 @@ OptionValue::GetAsUUID () { if (GetType () == OptionValue::eTypeUUID) return static_cast<OptionValueUUID *>(this); - return NULL; + return nullptr; } @@ -317,7 +317,7 @@ OptionValue::GetAsUUID () const { if (GetType () == OptionValue::eTypeUUID) return static_cast<const OptionValueUUID *>(this); - return NULL; + return nullptr; } @@ -422,7 +422,7 @@ OptionValue::GetRegexValue () const const OptionValueRegex *option_value = GetAsRegex (); if (option_value) return option_value->GetCurrentValue(); - return NULL; + return nullptr; } @@ -533,7 +533,7 @@ OptionValue::GetBuiltinTypeAsCString (Type t) case eTypeUInt64: return "unsigned"; case eTypeUUID: return "uuid"; } - return NULL; + return nullptr; } diff --git a/lldb/source/Interpreter/OptionValueArch.cpp b/lldb/source/Interpreter/OptionValueArch.cpp index 92fedffe75e..6d283d6b927 100644 --- a/lldb/source/Interpreter/OptionValueArch.cpp +++ b/lldb/source/Interpreter/OptionValueArch.cpp @@ -100,7 +100,7 @@ OptionValueArch::AutoComplete (CommandInterpreter &interpreter, s, match_start_point, max_return_elements, - NULL, + nullptr, word_complete, matches); return matches.GetSize(); diff --git a/lldb/source/Interpreter/OptionValueArray.cpp b/lldb/source/Interpreter/OptionValueArray.cpp index ee70a0ac1fc..769aadd7b30 100644 --- a/lldb/source/Interpreter/OptionValueArray.cpp +++ b/lldb/source/Interpreter/OptionValueArray.cpp @@ -90,12 +90,12 @@ OptionValueArray::GetSubValue (const ExecutionContext *exe_ctx, const char *end_bracket = strchr (name+1, ']'); if (end_bracket) { - const char *sub_value = NULL; + const char *sub_value = nullptr; if (end_bracket[1]) sub_value = end_bracket + 1; std::string index_str (name+1, end_bracket); const size_t array_count = m_values.size(); - int32_t idx = Args::StringToSInt32(index_str.c_str(), INT32_MAX, 0, NULL); + int32_t idx = Args::StringToSInt32(index_str.c_str(), INT32_MAX, 0, nullptr); if (idx != INT32_MAX) { ; diff --git a/lldb/source/Interpreter/OptionValueBoolean.cpp b/lldb/source/Interpreter/OptionValueBoolean.cpp index 6471943ee5d..de8af04b2a7 100644 --- a/lldb/source/Interpreter/OptionValueBoolean.cpp +++ b/lldb/source/Interpreter/OptionValueBoolean.cpp @@ -58,7 +58,7 @@ OptionValueBoolean::SetValueFromCString (const char *value_cstr, } else { - if (value_cstr == NULL) + if (value_cstr == nullptr) error.SetErrorString ("invalid boolean string value: NULL"); else if (value_cstr[0] == '\0') error.SetErrorString ("invalid boolean string value <empty>"); diff --git a/lldb/source/Interpreter/OptionValueDictionary.cpp b/lldb/source/Interpreter/OptionValueDictionary.cpp index 61f8aba431a..b560937141b 100644 --- a/lldb/source/Interpreter/OptionValueDictionary.cpp +++ b/lldb/source/Interpreter/OptionValueDictionary.cpp @@ -91,7 +91,7 @@ OptionValueDictionary::GetArgs (Args &args) const { StreamString strm; strm.Printf("%s=", pos->first.GetCString()); - pos->second->DumpValue(NULL, strm, eDumpOptionValue|eDumpOptionRaw); + pos->second->DumpValue(nullptr, strm, eDumpOptionValue|eDumpOptionRaw); args.AppendArgument(strm.GetString().c_str()); } return args.GetArgumentCount(); @@ -210,7 +210,7 @@ OptionValueDictionary::SetArgs (const Args &args, VarSetOperationType op) case eVarSetOperationInsertBefore: case eVarSetOperationInsertAfter: case eVarSetOperationInvalid: - error = OptionValue::SetValueFromCString (NULL, op); + error = OptionValue::SetValueFromCString (nullptr, op); break; } return error; @@ -230,14 +230,14 @@ OptionValueDictionary::GetSubValue (const ExecutionContext *exe_ctx, const char if (name && name[0]) { - const char *sub_name = NULL; + const char *sub_name = nullptr; ConstString key; const char *open_bracket = ::strchr (name, '['); if (open_bracket) { const char *key_start = open_bracket + 1; - const char *key_end = NULL; + const char *key_end = nullptr; switch (open_bracket[1]) { case '\'': @@ -314,7 +314,7 @@ OptionValueDictionary::GetSubValue (const ExecutionContext *exe_ctx, const char } } } - if (!value_sp && error.AsCString() == NULL) + if (!value_sp && error.AsCString() == nullptr) { error.SetErrorStringWithFormat ("invalid value path '%s', %s values only support '[<key>]' subvalues where <key> a string value optionally delimitted by single or double quotes", name, @@ -334,7 +334,7 @@ OptionValueDictionary::SetSubValue (const ExecutionContext *exe_ctx, VarSetOpera error = value_sp->SetValueFromCString(value, op); else { - if (error.AsCString() == NULL) + if (error.AsCString() == nullptr) error.SetErrorStringWithFormat("invalid value path '%s'", name); } return error; @@ -361,7 +361,7 @@ OptionValueDictionary::GetStringValueForKey (const ConstString &key) if (string_value) return string_value->GetCurrentValue(); } - return NULL; + return nullptr; } diff --git a/lldb/source/Interpreter/OptionValueEnumeration.cpp b/lldb/source/Interpreter/OptionValueEnumeration.cpp index f282235d58e..7aceac91b60 100644 --- a/lldb/source/Interpreter/OptionValueEnumeration.cpp +++ b/lldb/source/Interpreter/OptionValueEnumeration.cpp @@ -113,7 +113,7 @@ OptionValueEnumeration::SetEnumerations (const OptionEnumValueElement *enumerato m_enumerations.Clear(); if (enumerators) { - for (size_t i=0; enumerators[i].string_value != NULL; ++i) + for (size_t i=0; enumerators[i].string_value != nullptr; ++i) { ConstString const_enumerator_name(enumerators[i].string_value); EnumeratorInfo enumerator_info = { enumerators[i].value, enumerators[i].usage }; diff --git a/lldb/source/Interpreter/OptionValueFileSpec.cpp b/lldb/source/Interpreter/OptionValueFileSpec.cpp index 607ece82491..c8aaadef23b 100644 --- a/lldb/source/Interpreter/OptionValueFileSpec.cpp +++ b/lldb/source/Interpreter/OptionValueFileSpec.cpp @@ -140,7 +140,7 @@ OptionValueFileSpec::AutoComplete (CommandInterpreter &interpreter, s, match_start_point, max_return_elements, - NULL, + nullptr, word_complete, matches); return matches.GetSize(); diff --git a/lldb/source/Interpreter/OptionValueFormat.cpp b/lldb/source/Interpreter/OptionValueFormat.cpp index 34d36725fbb..296dd983208 100644 --- a/lldb/source/Interpreter/OptionValueFormat.cpp +++ b/lldb/source/Interpreter/OptionValueFormat.cpp @@ -49,7 +49,7 @@ OptionValueFormat::SetValueFromCString (const char *value_cstr, VarSetOperationT case eVarSetOperationAssign: { Format new_format; - error = Args::StringToFormat (value_cstr, new_format, NULL); + error = Args::StringToFormat (value_cstr, new_format, nullptr); if (error.Success()) { m_value_was_set = true; diff --git a/lldb/source/Interpreter/OptionValueProperties.cpp b/lldb/source/Interpreter/OptionValueProperties.cpp index abee55d93ef..2facbeef2e9 100644 --- a/lldb/source/Interpreter/OptionValueProperties.cpp +++ b/lldb/source/Interpreter/OptionValueProperties.cpp @@ -135,7 +135,7 @@ OptionValueProperties::GetSubValue (const ExecutionContext *exe_ctx, if (name && name[0]) { - const char *sub_name = NULL; + const char *sub_name = nullptr; ConstString key; size_t key_len = ::strcspn (name, ".[{"); @@ -218,7 +218,7 @@ OptionValueProperties::SetSubValue (const ExecutionContext *exe_ctx, error = value_sp->SetValueFromCString(value, op); else { - if (error.AsCString() == NULL) + if (error.AsCString() == nullptr) error.SetErrorStringWithFormat("invalid value path '%s'", name); } return error; @@ -228,7 +228,7 @@ OptionValueProperties::SetSubValue (const ExecutionContext *exe_ctx, ConstString OptionValueProperties::GetPropertyNameAtIndex (uint32_t idx) const { - const Property *property = GetPropertyAtIndex(NULL, false, idx); + const Property *property = GetPropertyAtIndex(nullptr, false, idx); if (property) return property->GetName(); return ConstString(); @@ -238,10 +238,10 @@ OptionValueProperties::GetPropertyNameAtIndex (uint32_t idx) const const char * OptionValueProperties::GetPropertyDescriptionAtIndex (uint32_t idx) const { - const Property *property = GetPropertyAtIndex(NULL, false, idx); + const Property *property = GetPropertyAtIndex(nullptr, false, idx); if (property) return property->GetDescription(); - return NULL; + return nullptr; } uint32_t @@ -279,7 +279,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValuePathMappings (const Execut OptionValueSP value_sp(GetPropertyValueAtIndex (exe_ctx, will_modify, idx)); if (value_sp) return value_sp->GetAsPathMappings(); - return NULL; + return nullptr; } OptionValueFileSpecList * @@ -288,7 +288,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpecList (const Execut OptionValueSP value_sp(GetPropertyValueAtIndex (exe_ctx, will_modify, idx)); if (value_sp) return value_sp->GetAsFileSpecList(); - return NULL; + return nullptr; } OptionValueArch * @@ -297,7 +297,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueArch (const ExecutionConte const Property *property = GetPropertyAtIndex (exe_ctx, false, idx); if (property) return property->GetValue()->GetAsArch(); - return NULL; + return nullptr; } bool @@ -381,7 +381,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueDictionary (const Executio const Property *property = GetPropertyAtIndex (exe_ctx, false, idx); if (property) return property->GetValue()->GetAsDictionary(); - return NULL; + return nullptr; } int64_t @@ -421,7 +421,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueFileSpec (const ExecutionC if (value) return value->GetAsFileSpec(); } - return NULL; + return nullptr; } @@ -462,7 +462,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueRegex (const ExecutionCont if (value) return value->GetRegexValue(); } - return NULL; + return nullptr; } OptionValueSInt64 * @@ -475,7 +475,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueSInt64 (const ExecutionCon if (value) return value->GetAsSInt64(); } - return NULL; + return nullptr; } int64_t @@ -536,7 +536,7 @@ OptionValueProperties::GetPropertyAtIndexAsOptionValueString (const ExecutionCon OptionValueSP value_sp(GetPropertyValueAtIndex (exe_ctx, will_modify, idx)); if (value_sp) return value_sp->GetAsString(); - return NULL; + return nullptr; } @@ -659,10 +659,10 @@ OptionValueProperties::GetPropertyAtPath (const ExecutionContext *exe_ctx, bool will_modify, const char *name) const { - const Property *property = NULL; + const Property *property = nullptr; if (name && name[0]) { - const char *sub_name = NULL; + const char *sub_name = nullptr; ConstString key; size_t key_len = ::strcspn (name, ".[{"); @@ -683,7 +683,7 @@ OptionValueProperties::GetPropertyAtPath (const ExecutionContext *exe_ctx, if (sub_properties) return sub_properties->GetPropertyAtPath(exe_ctx, will_modify, sub_name + 1); } - property = NULL; + property = nullptr; } } return property; diff --git a/lldb/source/Interpreter/OptionValueUUID.cpp b/lldb/source/Interpreter/OptionValueUUID.cpp index 340f1e5e998..0141911d97a 100644 --- a/lldb/source/Interpreter/OptionValueUUID.cpp +++ b/lldb/source/Interpreter/OptionValueUUID.cpp @@ -92,7 +92,7 @@ OptionValueUUID::AutoComplete (CommandInterpreter &interpreter, if (num_modules > 0) { UUID::ValueType uuid_bytes; - const size_t num_bytes_decoded = UUID::DecodeUUIDBytesFromCString(s, uuid_bytes, NULL); + const size_t num_bytes_decoded = UUID::DecodeUUIDBytesFromCString(s, uuid_bytes, nullptr); for (size_t i=0; i<num_modules; ++i) { ModuleSP module_sp (target->GetImages().GetModuleAtIndex(i)); diff --git a/lldb/source/Interpreter/Options.cpp b/lldb/source/Interpreter/Options.cpp index ce987576a97..3d65116a45e 100644 --- a/lldb/source/Interpreter/Options.cpp +++ b/lldb/source/Interpreter/Options.cpp @@ -242,14 +242,14 @@ uint32_t Options::NumCommandOptions () { const OptionDefinition *opt_defs = GetDefinitions (); - if (opt_defs == NULL) + if (opt_defs == nullptr) return 0; int i = 0; - if (opt_defs != NULL) + if (opt_defs != nullptr) { - while (opt_defs[i].long_option != NULL) + while (opt_defs[i].long_option != nullptr) ++i; } @@ -265,7 +265,7 @@ Options::GetLongOptions () // Check to see if there are any options. const uint32_t num_options = NumCommandOptions(); if (num_options == 0) - return NULL; + return nullptr; uint32_t i; const OptionDefinition *opt_defs = GetDefinitions(); @@ -279,7 +279,7 @@ Options::GetLongOptions () m_getopt_table[i].name = opt_defs[i].long_option; m_getopt_table[i].has_arg = opt_defs[i].option_has_arg; - m_getopt_table[i].flag = NULL; + m_getopt_table[i].flag = nullptr; m_getopt_table[i].val = short_opt; if (option_seen.find(short_opt) == option_seen.end()) @@ -312,14 +312,14 @@ Options::GetLongOptions () //getopt_long_only requires a NULL final entry in the table: - m_getopt_table[i].name = NULL; + m_getopt_table[i].name = nullptr; m_getopt_table[i].has_arg = 0; - m_getopt_table[i].flag = NULL; + m_getopt_table[i].flag = nullptr; m_getopt_table[i].val = 0; } if (m_getopt_table.empty()) - return NULL; + return nullptr; return &m_getopt_table.front(); } @@ -592,7 +592,7 @@ Options::GenerateOptionUsage if (opt_defs[i].usage_mask & opt_set_mask && isprint8(opt_defs[i].short_option)) { if (opt_defs[i].required && opt_defs[i].option_has_arg != OptionParser::eNoArgument) - PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm); + PrintOption (opt_defs[i], eDisplayBestOption, " ", nullptr, true, strm); } } @@ -605,7 +605,7 @@ Options::GenerateOptionUsage // Add current option to the end of out_stream. if (!opt_defs[i].required && opt_defs[i].option_has_arg != OptionParser::eNoArgument) - PrintOption (opt_defs[i], eDisplayBestOption, " ", NULL, true, strm); + PrintOption (opt_defs[i], eDisplayBestOption, " ", nullptr, true, strm); } } @@ -669,13 +669,13 @@ Options::GenerateOptionUsage strm.Indent (); if (opt_defs[i].short_option && isprint8(opt_defs[i].short_option)) { - PrintOption (opt_defs[i], eDisplayShortOption, NULL, NULL, false, strm); + PrintOption (opt_defs[i], eDisplayShortOption, nullptr, nullptr, false, strm); PrintOption (opt_defs[i], eDisplayLongOption, " ( ", " )", false, strm); } else { // Short option is not printable, just print long option - PrintOption (opt_defs[i], eDisplayLongOption, NULL, NULL, false, strm); + PrintOption (opt_defs[i], eDisplayLongOption, nullptr, nullptr, false, strm); } strm.EOL(); @@ -685,11 +685,11 @@ Options::GenerateOptionUsage OutputFormattedUsageText (strm, opt_defs[i].usage_text, screen_width); - if (opt_defs[i].enum_values != NULL) + if (opt_defs[i].enum_values != nullptr) { strm.Indent (); strm.Printf("Values: "); - for (int k = 0; opt_defs[i].enum_values[k].string_value != NULL; k++) + for (int k = 0; opt_defs[i].enum_values[k].string_value != nullptr; k++) { if (k == 0) strm.Printf("%s", opt_defs[i].enum_values[k].string_value); @@ -908,11 +908,11 @@ Options::HandleOptionArgumentCompletion // See if this is an enumeration type option, and if so complete it here: OptionEnumValueElement *enum_values = opt_defs[opt_defs_index].enum_values; - if (enum_values != NULL) + if (enum_values != nullptr) { bool return_value = false; std::string match_string(input.GetArgumentAtIndex (opt_arg_pos), input.GetArgumentAtIndex (opt_arg_pos) + char_pos); - for (int i = 0; enum_values[i].string_value != NULL; i++) + for (int i = 0; enum_values[i].string_value != nullptr; i++) { if (strstr(enum_values[i].string_value, match_string.c_str()) == enum_values[i].string_value) { @@ -1001,7 +1001,7 @@ OptionGroupOptions::GetGroupWithOption (char short_opt) if (opt_def.short_option == short_opt) return m_option_infos[i].option_group; } - return NULL; + return nullptr; } void @@ -1026,7 +1026,7 @@ void OptionGroupOptions::Finalize () { m_did_finalize = true; - OptionDefinition empty_option_def = { 0, false, NULL, 0, 0, NULL, 0, eArgTypeNone, NULL }; + OptionDefinition empty_option_def = { 0, false, nullptr, 0, 0, nullptr, 0, eArgTypeNone, nullptr }; m_option_defs.push_back (empty_option_def); } diff --git a/lldb/source/Interpreter/Property.cpp b/lldb/source/Interpreter/Property.cpp index e5cf63ada88..49376266b07 100644 --- a/lldb/source/Interpreter/Property.cpp +++ b/lldb/source/Interpreter/Property.cpp @@ -56,7 +56,7 @@ Property::Property (const PropertyDefinition &definition) : // "definition.default_cstr_value" as a string value that represents the default // value. if (definition.default_cstr_value) - m_value_sp.reset (new OptionValueBoolean(Args::StringToBoolean (definition.default_cstr_value, false, NULL))); + m_value_sp.reset (new OptionValueBoolean(Args::StringToBoolean (definition.default_cstr_value, false, nullptr))); else m_value_sp.reset (new OptionValueBoolean(definition.default_uint_value != 0)); break; @@ -108,7 +108,7 @@ Property::Property (const PropertyDefinition &definition) : { Format new_format = eFormatInvalid; if (definition.default_cstr_value) - Args::StringToFormat (definition.default_cstr_value, new_format, NULL); + Args::StringToFormat (definition.default_cstr_value, new_format, nullptr); else new_format = (Format)definition.default_uint_value; m_value_sp.reset (new OptionValueFormat(new_format)); diff --git a/lldb/source/Interpreter/PythonDataObjects.cpp b/lldb/source/Interpreter/PythonDataObjects.cpp index 053ff34b9d7..3ea6c0dbe3e 100644 --- a/lldb/source/Interpreter/PythonDataObjects.cpp +++ b/lldb/source/Interpreter/PythonDataObjects.cpp @@ -31,7 +31,7 @@ using namespace lldb; // PythonObject //---------------------------------------------------------------------- PythonObject::PythonObject (const lldb::ScriptInterpreterObjectSP &script_object_sp) : - m_py_obj (NULL) + m_py_obj (nullptr) { if (script_object_sp) Reset ((PyObject *)script_object_sp->GetObject()); @@ -133,8 +133,8 @@ PythonString::Reset (PyObject *py_obj) if (py_obj && PyString_Check(py_obj)) return PythonObject::Reset(py_obj); - PythonObject::Reset(NULL); - return py_obj == NULL; + PythonObject::Reset(nullptr); + return py_obj == nullptr; } const char* @@ -142,7 +142,7 @@ PythonString::GetString() const { if (m_py_obj) return PyString_AsString(m_py_obj); - return NULL; + return nullptr; } size_t @@ -202,8 +202,8 @@ PythonInteger::Reset (PyObject *py_obj) return PythonObject::Reset(py_obj); } - PythonObject::Reset(NULL); - return py_obj == NULL; + PythonObject::Reset(nullptr); + return py_obj == nullptr; } int64_t @@ -230,7 +230,7 @@ PythonInteger::SetInteger (int64_t value) //---------------------------------------------------------------------- PythonList::PythonList (bool create_empty) : - PythonObject(create_empty ? PyList_New(0) : NULL) + PythonObject(create_empty ? PyList_New(0) : nullptr) { } @@ -269,8 +269,8 @@ PythonList::Reset (PyObject *py_obj) if (py_obj && PyList_Check(py_obj)) return PythonObject::Reset(py_obj); - PythonObject::Reset(NULL); - return py_obj == NULL; + PythonObject::Reset(nullptr); + return py_obj == nullptr; } uint32_t @@ -308,7 +308,7 @@ PythonList::AppendItem (const PythonObject &object) //---------------------------------------------------------------------- PythonDictionary::PythonDictionary (bool create_empty) : -PythonObject(create_empty ? PyDict_New() : NULL) +PythonObject(create_empty ? PyDict_New() : nullptr) { } @@ -342,8 +342,8 @@ PythonDictionary::Reset (PyObject *py_obj) if (py_obj && PyDict_Check(py_obj)) return PythonObject::Reset(py_obj); - PythonObject::Reset(NULL); - return py_obj == NULL; + PythonObject::Reset(nullptr); + return py_obj == nullptr; } uint32_t diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp index 4bb247307c9..d85ec6429ee 100644 --- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp +++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp @@ -41,26 +41,26 @@ using namespace lldb; using namespace lldb_private; -static ScriptInterpreter::SWIGInitCallback g_swig_init_callback = NULL; -static ScriptInterpreter::SWIGBreakpointCallbackFunction g_swig_breakpoint_callback = NULL; -static ScriptInterpreter::SWIGWatchpointCallbackFunction g_swig_watchpoint_callback = NULL; -static ScriptInterpreter::SWIGPythonTypeScriptCallbackFunction g_swig_typescript_callback = NULL; -static ScriptInterpreter::SWIGPythonCreateSyntheticProvider g_swig_synthetic_script = NULL; -static ScriptInterpreter::SWIGPythonCalculateNumChildren g_swig_calc_children = NULL; -static ScriptInterpreter::SWIGPythonGetChildAtIndex g_swig_get_child_index = NULL; -static ScriptInterpreter::SWIGPythonGetIndexOfChildWithName g_swig_get_index_child = NULL; -static ScriptInterpreter::SWIGPythonCastPyObjectToSBValue g_swig_cast_to_sbvalue = NULL; -static ScriptInterpreter::SWIGPythonGetValueObjectSPFromSBValue g_swig_get_valobj_sp_from_sbvalue = NULL; -static ScriptInterpreter::SWIGPythonUpdateSynthProviderInstance g_swig_update_provider = NULL; -static ScriptInterpreter::SWIGPythonMightHaveChildrenSynthProviderInstance g_swig_mighthavechildren_provider = NULL; -static ScriptInterpreter::SWIGPythonCallCommand g_swig_call_command = NULL; -static ScriptInterpreter::SWIGPythonCallModuleInit g_swig_call_module_init = NULL; -static ScriptInterpreter::SWIGPythonCreateOSPlugin g_swig_create_os_plugin = NULL; -static ScriptInterpreter::SWIGPythonScriptKeyword_Process g_swig_run_script_keyword_process = NULL; -static ScriptInterpreter::SWIGPythonScriptKeyword_Thread g_swig_run_script_keyword_thread = NULL; -static ScriptInterpreter::SWIGPythonScriptKeyword_Target g_swig_run_script_keyword_target = NULL; -static ScriptInterpreter::SWIGPythonScriptKeyword_Frame g_swig_run_script_keyword_frame = NULL; -static ScriptInterpreter::SWIGPython_GetDynamicSetting g_swig_plugin_get = NULL; +static ScriptInterpreter::SWIGInitCallback g_swig_init_callback = nullptr; +static ScriptInterpreter::SWIGBreakpointCallbackFunction g_swig_breakpoint_callback = nullptr; +static ScriptInterpreter::SWIGWatchpointCallbackFunction g_swig_watchpoint_callback = nullptr; +static ScriptInterpreter::SWIGPythonTypeScriptCallbackFunction g_swig_typescript_callback = nullptr; +static ScriptInterpreter::SWIGPythonCreateSyntheticProvider g_swig_synthetic_script = nullptr; +static ScriptInterpreter::SWIGPythonCalculateNumChildren g_swig_calc_children = nullptr; +static ScriptInterpreter::SWIGPythonGetChildAtIndex g_swig_get_child_index = nullptr; +static ScriptInterpreter::SWIGPythonGetIndexOfChildWithName g_swig_get_index_child = nullptr; +static ScriptInterpreter::SWIGPythonCastPyObjectToSBValue g_swig_cast_to_sbvalue = nullptr; +static ScriptInterpreter::SWIGPythonGetValueObjectSPFromSBValue g_swig_get_valobj_sp_from_sbvalue = nullptr; +static ScriptInterpreter::SWIGPythonUpdateSynthProviderInstance g_swig_update_provider = nullptr; +static ScriptInterpreter::SWIGPythonMightHaveChildrenSynthProviderInstance g_swig_mighthavechildren_provider = nullptr; +static ScriptInterpreter::SWIGPythonCallCommand g_swig_call_command = nullptr; +static ScriptInterpreter::SWIGPythonCallModuleInit g_swig_call_module_init = nullptr; +static ScriptInterpreter::SWIGPythonCreateOSPlugin g_swig_create_os_plugin = nullptr; +static ScriptInterpreter::SWIGPythonScriptKeyword_Process g_swig_run_script_keyword_process = nullptr; +static ScriptInterpreter::SWIGPythonScriptKeyword_Thread g_swig_run_script_keyword_thread = nullptr; +static ScriptInterpreter::SWIGPythonScriptKeyword_Target g_swig_run_script_keyword_target = nullptr; +static ScriptInterpreter::SWIGPythonScriptKeyword_Frame g_swig_run_script_keyword_frame = nullptr; +static ScriptInterpreter::SWIGPython_GetDynamicSetting g_swig_plugin_get = nullptr; static std::string ReadPythonBacktrace (PyObject* py_backtrace); @@ -149,7 +149,7 @@ ScriptInterpreterPython::ScriptInterpreterPython (CommandInterpreter &interprete m_session_is_active (false), m_pty_slave_is_open (false), m_valid_session (true), - m_command_thread_state (NULL) + m_command_thread_state (nullptr) { ScriptInterpreterPython::InitializePrivate (); @@ -206,7 +206,7 @@ ScriptInterpreterPython::~ScriptInterpreterPython () void ScriptInterpreterPython::IOHandlerActivated (IOHandler &io_handler) { - const char *instructions = NULL; + const char *instructions = nullptr; switch (m_active_io_handler) { @@ -420,42 +420,42 @@ ScriptInterpreterPython::EnterSession (uint16_t on_entry_flags, lldb::StreamFileSP in_sp; lldb::StreamFileSP out_sp; lldb::StreamFileSP err_sp; - if (in == NULL || out == NULL || err == NULL) + if (in == nullptr || out == nullptr || err == nullptr) m_interpreter.GetDebugger().AdoptTopIOHandlerFilesIfInvalid (in_sp, out_sp, err_sp); - if (in == NULL && in_sp && (on_entry_flags & Locker::NoSTDIN) == 0) + if (in == nullptr && in_sp && (on_entry_flags & Locker::NoSTDIN) == 0) in = in_sp->GetFile().GetStream(); if (in) { m_saved_stdin.Reset(sys_module_dict.GetItemForKey("stdin")); - PyObject *new_file = PyFile_FromFile (in, (char *) "", (char *) "r", 0); + PyObject *new_file = PyFile_FromFile (in, (char *) "", (char *) "r", nullptr); sys_module_dict.SetItemForKey ("stdin", new_file); Py_DECREF (new_file); } else m_saved_stdin.Reset(); - if (out == NULL && out_sp) + if (out == nullptr && out_sp) out = out_sp->GetFile().GetStream(); if (out) { m_saved_stdout.Reset(sys_module_dict.GetItemForKey("stdout")); - PyObject *new_file = PyFile_FromFile (out, (char *) "", (char *) "w", 0); + PyObject *new_file = PyFile_FromFile (out, (char *) "", (char *) "w", nullptr); sys_module_dict.SetItemForKey ("stdout", new_file); Py_DECREF (new_file); } else m_saved_stdout.Reset(); - if (err == NULL && err_sp) + if (err == nullptr && err_sp) err = err_sp->GetFile().GetStream(); if (err) { m_saved_stderr.Reset(sys_module_dict.GetItemForKey("stderr")); - PyObject *new_file = PyFile_FromFile (err, (char *) "", (char *) "w", 0); + PyObject *new_file = PyFile_FromFile (err, (char *) "", (char *) "w", nullptr); sys_module_dict.SetItemForKey ("stderr", new_file); Py_DECREF (new_file); } @@ -510,7 +510,7 @@ ScriptInterpreterPython::GetSysModuleDictionary () static std::string GenerateUniqueName (const char* base_name_wanted, uint32_t& functions_counter, - void* name_token = NULL) + void* name_token = nullptr) { StreamString sstr; @@ -531,7 +531,7 @@ ScriptInterpreterPython::GetEmbeddedInterpreterModuleObjects () if (!m_run_one_line_function) { PyObject *module = PyImport_AddModule ("lldb.embedded_interpreter"); - if (module != NULL) + if (module != nullptr) { PythonDictionary module_dict (PyModule_GetDict (module)); if (module_dict) @@ -595,7 +595,7 @@ ScriptInterpreterPython::ExecuteOneLine (const char *command, CommandReturnObjec output_file_sp.reset(new StreamFile(outfile_handle, true)); error_file_sp = output_file_sp; if (outfile_handle) - ::setbuf (outfile_handle, NULL); + ::setbuf (outfile_handle, nullptr); result->SetImmediateOutputFile(debugger.GetOutputFile()->GetFile().GetStream()); result->SetImmediateErrorFile(debugger.GetErrorFile()->GetFile().GetStream()); @@ -830,10 +830,10 @@ ScriptInterpreterPython::ExecuteOneLineWithReturn (const char *in_string, ScriptInterpreterPython::Locker::AcquireLock | ScriptInterpreterPython::Locker::InitSession | (options.GetSetLLDBGlobals() ? ScriptInterpreterPython::Locker::InitGlobals : 0), ScriptInterpreterPython::Locker::FreeAcquiredLock | ScriptInterpreterPython::Locker::TearDownSession); - PyObject *py_return = NULL; + PyObject *py_return = nullptr; PythonObject &main_module = GetMainModule (); PythonDictionary globals (PyModule_GetDict(main_module.get())); - PyObject *py_error = NULL; + PyObject *py_error = nullptr; bool ret_success = false; int success; @@ -848,25 +848,25 @@ ScriptInterpreterPython::ExecuteOneLineWithReturn (const char *in_string, locals = globals; py_error = PyErr_Occurred(); - if (py_error != NULL) + if (py_error != nullptr) PyErr_Clear(); - if (in_string != NULL) + if (in_string != nullptr) { { // scope for PythonInputReaderManager //PythonInputReaderManager py_input(options.GetEnableIO() ? this : NULL); py_return = PyRun_String (in_string, Py_eval_input, globals.get(), locals.get()); - if (py_return == NULL) + if (py_return == nullptr) { py_error = PyErr_Occurred (); - if (py_error != NULL) + if (py_error != nullptr) PyErr_Clear (); py_return = PyRun_String (in_string, Py_single_input, globals.get(), locals.get()); } } - if (py_return != NULL) + if (py_return != nullptr) { switch (return_type) { @@ -971,7 +971,7 @@ ScriptInterpreterPython::ExecuteOneLineWithReturn (const char *in_string, } py_error = PyErr_Occurred(); - if (py_error != NULL) + if (py_error != nullptr) { ret_success = false; if (options.GetMaskoutErrors()) @@ -998,7 +998,7 @@ ScriptInterpreterPython::ExecuteMultipleLines (const char *in_string, const Exec PythonObject return_value; PythonObject &main_module = GetMainModule (); PythonDictionary globals (PyModule_GetDict(main_module.get())); - PyObject *py_error = NULL; + PyObject *py_error = nullptr; PythonDictionary locals = GetSessionDictionary (); @@ -1013,10 +1013,10 @@ ScriptInterpreterPython::ExecuteMultipleLines (const char *in_string, const Exec } py_error = PyErr_Occurred(); - if (py_error != NULL) + if (py_error != nullptr) PyErr_Clear(); - if (in_string != NULL) + if (in_string != nullptr) { struct _node *compiled_node = PyParser_SimpleParseString (in_string, Py_file_input); if (compiled_node) @@ -1035,16 +1035,16 @@ ScriptInterpreterPython::ExecuteMultipleLines (const char *in_string, const Exec } py_error = PyErr_Occurred (); - if (py_error != NULL) + if (py_error != nullptr) { // puts(in_string); // _PyObject_Dump (py_error); // PyErr_Print(); // success = false; - PyObject *type = NULL; - PyObject *value = NULL; - PyObject *traceback = NULL; + PyObject *type = nullptr; + PyObject *value = nullptr; + PyObject *traceback = nullptr; PyErr_Fetch (&type,&value,&traceback); // get the backtrace @@ -1296,7 +1296,7 @@ ScriptInterpreterPython::GenerateTypeSynthClass (StringList &user_input, std::st lldb::ScriptInterpreterObjectSP ScriptInterpreterPython::OSPlugin_CreatePluginObject (const char *class_name, lldb::ProcessSP process_sp) { - if (class_name == NULL || class_name[0] == '\0') + if (class_name == nullptr || class_name[0] == '\0') return lldb::ScriptInterpreterObjectSP(); if (!process_sp) @@ -1330,7 +1330,7 @@ ScriptInterpreterPython::OSPlugin_RegisterInfo (lldb::ScriptInterpreterObjectSP PyObject* implementor = (PyObject*)os_plugin_object_sp->GetObject(); - if (implementor == NULL || implementor == Py_None) + if (implementor == nullptr || implementor == Py_None) return lldb::ScriptInterpreterObjectSP(); PyObject* pmeth = PyObject_GetAttrString(implementor, callee_name); @@ -1340,7 +1340,7 @@ ScriptInterpreterPython::OSPlugin_RegisterInfo (lldb::ScriptInterpreterObjectSP PyErr_Clear(); } - if (pmeth == NULL || pmeth == Py_None) + if (pmeth == nullptr || pmeth == Py_None) { Py_XDECREF(pmeth); return lldb::ScriptInterpreterObjectSP(); @@ -1365,7 +1365,7 @@ ScriptInterpreterPython::OSPlugin_RegisterInfo (lldb::ScriptInterpreterObjectSP Py_XDECREF(pmeth); // right now we know this function exists and is callable.. - PyObject* py_return = PyObject_CallMethod(implementor, callee_name, NULL); + PyObject* py_return = PyObject_CallMethod(implementor, callee_name, nullptr); // if it fails, print the error but otherwise go on if (PyErr_Occurred()) @@ -1391,7 +1391,7 @@ ScriptInterpreterPython::OSPlugin_ThreadsInfo (lldb::ScriptInterpreterObjectSP o PyObject* implementor = (PyObject*)os_plugin_object_sp->GetObject(); - if (implementor == NULL || implementor == Py_None) + if (implementor == nullptr || implementor == Py_None) return lldb::ScriptInterpreterObjectSP(); PyObject* pmeth = PyObject_GetAttrString(implementor, callee_name); @@ -1401,7 +1401,7 @@ ScriptInterpreterPython::OSPlugin_ThreadsInfo (lldb::ScriptInterpreterObjectSP o PyErr_Clear(); } - if (pmeth == NULL || pmeth == Py_None) + if (pmeth == nullptr || pmeth == Py_None) { Py_XDECREF(pmeth); return lldb::ScriptInterpreterObjectSP(); @@ -1426,7 +1426,7 @@ ScriptInterpreterPython::OSPlugin_ThreadsInfo (lldb::ScriptInterpreterObjectSP o Py_XDECREF(pmeth); // right now we know this function exists and is callable.. - PyObject* py_return = PyObject_CallMethod(implementor, callee_name, NULL); + PyObject* py_return = PyObject_CallMethod(implementor, callee_name, nullptr); // if it fails, print the error but otherwise go on if (PyErr_Occurred()) @@ -1448,7 +1448,7 @@ template <typename T> const char *GetPythonValueFormatString(T t) { assert(!"Unhandled type passed to GetPythonValueFormatString(T), make a specialization of GetPythonValueFormatString() to support this type."); - return NULL; + return nullptr; } template <> const char *GetPythonValueFormatString (char *) { return "s"; } template <> const char *GetPythonValueFormatString (char) { return "b"; } @@ -1480,7 +1480,7 @@ ScriptInterpreterPython::OSPlugin_RegisterContextData (lldb::ScriptInterpreterOb PyObject* implementor = (PyObject*)os_plugin_object_sp->GetObject(); - if (implementor == NULL || implementor == Py_None) + if (implementor == nullptr || implementor == Py_None) return lldb::ScriptInterpreterObjectSP(); PyObject* pmeth = PyObject_GetAttrString(implementor, callee_name); @@ -1490,7 +1490,7 @@ ScriptInterpreterPython::OSPlugin_RegisterContextData (lldb::ScriptInterpreterOb PyErr_Clear(); } - if (pmeth == NULL || pmeth == Py_None) + if (pmeth == nullptr || pmeth == Py_None) { Py_XDECREF(pmeth); return lldb::ScriptInterpreterObjectSP(); @@ -1546,7 +1546,7 @@ ScriptInterpreterPython::OSPlugin_CreateThread (lldb::ScriptInterpreterObjectSP PyObject* implementor = (PyObject*)os_plugin_object_sp->GetObject(); - if (implementor == NULL || implementor == Py_None) + if (implementor == nullptr || implementor == Py_None) return lldb::ScriptInterpreterObjectSP(); PyObject* pmeth = PyObject_GetAttrString(implementor, callee_name); @@ -1556,7 +1556,7 @@ ScriptInterpreterPython::OSPlugin_CreateThread (lldb::ScriptInterpreterObjectSP PyErr_Clear(); } - if (pmeth == NULL || pmeth == Py_None) + if (pmeth == nullptr || pmeth == Py_None) { Py_XDECREF(pmeth); return lldb::ScriptInterpreterObjectSP(); @@ -1638,7 +1638,7 @@ lldb::ScriptInterpreterObjectSP ScriptInterpreterPython::CreateSyntheticScriptedProvider (const char *class_name, lldb::ValueObjectSP valobj) { - if (class_name == NULL || class_name[0] == '\0') + if (class_name == nullptr || class_name[0] == '\0') return lldb::ScriptInterpreterObjectSP(); if (!valobj.get()) @@ -1747,7 +1747,7 @@ ScriptInterpreterPython::GetScriptedSummary (const char *python_function_name, return false; } - void* old_callee = (callee_wrapper_sp ? callee_wrapper_sp->GetObject() : NULL); + void* old_callee = (callee_wrapper_sp ? callee_wrapper_sp->GetObject() : nullptr); void* new_callee = old_callee; bool ret_val; @@ -1929,10 +1929,10 @@ ScriptInterpreterPython::GetChildAtIndex (const lldb::ScriptInterpreterObjectSP& { Locker py_lock(this, Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN); void* child_ptr = g_swig_get_child_index (implementor,idx); - if (child_ptr != NULL && child_ptr != Py_None) + if (child_ptr != nullptr && child_ptr != Py_None) { lldb::SBValue* sb_value_ptr = (lldb::SBValue*)g_swig_cast_to_sbvalue(child_ptr); - if (sb_value_ptr == NULL) + if (sb_value_ptr == nullptr) Py_XDECREF(child_ptr); else ret_val = g_swig_get_valobj_sp_from_sbvalue (sb_value_ptr); @@ -2021,15 +2021,15 @@ ScriptInterpreterPython::MightHaveChildrenSynthProviderInstance (const lldb::Scr static std::string ReadPythonBacktrace (PyObject* py_backtrace) { - PyObject* traceback_module = NULL, - *stringIO_module = NULL, - *stringIO_builder = NULL, - *stringIO_buffer = NULL, - *printTB = NULL, - *printTB_args = NULL, - *printTB_result = NULL, - *stringIO_getvalue = NULL, - *printTB_string = NULL; + PyObject* traceback_module = nullptr, + *stringIO_module = nullptr, + *stringIO_builder = nullptr, + *stringIO_buffer = nullptr, + *printTB = nullptr, + *printTB_args = nullptr, + *printTB_result = nullptr, + *stringIO_getvalue = nullptr, + *printTB_string = nullptr; std::string retval("backtrace unavailable"); @@ -2043,7 +2043,7 @@ ReadPythonBacktrace (PyObject* py_backtrace) stringIO_builder = PyObject_GetAttrString(stringIO_module, "StringIO"); if (stringIO_builder && stringIO_builder != Py_None) { - stringIO_buffer = PyObject_CallObject(stringIO_builder, NULL); + stringIO_buffer = PyObject_CallObject(stringIO_builder, nullptr); if (stringIO_buffer && stringIO_buffer != Py_None) { printTB = PyObject_GetAttrString(traceback_module, "print_tb"); @@ -2054,7 +2054,7 @@ ReadPythonBacktrace (PyObject* py_backtrace) stringIO_getvalue = PyObject_GetAttrString(stringIO_buffer, "getvalue"); if (stringIO_getvalue && stringIO_getvalue != Py_None) { - printTB_string = PyObject_CallObject (stringIO_getvalue,NULL); + printTB_string = PyObject_CallObject (stringIO_getvalue,nullptr); if (printTB_string && printTB_string != Py_None && PyString_Check(printTB_string)) retval.assign(PyString_AsString(printTB_string)); } @@ -2458,7 +2458,7 @@ ScriptInterpreterPython::GetDocumentationForItem(const char* item, std::string& std::string command(item); command += ".__doc__"; - char* result_ptr = NULL; // Python is going to point this to valid data if ExecuteOneLineWithReturn returns successfully + char* result_ptr = nullptr; // Python is going to point this to valid data if ExecuteOneLineWithReturn returns successfully if (ExecuteOneLineWithReturn (command.c_str(), ScriptInterpreter::eScriptReturnTypeCharStrOrNone, |