Author: Adrian Prantl Date: 2019-10-30T16:03:00-07:00 New Revision: a925974bf166a83cfd45b0ca89c5c65d17f275cc
URL: https://github.com/llvm/llvm-project/commit/a925974bf166a83cfd45b0ca89c5c65d17f275cc DIFF: https://github.com/llvm/llvm-project/commit/a925974bf166a83cfd45b0ca89c5c65d17f275cc.diff LOG: Run clang-format on lldb/source/Commands (NFC) These files had a lot of whitespace errors in them which was a constant source of merge conflicts downstream. Added: Modified: lldb/source/Commands/CommandObjectBreakpoint.cpp lldb/source/Commands/CommandObjectBreakpoint.h lldb/source/Commands/CommandObjectBreakpointCommand.cpp lldb/source/Commands/CommandObjectBreakpointCommand.h lldb/source/Commands/CommandObjectCommands.cpp lldb/source/Commands/CommandObjectDisassemble.cpp lldb/source/Commands/CommandObjectExpression.cpp lldb/source/Commands/CommandObjectFrame.cpp lldb/source/Commands/CommandObjectHelp.cpp lldb/source/Commands/CommandObjectLanguage.h lldb/source/Commands/CommandObjectMemory.cpp lldb/source/Commands/CommandObjectPlatform.cpp lldb/source/Commands/CommandObjectPlugin.h lldb/source/Commands/CommandObjectProcess.cpp lldb/source/Commands/CommandObjectSettings.cpp lldb/source/Commands/CommandObjectSource.cpp lldb/source/Commands/CommandObjectStats.cpp lldb/source/Commands/CommandObjectTarget.cpp lldb/source/Commands/CommandObjectThread.cpp lldb/source/Commands/CommandObjectType.cpp lldb/source/Commands/CommandObjectType.h lldb/source/Commands/CommandObjectWatchpoint.h lldb/source/Commands/CommandObjectWatchpointCommand.h Removed: ################################################################################ diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index 042fc06a2bf0..799066e07a29 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -48,13 +48,10 @@ static void AddBreakpointDescription(Stream *s, Breakpoint *bp, #define LLDB_OPTIONS_breakpoint_modify #include "CommandOptions.inc" -class lldb_private::BreakpointOptionGroup : public OptionGroup -{ +class lldb_private::BreakpointOptionGroup : public OptionGroup { public: - BreakpointOptionGroup() : - OptionGroup(), - m_bp_opts(false) {} - + BreakpointOptionGroup() : OptionGroup(), m_bp_opts(false) {} + ~BreakpointOptionGroup() override = default; llvm::ArrayRef<OptionDefinition> GetDefinitions() override { @@ -62,9 +59,10 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, - ExecutionContext *execution_context) override { + ExecutionContext *execution_context) override { Status error; - const int short_option = g_breakpoint_modify_options[option_idx].short_option; + const int short_option = + g_breakpoint_modify_options[option_idx].short_option; switch (short_option) { case 'c': @@ -91,18 +89,15 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup error.SetErrorStringWithFormat( "invalid boolean value '%s' passed for -G option", option_arg.str().c_str()); - } - break; - case 'i': - { + } break; + case 'i': { uint32_t ignore_count; if (option_arg.getAsInteger(0, ignore_count)) error.SetErrorStringWithFormat("invalid ignore count '%s'", option_arg.str().c_str()); else m_bp_opts.SetIgnoreCount(ignore_count); - } - break; + } break; case 'o': { bool value, success; value = OptionArgParser::ToBoolean(option_arg, false, &success); @@ -113,8 +108,7 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup "invalid boolean value '%s' passed for -o option", option_arg.str().c_str()); } break; - case 't': - { + case 't': { lldb::tid_t thread_id = LLDB_INVALID_THREAD_ID; if (option_arg[0] != '\0') { if (option_arg.getAsInteger(0, thread_id)) @@ -122,16 +116,14 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup option_arg.str().c_str()); } m_bp_opts.SetThreadID(thread_id); - } - break; + } break; case 'T': m_bp_opts.GetThreadSpec()->SetName(option_arg.str().c_str()); break; case 'q': m_bp_opts.GetThreadSpec()->SetQueueName(option_arg.str().c_str()); break; - case 'x': - { + case 'x': { uint32_t thread_index = UINT32_MAX; if (option_arg[0] != '\n') { if (option_arg.getAsInteger(0, thread_index)) @@ -139,8 +131,7 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup option_arg.str().c_str()); } m_bp_opts.GetThreadSpec()->SetIndex(thread_index); - } - break; + } break; default: llvm_unreachable("Unimplemented option"); } @@ -152,43 +143,35 @@ class lldb_private::BreakpointOptionGroup : public OptionGroup m_bp_opts.Clear(); m_commands.clear(); } - + Status OptionParsingFinished(ExecutionContext *execution_context) override { - if (!m_commands.empty()) - { - if (!m_commands.empty()) - { - auto cmd_data = std::make_unique<BreakpointOptions::CommandData>(); - - for (std::string &str : m_commands) - cmd_data->user_source.AppendString(str); - - cmd_data->stop_on_error = true; - m_bp_opts.SetCommandDataCallback(cmd_data); + if (!m_commands.empty()) { + if (!m_commands.empty()) { + auto cmd_data = std::make_unique<BreakpointOptions::CommandData>(); + + for (std::string &str : m_commands) + cmd_data->user_source.AppendString(str); + + cmd_data->stop_on_error = true; + m_bp_opts.SetCommandDataCallback(cmd_data); } } return Status(); } - - const BreakpointOptions &GetBreakpointOptions() - { - return m_bp_opts; - } + + const BreakpointOptions &GetBreakpointOptions() { return m_bp_opts; } std::vector<std::string> m_commands; BreakpointOptions m_bp_opts; - }; #define LLDB_OPTIONS_breakpoint_dummy #include "CommandOptions.inc" -class BreakpointDummyOptionGroup : public OptionGroup -{ +class BreakpointDummyOptionGroup : public OptionGroup { public: - BreakpointDummyOptionGroup() : - OptionGroup() {} - + BreakpointDummyOptionGroup() : OptionGroup() {} + ~BreakpointDummyOptionGroup() override = default; llvm::ArrayRef<OptionDefinition> GetDefinitions() override { @@ -196,14 +179,15 @@ class BreakpointDummyOptionGroup : public OptionGroup } Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, - ExecutionContext *execution_context) override { + ExecutionContext *execution_context) override { Status error; - const int short_option = g_breakpoint_modify_options[option_idx].short_option; + const int short_option = + g_breakpoint_modify_options[option_idx].short_option; switch (short_option) { - case 'D': - m_use_dummy = true; - break; + case 'D': + m_use_dummy = true; + break; default: llvm_unreachable("Unimplemented option"); } @@ -216,7 +200,6 @@ class BreakpointDummyOptionGroup : public OptionGroup } bool m_use_dummy; - }; #define LLDB_OPTIONS_breakpoint_set @@ -245,8 +228,8 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { m_bp_opts(), m_python_class_options("scripted breakpoint", true, 'P'), m_options() { // We're picking up all the normal options, commands and disable. - m_all_options.Append(&m_python_class_options, LLDB_OPT_SET_1|LLDB_OPT_SET_2, - LLDB_OPT_SET_11); + m_all_options.Append(&m_python_class_options, + LLDB_OPT_SET_1 | LLDB_OPT_SET_2, LLDB_OPT_SET_11); m_all_options.Append(&m_bp_opts, LLDB_OPT_SET_1 | LLDB_OPT_SET_3 | LLDB_OPT_SET_4, LLDB_OPT_SET_ALL); @@ -262,21 +245,23 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { class CommandOptions : public OptionGroup { public: CommandOptions() - : OptionGroup(), m_condition(), m_filenames(), m_line_num(0), m_column(0), - m_func_names(), m_func_name_type_mask(eFunctionNameTypeNone), - m_func_regexp(), m_source_text_regexp(), m_modules(), m_load_addr(), - m_catch_bp(false), m_throw_bp(true), m_hardware(false), + : OptionGroup(), m_condition(), m_filenames(), m_line_num(0), + m_column(0), m_func_names(), + m_func_name_type_mask(eFunctionNameTypeNone), m_func_regexp(), + m_source_text_regexp(), m_modules(), m_load_addr(), m_catch_bp(false), + m_throw_bp(true), m_hardware(false), m_exception_language(eLanguageTypeUnknown), m_language(lldb::eLanguageTypeUnknown), - m_skip_prologue(eLazyBoolCalculate), - m_all_files(false), m_move_to_nearest_code(eLazyBoolCalculate) {} + m_skip_prologue(eLazyBoolCalculate), m_all_files(false), + m_move_to_nearest_code(eLazyBoolCalculate) {} ~CommandOptions() override = default; Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option = g_breakpoint_set_options[option_idx].short_option; + const int short_option = + g_breakpoint_set_options[option_idx].short_option; switch (short_option) { case 'a': { @@ -342,7 +327,7 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { m_func_names.push_back(option_arg); m_func_name_type_mask |= eFunctionNameTypeFull; break; - + case 'h': { bool success; m_catch_bp = OptionArgParser::ToBoolean(option_arg, true, &success); @@ -355,7 +340,7 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { case 'H': m_hardware = true; break; - + case 'K': { bool success; bool value; @@ -436,7 +421,7 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { case 'p': m_source_text_regexp.assign(option_arg); break; - + case 'r': m_func_regexp.assign(option_arg); break; @@ -635,22 +620,21 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { case eSetTypeFunctionRegexp: // Breakpoint by regular expression function // name - { - RegularExpression regexp(m_options.m_func_regexp); - if (llvm::Error err = regexp.GetError()) { - result.AppendErrorWithFormat( - "Function name regular expression could not be compiled: \"%s\"", - llvm::toString(std::move(err)).c_str()); - result.SetStatus(eReturnStatusFailed); - return false; - } - - bp_sp = target.CreateFuncRegexBreakpoint( - &(m_options.m_modules), &(m_options.m_filenames), std::move(regexp), - m_options.m_language, m_options.m_skip_prologue, internal, - m_options.m_hardware); + { + RegularExpression regexp(m_options.m_func_regexp); + if (llvm::Error err = regexp.GetError()) { + result.AppendErrorWithFormat( + "Function name regular expression could not be compiled: \"%s\"", + llvm::toString(std::move(err)).c_str()); + result.SetStatus(eReturnStatusFailed); + return false; } - break; + + bp_sp = target.CreateFuncRegexBreakpoint( + &(m_options.m_modules), &(m_options.m_filenames), std::move(regexp), + m_options.m_language, m_options.m_skip_prologue, internal, + m_options.m_hardware); + } break; case eSetTypeSourceRegexp: // Breakpoint by regexp on source text. { const size_t num_files = m_options.m_filenames.GetSize(); @@ -704,8 +688,7 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { m_python_class_options.GetStructuredData(), &error); if (error.Fail()) { result.AppendErrorWithFormat( - "Error setting extra exception arguments: %s", - error.AsCString()); + "Error setting extra exception arguments: %s", error.AsCString()); target.RemoveBreakpointByID(bp_sp->GetID()); result.SetStatus(eReturnStatusFailed); return false; @@ -733,12 +716,12 @@ class CommandObjectBreakpointSet : public CommandObjectParsed { } } } - + if (bp_sp) { Stream &output_stream = result.GetOutputStream(); const bool show_locations = false; bp_sp->GetDescription(&output_stream, lldb::eDescriptionLevelInitial, - show_locations); + show_locations); if (&target == &GetDummyTarget()) output_stream.Printf("Breakpoint set in dummy target, will get copied " "into future targets.\n"); @@ -822,9 +805,9 @@ class CommandObjectBreakpointModify : public CommandObjectParsed { // Add the entry for the first argument for this command to the object's // arguments vector. m_arguments.push_back(arg); - - m_options.Append(&m_bp_opts, - LLDB_OPT_SET_1 | LLDB_OPT_SET_2 | LLDB_OPT_SET_3, + + m_options.Append(&m_bp_opts, + LLDB_OPT_SET_1 | LLDB_OPT_SET_2 | LLDB_OPT_SET_3, LLDB_OPT_SET_ALL); m_options.Append(&m_dummy_opts, LLDB_OPT_SET_1, LLDB_OPT_SET_ALL); m_options.Finalize(); @@ -859,11 +842,11 @@ class CommandObjectBreakpointModify : public CommandObjectParsed { BreakpointLocation *location = bp->FindLocationByID(cur_bp_id.GetLocationID()).get(); if (location) - location->GetLocationOptions() - ->CopyOverSetOptions(m_bp_opts.GetBreakpointOptions()); + location->GetLocationOptions()->CopyOverSetOptions( + m_bp_opts.GetBreakpointOptions()); } else { - bp->GetOptions() - ->CopyOverSetOptions(m_bp_opts.GetBreakpointOptions()); + bp->GetOptions()->CopyOverSetOptions( + m_bp_opts.GetBreakpointOptions()); } } } @@ -1183,7 +1166,7 @@ class CommandObjectBreakpointList : public CommandObjectParsed { for (size_t i = 0; i < num_breakpoints; ++i) { Breakpoint *breakpoint = breakpoints.GetBreakpointAtIndex(i).get(); if (breakpoint->AllowList()) - AddBreakpointDescription(&output_stream, breakpoint, + AddBreakpointDescription(&output_stream, breakpoint, m_options.m_level); } result.SetStatus(eReturnStatusSuccessFinishNoResult); @@ -1580,62 +1563,61 @@ class BreakpointAccessOptionGroup : public OptionGroup { Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option - = g_breakpoint_access_options[option_idx].short_option; + const int short_option = + g_breakpoint_access_options[option_idx].short_option; switch (short_option) { - case 'L': { - bool value, success; - value = OptionArgParser::ToBoolean(option_arg, false, &success); - if (success) { - m_permissions.SetAllowList(value); - } else - error.SetErrorStringWithFormat( - "invalid boolean value '%s' passed for -L option", - option_arg.str().c_str()); - } break; - case 'A': { - bool value, success; - value = OptionArgParser::ToBoolean(option_arg, false, &success); - if (success) { - m_permissions.SetAllowDisable(value); - } else - error.SetErrorStringWithFormat( - "invalid boolean value '%s' passed for -L option", - option_arg.str().c_str()); - } break; - case 'D': { - bool value, success; - value = OptionArgParser::ToBoolean(option_arg, false, &success); - if (success) { - m_permissions.SetAllowDelete(value); - } else - error.SetErrorStringWithFormat( - "invalid boolean value '%s' passed for -L option", - option_arg.str().c_str()); - } break; - default: - llvm_unreachable("Unimplemented option"); + case 'L': { + bool value, success; + value = OptionArgParser::ToBoolean(option_arg, false, &success); + if (success) { + m_permissions.SetAllowList(value); + } else + error.SetErrorStringWithFormat( + "invalid boolean value '%s' passed for -L option", + option_arg.str().c_str()); + } break; + case 'A': { + bool value, success; + value = OptionArgParser::ToBoolean(option_arg, false, &success); + if (success) { + m_permissions.SetAllowDisable(value); + } else + error.SetErrorStringWithFormat( + "invalid boolean value '%s' passed for -L option", + option_arg.str().c_str()); + } break; + case 'D': { + bool value, success; + value = OptionArgParser::ToBoolean(option_arg, false, &success); + if (success) { + m_permissions.SetAllowDelete(value); + } else + error.SetErrorStringWithFormat( + "invalid boolean value '%s' passed for -L option", + option_arg.str().c_str()); + } break; + default: + llvm_unreachable("Unimplemented option"); } - + return error; } - - void OptionParsingStarting(ExecutionContext *execution_context) override { - } - - const BreakpointName::Permissions &GetPermissions() const - { + + void OptionParsingStarting(ExecutionContext *execution_context) override {} + + const BreakpointName::Permissions &GetPermissions() const { return m_permissions; } - BreakpointName::Permissions m_permissions; + BreakpointName::Permissions m_permissions; }; class CommandObjectBreakpointNameConfigure : public CommandObjectParsed { public: CommandObjectBreakpointNameConfigure(CommandInterpreter &interpreter) : CommandObjectParsed( - interpreter, "configure", "Configure the options for the breakpoint" + interpreter, "configure", + "Configure the options for the breakpoint" " name provided. " "If you provide a breakpoint id, the options will be copied from " "the breakpoint, otherwise only the options specified will be set " @@ -1652,14 +1634,10 @@ class CommandObjectBreakpointNameConfigure : public CommandObjectParsed { arg1.push_back(id_arg); m_arguments.push_back(arg1); - m_option_group.Append(&m_bp_opts, - LLDB_OPT_SET_ALL, - LLDB_OPT_SET_1); - m_option_group.Append(&m_access_options, - LLDB_OPT_SET_ALL, + m_option_group.Append(&m_bp_opts, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); + m_option_group.Append(&m_access_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_ALL); - m_option_group.Append(&m_bp_id, - LLDB_OPT_SET_2|LLDB_OPT_SET_4, + m_option_group.Append(&m_bp_id, LLDB_OPT_SET_2 | LLDB_OPT_SET_4, LLDB_OPT_SET_ALL); m_option_group.Finalize(); } @@ -1686,8 +1664,7 @@ class CommandObjectBreakpointNameConfigure : public CommandObjectParsed { // Make a pass through first to see that all the names are legal. for (auto &entry : command.entries()) { Status error; - if (!BreakpointID::StringIsBreakpointName(entry.ref(), error)) - { + if (!BreakpointID::StringIsBreakpointName(entry.ref(), error)) { result.AppendErrorWithFormat("Invalid breakpoint name: %s - %s", entry.c_str(), error.AsCString()); result.SetStatus(eReturnStatusFailed); @@ -1697,14 +1674,12 @@ class CommandObjectBreakpointNameConfigure : public CommandObjectParsed { // Now configure them, we already pre-checked the names so we don't need to // check the error: BreakpointSP bp_sp; - if (m_bp_id.m_breakpoint.OptionWasSet()) - { + if (m_bp_id.m_breakpoint.OptionWasSet()) { lldb::break_id_t bp_id = m_bp_id.m_breakpoint.GetUInt64Value(); bp_sp = target.GetBreakpointByID(bp_id); - if (!bp_sp) - { + if (!bp_sp) { result.AppendErrorWithFormatv("Could not find specified breakpoint {0}", - bp_id); + bp_id); result.SetStatus(eReturnStatusFailed); return false; } @@ -1718,7 +1693,7 @@ class CommandObjectBreakpointNameConfigure : public CommandObjectParsed { continue; if (m_bp_id.m_help_string.OptionWasSet()) bp_name->SetHelp(m_bp_id.m_help_string.GetStringValue().str().c_str()); - + if (bp_sp) target.ConfigureBreakpointName(*bp_name, *bp_sp->GetOptions(), m_access_options.GetPermissions()); @@ -1797,7 +1772,7 @@ class CommandObjectBreakpointNameAdd : public CommandObjectParsed { } size_t num_valid_ids = valid_bp_ids.GetSize(); const char *bp_name = m_name_options.m_name.GetCurrentValue(); - Status error; // This error reports illegal names, but we've already + Status error; // This error reports illegal names, but we've already // checked that, so we don't need to check it again here. for (size_t index = 0; index < num_valid_ids; index++) { lldb::break_id_t bp_id = @@ -1918,12 +1893,11 @@ class CommandObjectBreakpointNameList : public CommandObjectParsed { if (command.empty()) { target.GetBreakpointNames(name_list); } else { - for (const Args::ArgEntry &arg : command) - { + for (const Args::ArgEntry &arg : command) { name_list.push_back(arg.c_str()); } } - + if (name_list.empty()) { result.AppendMessage("No breakpoint names found."); } else { @@ -1933,15 +1907,13 @@ class CommandObjectBreakpointNameList : public CommandObjectParsed { Status error; BreakpointName *bp_name = target.FindBreakpointName(ConstString(name), false, error); - if (bp_name) - { + if (bp_name) { StreamString s; result.AppendMessageWithFormat("Name: %s\n", name); - if (bp_name->GetDescription(&s, eDescriptionLevelFull)) - { + if (bp_name->GetDescription(&s, eDescriptionLevelFull)) { result.AppendMessage(s.GetString()); } - + std::unique_lock<std::recursive_mutex> lock; target.GetBreakpointList().GetListMutex(lock); @@ -2274,13 +2246,10 @@ CommandObjectMultiwordBreakpoint::CommandObjectMultiwordBreakpoint( CommandObjectMultiwordBreakpoint::~CommandObjectMultiwordBreakpoint() = default; -void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target, - bool allow_locations, - CommandReturnObject &result, - BreakpointIDList *valid_ids, - BreakpointName::Permissions - ::PermissionKinds - purpose) { +void CommandObjectMultiwordBreakpoint::VerifyIDs( + Args &args, Target *target, bool allow_locations, + CommandReturnObject &result, BreakpointIDList *valid_ids, + BreakpointName::Permissions ::PermissionKinds purpose) { // args can be strings representing 1). integers (for breakpoint ids) // 2). the full breakpoint & location // canonical representation @@ -2313,7 +2282,7 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target, // breakpoint ids in the range, and shove all of those breakpoint id strings // into TEMP_ARGS. - BreakpointIDList::FindAndReplaceIDRanges(args, target, allow_locations, + BreakpointIDList::FindAndReplaceIDRanges(args, target, allow_locations, purpose, result, temp_args); // NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual diff --git a/lldb/source/Commands/CommandObjectBreakpoint.h b/lldb/source/Commands/CommandObjectBreakpoint.h index cba1f3f774ee..7a0d5546d7a0 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.h +++ b/lldb/source/Commands/CommandObjectBreakpoint.h @@ -9,17 +9,15 @@ #ifndef liblldb_CommandObjectBreakpoint_h_ #define liblldb_CommandObjectBreakpoint_h_ - #include <utility> #include <vector> -#include "lldb/lldb-private.h" #include "lldb/Breakpoint/BreakpointName.h" #include "lldb/Core/Address.h" #include "lldb/Core/STLUtils.h" #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/Options.h" - +#include "lldb/lldb-private.h" namespace lldb_private { @@ -31,19 +29,17 @@ class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword { ~CommandObjectMultiwordBreakpoint() override; - static void VerifyBreakpointOrLocationIDs(Args &args, Target *target, - CommandReturnObject &result, - BreakpointIDList *valid_ids, - BreakpointName::Permissions - ::PermissionKinds purpose) { + static void VerifyBreakpointOrLocationIDs( + Args &args, Target *target, CommandReturnObject &result, + BreakpointIDList *valid_ids, + BreakpointName::Permissions ::PermissionKinds purpose) { VerifyIDs(args, target, true, result, valid_ids, purpose); } - static void VerifyBreakpointIDs(Args &args, Target *target, - CommandReturnObject &result, - BreakpointIDList *valid_ids, - BreakpointName::Permissions::PermissionKinds - purpose) { + static void + VerifyBreakpointIDs(Args &args, Target *target, CommandReturnObject &result, + BreakpointIDList *valid_ids, + BreakpointName::Permissions::PermissionKinds purpose) { VerifyIDs(args, target, false, result, valid_ids, purpose); } @@ -51,8 +47,7 @@ class CommandObjectMultiwordBreakpoint : public CommandObjectMultiword { static void VerifyIDs(Args &args, Target *target, bool allow_locations, CommandReturnObject &result, BreakpointIDList *valid_ids, - BreakpointName::Permissions::PermissionKinds - purpose); + BreakpointName::Permissions::PermissionKinds purpose); }; } // namespace lldb_private diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp index ab853bc743af..1a4432149f73 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.cpp +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.cpp @@ -203,10 +203,10 @@ LLDB to stop." are no syntax errors may indicate that a function was declared but never called."); m_all_options.Append(&m_options); - m_all_options.Append(&m_func_options, LLDB_OPT_SET_2 | LLDB_OPT_SET_3, + m_all_options.Append(&m_func_options, LLDB_OPT_SET_2 | LLDB_OPT_SET_3, LLDB_OPT_SET_2); m_all_options.Finalize(); - + CommandArgumentEntry arg; CommandArgumentData bp_id_arg; @@ -287,8 +287,8 @@ are no syntax errors may indicate that a function was declared but never called. Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option - = g_breakpoint_command_add_options[option_idx].short_option; + const int short_option = + g_breakpoint_command_add_options[option_idx].short_option; switch (short_option) { case 'o': @@ -421,8 +421,8 @@ are no syntax errors may indicate that a function was declared but never called. Status error = script_interp->SetBreakpointCommandCallbackFunction( m_bp_options_vec, m_func_options.GetName().c_str(), m_func_options.GetStructuredData()); - if (!error.Success()) - result.SetError(error); + if (!error.Success()) + result.SetError(error); } else { script_interp->CollectDataForBreakpointCommandCallback( m_bp_options_vec, result); @@ -648,9 +648,8 @@ class CommandObjectBreakpointCommandList : public CommandObjectParsed { if (bp) { BreakpointLocationSP bp_loc_sp; if (cur_bp_id.GetLocationID() != LLDB_INVALID_BREAK_ID) { - bp_loc_sp = bp->FindLocationByID(cur_bp_id.GetLocationID()); - if (!bp_loc_sp) - { + bp_loc_sp = bp->FindLocationByID(cur_bp_id.GetLocationID()); + if (!bp_loc_sp) { result.AppendErrorWithFormat("Invalid breakpoint ID: %u.%u.\n", cur_bp_id.GetBreakpointID(), cur_bp_id.GetLocationID()); @@ -665,9 +664,10 @@ class CommandObjectBreakpointCommandList : public CommandObjectParsed { cur_bp_id.GetLocationID()); const Baton *baton = nullptr; if (bp_loc_sp) - baton = bp_loc_sp - ->GetOptionsSpecifyingKind(BreakpointOptions::eCallback) - ->GetBaton(); + baton = + bp_loc_sp + ->GetOptionsSpecifyingKind(BreakpointOptions::eCallback) + ->GetBaton(); else baton = bp->GetOptions()->GetBaton(); @@ -702,9 +702,10 @@ class CommandObjectBreakpointCommandList : public CommandObjectParsed { CommandObjectBreakpointCommand::CommandObjectBreakpointCommand( CommandInterpreter &interpreter) : CommandObjectMultiword( - interpreter, "command", "Commands for adding, removing and listing " - "LLDB commands executed when a breakpoint is " - "hit.", + interpreter, "command", + "Commands for adding, removing and listing " + "LLDB commands executed when a breakpoint is " + "hit.", "command <sub-command> [<sub-command-options>] <breakpoint-id>") { CommandObjectSP add_command_object( new CommandObjectBreakpointCommandAdd(interpreter)); diff --git a/lldb/source/Commands/CommandObjectBreakpointCommand.h b/lldb/source/Commands/CommandObjectBreakpointCommand.h index b18e003368be..88060eae3961 100644 --- a/lldb/source/Commands/CommandObjectBreakpointCommand.h +++ b/lldb/source/Commands/CommandObjectBreakpointCommand.h @@ -9,8 +9,6 @@ #ifndef liblldb_CommandObjectBreakpointCommand_h_ #define liblldb_CommandObjectBreakpointCommand_h_ - - #include "lldb/Interpreter/CommandObject.h" #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/CommandReturnObject.h" diff --git a/lldb/source/Commands/CommandObjectCommands.cpp b/lldb/source/Commands/CommandObjectCommands.cpp index 259affbe6e0a..5e4123c33125 100644 --- a/lldb/source/Commands/CommandObjectCommands.cpp +++ b/lldb/source/Commands/CommandObjectCommands.cpp @@ -900,9 +900,10 @@ class CommandObjectCommandsAddRegex : public CommandObjectParsed, public: CommandObjectCommandsAddRegex(CommandInterpreter &interpreter) : CommandObjectParsed( - interpreter, "command regex", "Define a custom command in terms of " - "existing commands by matching " - "regular expressions.", + interpreter, "command regex", + "Define a custom command in terms of " + "existing commands by matching " + "regular expressions.", "command regex <cmd-name> [s/<regex>/<subst>/ ...]"), IOHandlerDelegateMultiline("", IOHandlerDelegate::Completion::LLDBCommand), @@ -1197,8 +1198,8 @@ class CommandObjectPythonFunction : public CommandObjectRaw { CommandObjectPythonFunction(CommandInterpreter &interpreter, std::string name, std::string funct, std::string help, ScriptedCommandSynchronicity synch) - : CommandObjectRaw(interpreter, name), - m_function_name(funct), m_synchro(synch), m_fetched_help_long(false) { + : CommandObjectRaw(interpreter, name), m_function_name(funct), + m_synchro(synch), m_fetched_help_long(false) { if (!help.empty()) SetHelp(help); else { @@ -1241,10 +1242,9 @@ class CommandObjectPythonFunction : public CommandObjectRaw { result.SetStatus(eReturnStatusInvalid); - if (!scripter || - !scripter->RunScriptBasedCommand(m_function_name.c_str(), - raw_command_line, m_synchro, result, - error, m_exe_ctx)) { + if (!scripter || !scripter->RunScriptBasedCommand( + m_function_name.c_str(), raw_command_line, m_synchro, + result, error, m_exe_ctx)) { result.AppendError(error.AsCString()); result.SetStatus(eReturnStatusFailed); } else { @@ -1272,8 +1272,8 @@ class CommandObjectScriptingObject : public CommandObjectRaw { std::string name, StructuredData::GenericSP cmd_obj_sp, ScriptedCommandSynchronicity synch) - : CommandObjectRaw(interpreter, name), - m_cmd_obj_sp(cmd_obj_sp), m_synchro(synch), m_fetched_help_short(false), + : CommandObjectRaw(interpreter, name), m_cmd_obj_sp(cmd_obj_sp), + m_synchro(synch), m_fetched_help_short(false), m_fetched_help_long(false) { StreamString stream; stream.Printf("For more information run 'help %s'", name.c_str()); @@ -1821,9 +1821,10 @@ class CommandObjectMultiwordCommandsScript : public CommandObjectMultiword { public: CommandObjectMultiwordCommandsScript(CommandInterpreter &interpreter) : CommandObjectMultiword( - interpreter, "command script", "Commands for managing custom " - "commands implemented by " - "interpreter scripts.", + interpreter, "command script", + "Commands for managing custom " + "commands implemented by " + "interpreter scripts.", "command script <subcommand> [<subcommand-options>]") { LoadSubCommand("add", CommandObjectSP( new CommandObjectCommandsScriptAdd(interpreter))); diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 69e2d757b5fe..54030a5aded0 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -249,9 +249,8 @@ bool CommandObjectDisassemble::DoExecute(Args &command, m_options.arch.GetArchitectureName()); result.SetStatus(eReturnStatusFailed); return false; - } else if (flavor_string != nullptr && - !disassembler->FlavorValidForArchSpec(m_options.arch, - flavor_string)) + } else if (flavor_string != nullptr && !disassembler->FlavorValidForArchSpec( + m_options.arch, flavor_string)) result.AppendWarningWithFormat( "invalid disassembler flavor \"%s\", using default.\n", flavor_string); diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 9bafdc149804..1f7bfd127dbf 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -202,11 +202,12 @@ CommandObjectExpression::CommandOptions::GetDefinitions() { CommandObjectExpression::CommandObjectExpression( CommandInterpreter &interpreter) - : CommandObjectRaw( - interpreter, "expression", "Evaluate an expression on the current " - "thread. Displays any returned value " - "with LLDB's default formatting.", - "", eCommandProcessMustBePaused | eCommandTryTargetAPILock), + : CommandObjectRaw(interpreter, "expression", + "Evaluate an expression on the current " + "thread. Displays any returned value " + "with LLDB's default formatting.", + "", + eCommandProcessMustBePaused | eCommandTryTargetAPILock), IOHandlerDelegate(IOHandlerDelegate::Completion::Expression), m_option_group(), m_format_options(eFormatDefault), m_repl_option(LLDB_OPT_SET_1, false, "repl", 'r', "Drop into REPL", false, diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 6a7facdaff35..4eef44491654 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -177,10 +177,10 @@ class CommandObjectFrameDiagnose : public CommandObjectParsed { return false; } - - DumpValueObjectOptions::DeclPrintingHelper helper = [&valobj_sp]( - ConstString type, ConstString var, const DumpValueObjectOptions &opts, - Stream &stream) -> bool { + DumpValueObjectOptions::DeclPrintingHelper helper = + [&valobj_sp](ConstString type, ConstString var, + const DumpValueObjectOptions &opts, + Stream &stream) -> bool { const ValueObject::GetExpressionPathFormat format = ValueObject:: GetExpressionPathFormat::eGetExpressionPathFormatHonorPointers; const bool qualify_cxx_base_classes = false; @@ -209,12 +209,13 @@ class CommandObjectFrameDiagnose : public CommandObjectParsed { class CommandObjectFrameInfo : public CommandObjectParsed { public: CommandObjectFrameInfo(CommandInterpreter &interpreter) - : CommandObjectParsed( - interpreter, "frame info", "List information about the current " - "stack frame in the current thread.", - "frame info", - eCommandRequiresFrame | eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | eCommandProcessMustBePaused) {} + : CommandObjectParsed(interpreter, "frame info", + "List information about the current " + "stack frame in the current thread.", + "frame info", + eCommandRequiresFrame | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused) {} ~CommandObjectFrameInfo() override = default; @@ -275,13 +276,14 @@ class CommandObjectFrameSelect : public CommandObjectParsed { }; CommandObjectFrameSelect(CommandInterpreter &interpreter) - : CommandObjectParsed( - interpreter, "frame select", "Select the current stack frame by " - "index from within the current thread " - "(see 'thread backtrace'.)", - nullptr, - eCommandRequiresThread | eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), + : CommandObjectParsed(interpreter, "frame select", + "Select the current stack frame by " + "index from within the current thread " + "(see 'thread backtrace'.)", + nullptr, + eCommandRequiresThread | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | + eCommandProcessMustBePaused), m_options() { CommandArgumentEntry arg; CommandArgumentData index_arg; @@ -415,14 +417,14 @@ class CommandObjectFrameVariable : public CommandObjectParsed { "uses debug information and memory reads directly, rather than " "parsing and evaluating an expression, which may even involve " "JITing and running code in the target program.", - nullptr, eCommandRequiresFrame | eCommandTryTargetAPILock | - eCommandProcessMustBeLaunched | - eCommandProcessMustBePaused | eCommandRequiresProcess), + nullptr, + eCommandRequiresFrame | eCommandTryTargetAPILock | + eCommandProcessMustBeLaunched | eCommandProcessMustBePaused | + eCommandRequiresProcess), m_option_group(), m_option_variable( true), // Include the frame specific options by passing "true" - m_option_format(eFormatDefault), - m_varobj_options() { + m_option_format(eFormatDefault), m_varobj_options() { CommandArgumentEntry arg; CommandArgumentData var_name_arg; @@ -875,9 +877,8 @@ bool CommandObjectFrameRecognizerAdd::DoExecute(Args &command, if (interpreter && !interpreter->CheckObjectExists(m_options.m_class_name.c_str())) { - result.AppendWarning( - "The provided class does not exist - please define it " - "before attempting to use this frame recognizer"); + result.AppendWarning("The provided class does not exist - please define it " + "before attempting to use this frame recognizer"); } StackFrameRecognizerSP recognizer_sp = @@ -904,7 +905,7 @@ class CommandObjectFrameRecognizerClear : public CommandObjectParsed { public: CommandObjectFrameRecognizerClear(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "frame recognizer clear", - "Delete all frame recognizers.", nullptr) {} + "Delete all frame recognizers.", nullptr) {} ~CommandObjectFrameRecognizerClear() override = default; @@ -917,14 +918,14 @@ class CommandObjectFrameRecognizerClear : public CommandObjectParsed { }; class CommandObjectFrameRecognizerDelete : public CommandObjectParsed { - public: +public: CommandObjectFrameRecognizerDelete(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "frame recognizer delete", "Delete an existing frame recognizer.", nullptr) {} ~CommandObjectFrameRecognizerDelete() override = default; - protected: +protected: bool DoExecute(Args &command, CommandReturnObject &result) override { if (command.GetArgumentCount() == 0) { if (!m_interpreter.Confirm( @@ -957,7 +958,7 @@ class CommandObjectFrameRecognizerDelete : public CommandObjectParsed { }; class CommandObjectFrameRecognizerList : public CommandObjectParsed { - public: +public: CommandObjectFrameRecognizerList(CommandInterpreter &interpreter) : CommandObjectParsed(interpreter, "frame recognizer list", "Show a list of active frame recognizers.", @@ -965,14 +966,15 @@ class CommandObjectFrameRecognizerList : public CommandObjectParsed { ~CommandObjectFrameRecognizerList() override = default; - protected: +protected: bool DoExecute(Args &command, CommandReturnObject &result) override { bool any_printed = false; StackFrameRecognizerManager::ForEach( [&result, &any_printed](uint32_t recognizer_id, std::string name, std::string function, std::string symbol, bool regexp) { - if (name == "") name = "(internal)"; + if (name == "") + name = "(internal)"; result.GetOutputStream().Printf( "%d: %s, module %s, function %s%s\n", recognizer_id, name.c_str(), function.c_str(), symbol.c_str(), regexp ? " (regexp)" : ""); @@ -990,7 +992,7 @@ class CommandObjectFrameRecognizerList : public CommandObjectParsed { }; class CommandObjectFrameRecognizerInfo : public CommandObjectParsed { - public: +public: CommandObjectFrameRecognizerInfo(CommandInterpreter &interpreter) : CommandObjectParsed( interpreter, "frame recognizer info", @@ -1013,7 +1015,7 @@ class CommandObjectFrameRecognizerInfo : public CommandObjectParsed { ~CommandObjectFrameRecognizerInfo() override = default; - protected: +protected: bool DoExecute(Args &command, CommandReturnObject &result) override { Process *process = m_exe_ctx.GetProcessPtr(); if (process == nullptr) { @@ -1061,27 +1063,24 @@ class CommandObjectFrameRecognizerInfo : public CommandObjectParsed { }; class CommandObjectFrameRecognizer : public CommandObjectMultiword { - public: +public: CommandObjectFrameRecognizer(CommandInterpreter &interpreter) : CommandObjectMultiword( interpreter, "frame recognizer", "Commands for editing and viewing frame recognizers.", "frame recognizer [<sub-command-options>] ") { - LoadSubCommand( - "add", - CommandObjectSP(new CommandObjectFrameRecognizerAdd(interpreter))); + LoadSubCommand("add", CommandObjectSP(new CommandObjectFrameRecognizerAdd( + interpreter))); LoadSubCommand( "clear", CommandObjectSP(new CommandObjectFrameRecognizerClear(interpreter))); LoadSubCommand( "delete", CommandObjectSP(new CommandObjectFrameRecognizerDelete(interpreter))); - LoadSubCommand( - "list", - CommandObjectSP(new CommandObjectFrameRecognizerList(interpreter))); - LoadSubCommand( - "info", - CommandObjectSP(new CommandObjectFrameRecognizerInfo(interpreter))); + LoadSubCommand("list", CommandObjectSP(new CommandObjectFrameRecognizerList( + interpreter))); + LoadSubCommand("info", CommandObjectSP(new CommandObjectFrameRecognizerInfo( + interpreter))); } ~CommandObjectFrameRecognizer() override = default; @@ -1093,9 +1092,10 @@ class CommandObjectFrameRecognizer : public CommandObjectMultiword { CommandObjectMultiwordFrame::CommandObjectMultiwordFrame( CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "frame", "Commands for selecting and " - "examing the current " - "thread's stack frames.", + : CommandObjectMultiword(interpreter, "frame", + "Commands for selecting and " + "examing the current " + "thread's stack frames.", "frame <subcommand> [<subcommand-options>]") { LoadSubCommand("diagnose", CommandObjectSP(new CommandObjectFrameDiagnose(interpreter))); @@ -1106,9 +1106,8 @@ CommandObjectMultiwordFrame::CommandObjectMultiwordFrame( LoadSubCommand("variable", CommandObjectSP(new CommandObjectFrameVariable(interpreter))); #ifndef LLDB_DISABLE_PYTHON - LoadSubCommand( - "recognizer", - CommandObjectSP(new CommandObjectFrameRecognizer(interpreter))); + LoadSubCommand("recognizer", CommandObjectSP(new CommandObjectFrameRecognizer( + interpreter))); #endif } diff --git a/lldb/source/Commands/CommandObjectHelp.cpp b/lldb/source/Commands/CommandObjectHelp.cpp index c02a583bf9df..0799db94b397 100644 --- a/lldb/source/Commands/CommandObjectHelp.cpp +++ b/lldb/source/Commands/CommandObjectHelp.cpp @@ -27,25 +27,27 @@ void CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage( std::string command_str = command.str(); std::string prefix_str = prefix.str(); std::string subcommand_str = subcommand.str(); - const std::string &lookup_str = !subcommand_str.empty() ? subcommand_str : command_str; + const std::string &lookup_str = + !subcommand_str.empty() ? subcommand_str : command_str; s->Printf("'%s' is not a known command.\n", command_str.c_str()); s->Printf("Try '%shelp' to see a current list of commands.\n", prefix.str().c_str()); if (include_upropos) { s->Printf("Try '%sapropos %s' for a list of related commands.\n", - prefix_str.c_str(), lookup_str.c_str()); + prefix_str.c_str(), lookup_str.c_str()); } if (include_type_lookup) { s->Printf("Try '%stype lookup %s' for information on types, methods, " "functions, modules, etc.", - prefix_str.c_str(), lookup_str.c_str()); + prefix_str.c_str(), lookup_str.c_str()); } } CommandObjectHelp::CommandObjectHelp(CommandInterpreter &interpreter) - : CommandObjectParsed(interpreter, "help", "Show a list of all debugger " - "commands, or give details " - "about a specific command.", + : CommandObjectParsed(interpreter, "help", + "Show a list of all debugger " + "commands, or give details " + "about a specific command.", "help [<cmd-name>]"), m_options() { CommandArgumentEntry arg; diff --git a/lldb/source/Commands/CommandObjectLanguage.h b/lldb/source/Commands/CommandObjectLanguage.h index b86457c99af3..5dd0579dbb11 100644 --- a/lldb/source/Commands/CommandObjectLanguage.h +++ b/lldb/source/Commands/CommandObjectLanguage.h @@ -9,8 +9,6 @@ #ifndef liblldb_CommandObjectLanguage_h_ #define liblldb_CommandObjectLanguage_h_ - - #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/lldb-types.h" diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 38bd3d179096..679a7b6a9983 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -1440,8 +1440,7 @@ class CommandObjectMemoryWrite : public CommandObjectParsed { case eFormatBytes: case eFormatHex: case eFormatHexUppercase: - case eFormatPointer: - { + case eFormatPointer: { // Decode hex bytes // Be careful, getAsInteger with a radix of 16 rejects "0xab" so we // have to special case that: @@ -1597,13 +1596,14 @@ class CommandObjectMemoryWrite : public CommandObjectParsed { class CommandObjectMemoryHistory : public CommandObjectParsed { public: CommandObjectMemoryHistory(CommandInterpreter &interpreter) - : CommandObjectParsed( - interpreter, "memory history", "Print recorded stack traces for " - "allocation/deallocation events " - "associated with an address.", - nullptr, - eCommandRequiresTarget | eCommandRequiresProcess | - eCommandProcessMustBePaused | eCommandProcessMustBeLaunched) { + : CommandObjectParsed(interpreter, "memory history", + "Print recorded stack traces for " + "allocation/deallocation events " + "associated with an address.", + nullptr, + eCommandRequiresTarget | eCommandRequiresProcess | + eCommandProcessMustBePaused | + eCommandProcessMustBeLaunched) { CommandArgumentEntry arg1; CommandArgumentData addr_arg; @@ -1736,9 +1736,9 @@ class CommandObjectMemoryRegion : public CommandObjectParsed { range_info.GetRange().GetRangeEnd(), range_info.GetReadable() ? 'r' : '-', range_info.GetWritable() ? 'w' : '-', - range_info.GetExecutable() ? 'x' : '-', - name ? " " : "", name.AsCString(""), - section_name ? " " : "", section_name.AsCString("")); + range_info.GetExecutable() ? 'x' : '-', name ? " " : "", + name.AsCString(""), section_name ? " " : "", + section_name.AsCString("")); m_prev_end_addr = range_info.GetRange().GetRangeEnd(); result.SetStatus(eReturnStatusSuccessFinishResult); } else { diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index fbd13aa37bda..9e011621f68f 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -6,7 +6,6 @@ // //===----------------------------------------------------------------------===// -#include <mutex> #include "CommandObjectPlatform.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/Module.h" @@ -23,6 +22,7 @@ #include "lldb/Target/Process.h" #include "lldb/Utility/Args.h" #include "lldb/Utility/DataExtractor.h" +#include <mutex> #include "llvm/ADT/SmallString.h" #include "llvm/Support/Threading.h" @@ -1152,8 +1152,7 @@ class CommandObjectPlatformProcessList : public CommandObjectParsed { class CommandOptions : public Options { public: CommandOptions() - : Options(), match_info(), show_args(false), verbose(false) { - } + : Options(), match_info(), show_args(false), verbose(false) {} ~CommandOptions() override = default; @@ -1607,7 +1606,6 @@ class CommandObjectPlatformShell : public CommandObjectRaw { ExecutionContext exe_ctx = GetCommandInterpreter().GetExecutionContext(); m_options.NotifyOptionParsingStarting(&exe_ctx); - // Print out an usage syntax on an empty command line. if (raw_command_line.empty()) { result.GetOutputStream().Printf("%s\n", this->GetSyntax().str().c_str()); diff --git a/lldb/source/Commands/CommandObjectPlugin.h b/lldb/source/Commands/CommandObjectPlugin.h index 0aabb1399407..386ee5bba6a3 100644 --- a/lldb/source/Commands/CommandObjectPlugin.h +++ b/lldb/source/Commands/CommandObjectPlugin.h @@ -9,8 +9,6 @@ #ifndef liblldb_CommandObjectPlugin_h_ #define liblldb_CommandObjectPlugin_h_ - - #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/lldb-types.h" diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp index e5aa78afabb3..52063a9be93a 100644 --- a/lldb/source/Commands/CommandObjectProcess.cpp +++ b/lldb/source/Commands/CommandObjectProcess.cpp @@ -1014,10 +1014,10 @@ class CommandObjectProcessUnload : public CommandObjectParsed { class CommandObjectProcessSignal : public CommandObjectParsed { public: CommandObjectProcessSignal(CommandInterpreter &interpreter) - : CommandObjectParsed(interpreter, "process signal", - "Send a UNIX signal to the current target process.", - nullptr, eCommandRequiresProcess | - eCommandTryTargetAPILock) { + : CommandObjectParsed( + interpreter, "process signal", + "Send a UNIX signal to the current target process.", nullptr, + eCommandRequiresProcess | eCommandTryTargetAPILock) { CommandArgumentEntry arg; CommandArgumentData signal_arg; @@ -1224,7 +1224,7 @@ class CommandObjectProcessStatus : public CommandObjectParsed { const uint32_t start_frame = 0; const uint32_t num_frames = 1; const uint32_t num_frames_with_source = 1; - const bool stop_format = true; + const bool stop_format = true; process->GetStatus(strm); process->GetThreadStatus(strm, only_threads_with_stop_reason, start_frame, num_frames, num_frames_with_source, stop_format); diff --git a/lldb/source/Commands/CommandObjectSettings.cpp b/lldb/source/Commands/CommandObjectSettings.cpp index 248a04613d7a..95f79f45e22b 100644 --- a/lldb/source/Commands/CommandObjectSettings.cpp +++ b/lldb/source/Commands/CommandObjectSettings.cpp @@ -143,25 +143,24 @@ insert-before or insert-after."); request, nullptr); return; } - arg = - request.GetParsedLine().GetArgumentAtIndex(request.GetCursorIndex()); + arg = request.GetParsedLine().GetArgumentAtIndex(request.GetCursorIndex()); - if (!arg) - return; + if (!arg) + return; - // Complete option name - if (arg[0] != '-') - return; + // Complete option name + if (arg[0] != '-') + return; - // Complete setting value - const char *setting_var_name = - request.GetParsedLine().GetArgumentAtIndex(setting_var_idx); - Status error; - lldb::OptionValueSP value_sp(GetDebugger().GetPropertyValue( - &m_exe_ctx, setting_var_name, false, error)); - if (!value_sp) - return; - value_sp->AutoComplete(m_interpreter, request); + // Complete setting value + const char *setting_var_name = + request.GetParsedLine().GetArgumentAtIndex(setting_var_idx); + Status error; + lldb::OptionValueSP value_sp(GetDebugger().GetPropertyValue( + &m_exe_ctx, setting_var_name, false, error)); + if (!value_sp) + return; + value_sp->AutoComplete(m_interpreter, request); } protected: diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 78c8bc811926..10da30fb38b9 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -168,9 +168,8 @@ class CommandObjectSourceInfo : public CommandObjectParsed { if (module_list.GetSize() && module_list.GetIndexForModule(module) == LLDB_INVALID_INDEX32) continue; - if (file_spec && - !lldb_private::FileSpec::Equal(file_spec, line_entry.file, - has_path)) + if (file_spec && !lldb_private::FileSpec::Equal( + file_spec, line_entry.file, has_path)) continue; if (start_line > 0 && line_entry.line < start_line) continue; @@ -180,8 +179,7 @@ class CommandObjectSourceInfo : public CommandObjectParsed { continue; // Print a new header if the module changed. - ConstString module_file_name = - module->GetFileSpec().GetFilename(); + ConstString module_file_name = module->GetFileSpec().GetFilename(); assert(module_file_name); if (module_file_name != last_module_file_name) { if (num_matches > 0) @@ -227,8 +225,7 @@ class CommandObjectSourceInfo : public CommandObjectParsed { // Dump all matching lines at or above start_line for the file in the // CU. ConstString file_spec_name = file_spec.GetFilename(); - ConstString module_file_name = - module->GetFileSpec().GetFilename(); + ConstString module_file_name = module->GetFileSpec().GetFilename(); bool cu_header_printed = false; uint32_t line = start_line; while (true) { @@ -345,9 +342,8 @@ class CommandObjectSourceInfo : public CommandObjectParsed { if (target->GetSectionLoadList().ResolveLoadAddress(addr, so_addr)) { ModuleSP module_sp(so_addr.GetModule()); // Check to make sure this module is in our list. - if (module_sp && - module_list.GetIndexForModule(module_sp.get()) != - LLDB_INVALID_INDEX32) { + if (module_sp && module_list.GetIndexForModule(module_sp.get()) != + LLDB_INVALID_INDEX32) { SymbolContext sc; sc.Clear(true); if (module_sp->ResolveSymbolContextForAddress( @@ -401,8 +397,8 @@ class CommandObjectSourceInfo : public CommandObjectParsed { // If we didn't find any functions with that name, try searching for // symbols that line up exactly with function addresses. SymbolContextList sc_list_symbols; - module_list.FindFunctionSymbols( - name, eFunctionNameTypeAuto, sc_list_symbols); + module_list.FindFunctionSymbols(name, eFunctionNameTypeAuto, + sc_list_symbols); size_t num_symbol_matches = sc_list_symbols.GetSize(); for (size_t i = 0; i < num_symbol_matches; i++) { SymbolContext sc; @@ -875,7 +871,7 @@ class CommandObjectSourceList : public CommandObjectParsed { // passed to the various ModuleList::Find* calls, which would either be a // vector of string names or a ModuleSpecList. void FindMatchingFunctions(Target *target, ConstString name, - SymbolContextList &sc_list) { + SymbolContextList &sc_list) { // Displaying the source for a symbol: bool include_inlines = true; bool include_symbols = false; @@ -892,9 +888,9 @@ class CommandObjectSourceList : public CommandObjectParsed { ModuleSpec module_spec(module_file_spec); matching_modules.Clear(); target->GetImages().FindModules(module_spec, matching_modules); - matching_modules.FindFunctions( - name, eFunctionNameTypeAuto, include_symbols, include_inlines, - sc_list); + matching_modules.FindFunctions(name, eFunctionNameTypeAuto, + include_symbols, include_inlines, + sc_list); } } } else { @@ -949,7 +945,7 @@ class CommandObjectSourceList : public CommandObjectParsed { // symbols that line up exactly with function addresses. SymbolContextList sc_list_symbols; FindMatchingFunctionSymbols(target, name, sc_list_symbols); - size_t num_symbol_matches =sc_list_symbols.GetSize(); + size_t num_symbol_matches = sc_list_symbols.GetSize(); for (size_t i = 0; i < num_symbol_matches; i++) { SymbolContext sc; @@ -1233,9 +1229,9 @@ class CommandObjectSourceList : public CommandObjectParsed { m_options.num_lines = 10; const uint32_t column = 0; target->GetSourceManager().DisplaySourceLinesWithLineNumbers( - sc.comp_unit, m_options.start_line, column, - 0, m_options.num_lines, - "", &result.GetOutputStream(), GetBreakpointLocations()); + sc.comp_unit, m_options.start_line, column, 0, + m_options.num_lines, "", &result.GetOutputStream(), + GetBreakpointLocations()); result.SetStatus(eReturnStatusSuccessFinishResult); } else { @@ -1265,10 +1261,11 @@ class CommandObjectSourceList : public CommandObjectParsed { CommandObjectMultiwordSource::CommandObjectMultiwordSource( CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "source", "Commands for examining " - "source code described by " - "debug information for the " - "current target process.", + : CommandObjectMultiword(interpreter, "source", + "Commands for examining " + "source code described by " + "debug information for the " + "current target process.", "source <subcommand> [<subcommand-options>]") { LoadSubCommand("info", CommandObjectSP(new CommandObjectSourceInfo(interpreter))); diff --git a/lldb/source/Commands/CommandObjectStats.cpp b/lldb/source/Commands/CommandObjectStats.cpp index e3a1f9433662..f50bc706bf83 100644 --- a/lldb/source/Commands/CommandObjectStats.cpp +++ b/lldb/source/Commands/CommandObjectStats.cpp @@ -81,7 +81,8 @@ class CommandObjectStatsDump : public CommandObjectParsed { for (auto &stat : target.GetStatistics()) { result.AppendMessageWithFormat( "%s : %u\n", - lldb_private::GetStatDescription(static_cast<lldb_private::StatisticKind>(i)) + lldb_private::GetStatDescription( + static_cast<lldb_private::StatisticKind>(i)) .c_str(), stat); i += 1; diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index abf7895a7384..40e80bd7e94f 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -107,11 +107,11 @@ static void DumpTargetInfo(uint32_t target_idx, Target *target, const uint32_t start_frame = 0; const uint32_t num_frames = 1; const uint32_t num_frames_with_source = 1; - const bool stop_format = false; + const bool stop_format = false; process_sp->GetStatus(strm); process_sp->GetThreadStatus(strm, only_threads_with_stop_reason, - start_frame, num_frames, - num_frames_with_source, stop_format); + start_frame, num_frames, num_frames_with_source, + stop_format); } } @@ -398,8 +398,8 @@ class CommandObjectTargetCreate : public CommandObjectParsed { debugger.GetTargetList().SetSelectedTarget(target_sp.get()); if (must_set_platform_path) { ModuleSpec main_module_spec(file_spec); - ModuleSP module_sp = target_sp->GetOrCreateModule(main_module_spec, - true /* notify */); + ModuleSP module_sp = + target_sp->GetOrCreateModule(main_module_spec, true /* notify */); if (module_sp) module_sp->SetPlatformFileSpec(remote_file); } @@ -3139,18 +3139,17 @@ class CommandObjectTargetModulesList : public CommandObjectParsed { Address base_addr(objfile->GetBaseAddress()); if (base_addr.IsValid()) { if (target && !target->GetSectionLoadList().IsEmpty()) { - lldb::addr_t load_addr = - base_addr.GetLoadAddress(target); + lldb::addr_t load_addr = base_addr.GetLoadAddress(target); if (load_addr == LLDB_INVALID_ADDRESS) { base_addr.Dump(&strm, target, - Address::DumpStyleModuleWithFileAddress, - Address::DumpStyleFileAddress); + Address::DumpStyleModuleWithFileAddress, + Address::DumpStyleFileAddress); } else { if (format_char == 'o') { // Show the offset of slide for the image - strm.Printf( - "0x%*.*" PRIx64, addr_nibble_width, addr_nibble_width, - load_addr - base_addr.GetFileAddress()); + strm.Printf("0x%*.*" PRIx64, addr_nibble_width, + addr_nibble_width, + load_addr - base_addr.GetFileAddress()); } else { // Show the load address of the image strm.Printf("0x%*.*" PRIx64, addr_nibble_width, @@ -3452,8 +3451,7 @@ class CommandObjectTargetModulesShowUnwind : public CommandObjectParsed { } UnwindPlanSP of_unwind_augmented_sp = - func_unwinders_sp->GetObjectFileAugmentedUnwindPlan(*target, - *thread); + func_unwinders_sp->GetObjectFileAugmentedUnwindPlan(*target, *thread); if (of_unwind_augmented_sp) { result.GetOutputStream().Printf("object file augmented UnwindPlan:\n"); of_unwind_augmented_sp->Dump(result.GetOutputStream(), thread.get(), @@ -4450,8 +4448,7 @@ class CommandObjectTargetStopHookAdd : public CommandObjectParsed, error.SetErrorStringWithFormat( "invalid boolean value '%s' passed for -G option", option_arg.str().c_str()); - } - break; + } break; case 'l': if (option_arg.getAsInteger(0, m_line_start)) { error.SetErrorStringWithFormat("invalid start line number: \"%s\"", @@ -4655,48 +4652,47 @@ class CommandObjectTargetStopHookAdd : public CommandObjectParsed, } } - if (specifier_up) - new_hook_sp->SetSpecifier(specifier_up.release()); + if (specifier_up) + new_hook_sp->SetSpecifier(specifier_up.release()); - // Next see if any of the thread options have been entered: + // Next see if any of the thread options have been entered: - if (m_options.m_thread_specified) { - ThreadSpec *thread_spec = new ThreadSpec(); + if (m_options.m_thread_specified) { + ThreadSpec *thread_spec = new ThreadSpec(); - if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID) { - thread_spec->SetTID(m_options.m_thread_id); - } + if (m_options.m_thread_id != LLDB_INVALID_THREAD_ID) { + thread_spec->SetTID(m_options.m_thread_id); + } - if (m_options.m_thread_index != UINT32_MAX) - thread_spec->SetIndex(m_options.m_thread_index); + if (m_options.m_thread_index != UINT32_MAX) + thread_spec->SetIndex(m_options.m_thread_index); - if (!m_options.m_thread_name.empty()) - thread_spec->SetName(m_options.m_thread_name.c_str()); + if (!m_options.m_thread_name.empty()) + thread_spec->SetName(m_options.m_thread_name.c_str()); - if (!m_options.m_queue_name.empty()) - thread_spec->SetQueueName(m_options.m_queue_name.c_str()); + if (!m_options.m_queue_name.empty()) + thread_spec->SetQueueName(m_options.m_queue_name.c_str()); - new_hook_sp->SetThreadSpecifier(thread_spec); - } - - new_hook_sp->SetAutoContinue(m_options.m_auto_continue); - if (m_options.m_use_one_liner) { - // Use one-liners. - for (auto cmd : m_options.m_one_liner) - new_hook_sp->GetCommandPointer()->AppendString( - cmd.c_str()); - result.AppendMessageWithFormat("Stop hook #%" PRIu64 " added.\n", - new_hook_sp->GetID()); - } else { - m_stop_hook_sp = new_hook_sp; - m_interpreter.GetLLDBCommandsFromIOHandler( - "> ", // Prompt - *this, // IOHandlerDelegate - true, // Run IOHandler in async mode - nullptr); // Baton for the "io_handler" that will be passed back - // into our IOHandlerDelegate functions - } - result.SetStatus(eReturnStatusSuccessFinishNoResult); + new_hook_sp->SetThreadSpecifier(thread_spec); + } + + new_hook_sp->SetAutoContinue(m_options.m_auto_continue); + if (m_options.m_use_one_liner) { + // Use one-liners. + for (auto cmd : m_options.m_one_liner) + new_hook_sp->GetCommandPointer()->AppendString(cmd.c_str()); + result.AppendMessageWithFormat("Stop hook #%" PRIu64 " added.\n", + new_hook_sp->GetID()); + } else { + m_stop_hook_sp = new_hook_sp; + m_interpreter.GetLLDBCommandsFromIOHandler( + "> ", // Prompt + *this, // IOHandlerDelegate + true, // Run IOHandler in async mode + nullptr); // Baton for the "io_handler" that will be passed back + // into our IOHandlerDelegate functions + } + result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); } @@ -4751,7 +4747,7 @@ class CommandObjectTargetStopHookDelete : public CommandObjectParsed { } } } - result.SetStatus(eReturnStatusSuccessFinishNoResult); + result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); } }; @@ -4798,7 +4794,7 @@ class CommandObjectTargetStopHookEnableDisable : public CommandObjectParsed { } } } - result.SetStatus(eReturnStatusSuccessFinishNoResult); + result.SetStatus(eReturnStatusSuccessFinishNoResult); return result.Succeeded(); } diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp index d498418601d9..c93bd9d5c232 100644 --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -339,8 +339,7 @@ class CommandObjectThreadBacktrace : public CommandObjectIterateOverThreads { const bool stop_format = false; if (ext_thread_sp->GetStatus(strm, m_options.m_start, m_options.m_count, - num_frames_with_source, - stop_format)) { + num_frames_with_source, stop_format)) { DoExtendedBacktrace(ext_thread_sp.get(), result); } } @@ -393,7 +392,7 @@ static constexpr OptionEnumValueElement g_tri_running_mode[] = { {eOnlyThisThread, "this-thread", "Run only this thread"}, {eAllThreads, "all-threads", "Run all threads"}, {eOnlyDuringStepping, "while-stepping", - "Run only this thread while stepping"} }; + "Run only this thread while stepping"}}; static constexpr OptionEnumValues TriRunningModes() { return OptionEnumValues(g_tri_running_mode); @@ -419,8 +418,8 @@ class ThreadStepScopeOptionGroup : public OptionGroup { Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override { Status error; - const int short_option - = g_thread_step_scope_options[option_idx].short_option; + const int short_option = + g_thread_step_scope_options[option_idx].short_option; switch (short_option) { case 'a': { @@ -428,11 +427,10 @@ class ThreadStepScopeOptionGroup : public OptionGroup { bool avoid_no_debug = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) - error.SetErrorStringWithFormat( - "invalid boolean value for option '%c'", short_option); + error.SetErrorStringWithFormat("invalid boolean value for option '%c'", + short_option); else { - m_step_in_avoid_no_debug = - avoid_no_debug ? eLazyBoolYes : eLazyBoolNo; + m_step_in_avoid_no_debug = avoid_no_debug ? eLazyBoolYes : eLazyBoolNo; } } break; @@ -441,11 +439,10 @@ class ThreadStepScopeOptionGroup : public OptionGroup { bool avoid_no_debug = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) - error.SetErrorStringWithFormat( - "invalid boolean value for option '%c'", short_option); + error.SetErrorStringWithFormat("invalid boolean value for option '%c'", + short_option); else { - m_step_out_avoid_no_debug = - avoid_no_debug ? eLazyBoolYes : eLazyBoolNo; + m_step_out_avoid_no_debug = avoid_no_debug ? eLazyBoolYes : eLazyBoolNo; } } break; @@ -518,7 +515,6 @@ class ThreadStepScopeOptionGroup : public OptionGroup { class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed { public: - CommandObjectThreadStepWithTypeAndScope(CommandInterpreter &interpreter, const char *name, const char *help, const char *syntax, @@ -544,10 +540,9 @@ class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed { // Push the data for the first argument into the m_arguments vector. m_arguments.push_back(arg); - + if (step_type == eStepTypeScripted) { - m_all_options.Append(&m_class_options, - LLDB_OPT_SET_1 | LLDB_OPT_SET_2, + m_all_options.Append(&m_class_options, LLDB_OPT_SET_1 | LLDB_OPT_SET_2, LLDB_OPT_SET_1); } m_all_options.Append(&m_options); @@ -556,9 +551,7 @@ class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed { ~CommandObjectThreadStepWithTypeAndScope() override = default; - Options *GetOptions() override { - return &m_all_options; - } + Options *GetOptions() override { return &m_all_options; } protected: bool DoExecute(Args &command, CommandReturnObject &result) override { @@ -722,9 +715,9 @@ class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed { m_options.m_step_out_avoid_no_debug); } else if (m_step_type == eStepTypeScripted) { new_plan_sp = thread->QueueThreadPlanForStepScripted( - abort_other_plans, m_class_options.GetName().c_str(), - m_class_options.GetStructuredData(), - bool_stop_other_threads, new_plan_status); + abort_other_plans, m_class_options.GetName().c_str(), + m_class_options.GetStructuredData(), bool_stop_other_threads, + new_plan_status); } else { result.AppendError("step type is not supported"); result.SetStatus(eReturnStatusFailed); @@ -971,7 +964,7 @@ class CommandObjectThreadContinue : public CommandObjectParsed { static constexpr OptionEnumValueElement g_duo_running_mode[] = { {eOnlyThisThread, "this-thread", "Run only this thread"}, - {eAllThreads, "all-threads", "Run all threads"} }; + {eAllThreads, "all-threads", "Run all threads"}}; static constexpr OptionEnumValues DuoRunningModes() { return OptionEnumValues(g_duo_running_mode); @@ -1065,7 +1058,8 @@ class CommandObjectThreadUntil : public CommandObjectParsed { "Continue until a line number or address is reached by the " "current or specified thread. Stops when returning from " "the current function as a safety measure. " - "The target line number(s) are given as arguments, and if more than one" + "The target line number(s) are given as arguments, and if more " + "than one" " is provided, stepping will stop when the first one is hit.", nullptr, eCommandRequiresThread | eCommandTryTargetAPILock | @@ -1432,9 +1426,10 @@ class CommandObjectThreadInfo : public CommandObjectIterateOverThreads { CommandObjectThreadInfo(CommandInterpreter &interpreter) : CommandObjectIterateOverThreads( - interpreter, "thread info", "Show an extended summary of one or " - "more threads. Defaults to the " - "current thread.", + interpreter, "thread info", + "Show an extended summary of one or " + "more threads. Defaults to the " + "current thread.", "thread info", eCommandRequiresProcess | eCommandTryTargetAPILock | eCommandProcessMustBeLaunched | eCommandProcessMustBePaused), @@ -1476,7 +1471,7 @@ class CommandObjectThreadInfo : public CommandObjectIterateOverThreads { // CommandObjectThreadException class CommandObjectThreadException : public CommandObjectIterateOverThreads { - public: +public: CommandObjectThreadException(CommandInterpreter &interpreter) : CommandObjectIterateOverThreads( interpreter, "thread exception", @@ -2008,9 +2003,10 @@ class CommandObjectMultiwordThreadPlan : public CommandObjectMultiword { CommandObjectMultiwordThread::CommandObjectMultiwordThread( CommandInterpreter &interpreter) - : CommandObjectMultiword(interpreter, "thread", "Commands for operating on " - "one or more threads in " - "the current process.", + : CommandObjectMultiword(interpreter, "thread", + "Commands for operating on " + "one or more threads in " + "the current process.", "thread <subcommand> [<subcommand-options>]") { LoadSubCommand("backtrace", CommandObjectSP(new CommandObjectThreadBacktrace( interpreter))); @@ -2028,9 +2024,8 @@ CommandObjectMultiwordThread::CommandObjectMultiwordThread( CommandObjectSP(new CommandObjectThreadUntil(interpreter))); LoadSubCommand("info", CommandObjectSP(new CommandObjectThreadInfo(interpreter))); - LoadSubCommand( - "exception", - CommandObjectSP(new CommandObjectThreadException(interpreter))); + LoadSubCommand("exception", CommandObjectSP(new CommandObjectThreadException( + interpreter))); LoadSubCommand("step-in", CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope( interpreter, "thread step-in", diff --git a/lldb/source/Commands/CommandObjectType.cpp b/lldb/source/Commands/CommandObjectType.cpp index 5e31fd5e8bce..7e75c008a916 100644 --- a/lldb/source/Commands/CommandObjectType.cpp +++ b/lldb/source/Commands/CommandObjectType.cpp @@ -1059,8 +1059,9 @@ class CommandObjectTypeFormatterList : public CommandObjectParsed { bool any_printed = false; - auto category_closure = [&result, &formatter_regex, &any_printed]( - const lldb::TypeCategoryImplSP &category) -> void { + auto category_closure = + [&result, &formatter_regex, + &any_printed](const lldb::TypeCategoryImplSP &category) -> void { result.GetOutputStream().Printf( "-----------------------\nCategory: %s%s\n-----------------------\n", category->GetName(), category->IsEnabled() ? "" : " (disabled)"); @@ -2343,9 +2344,9 @@ bool CommandObjectTypeSynthAdd::AddSynth(ConstString type_name, type = eRegexSynth; } - if (category->AnyMatches(type_name, eFormatCategoryItemFilter | - eFormatCategoryItemRegexFilter, - false)) { + if (category->AnyMatches( + type_name, eFormatCategoryItemFilter | eFormatCategoryItemRegexFilter, + false)) { if (error) error->SetErrorStringWithFormat("cannot add synthetic for type %s when " "filter is defined in same category!", @@ -2468,9 +2469,9 @@ class CommandObjectTypeFilterAdd : public CommandObjectParsed { type = eRegexFilter; } - if (category->AnyMatches(type_name, eFormatCategoryItemSynth | - eFormatCategoryItemRegexSynth, - false)) { + if (category->AnyMatches( + type_name, eFormatCategoryItemSynth | eFormatCategoryItemRegexSynth, + false)) { if (error) error->SetErrorStringWithFormat("cannot add filter for type %s when " "synthetic is defined in same " @@ -2828,8 +2829,7 @@ class CommandObjectFormatterInfo : public CommandObjectRaw { CommandObjectFormatterInfo(CommandInterpreter &interpreter, const char *formatter_name, DiscoveryFunction discovery_func) - : CommandObjectRaw(interpreter, "", "", "", - eCommandRequiresFrame), + : CommandObjectRaw(interpreter, "", "", "", eCommandRequiresFrame), m_formatter_name(formatter_name ? formatter_name : ""), m_discovery_function(discovery_func) { StreamString name; diff --git a/lldb/source/Commands/CommandObjectType.h b/lldb/source/Commands/CommandObjectType.h index ebb19039e503..47d4af960a46 100644 --- a/lldb/source/Commands/CommandObjectType.h +++ b/lldb/source/Commands/CommandObjectType.h @@ -9,8 +9,6 @@ #ifndef liblldb_CommandObjectType_h_ #define liblldb_CommandObjectType_h_ - - #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/Options.h" #include "lldb/lldb-types.h" diff --git a/lldb/source/Commands/CommandObjectWatchpoint.h b/lldb/source/Commands/CommandObjectWatchpoint.h index f21796e6bc8d..879bd654bb3b 100644 --- a/lldb/source/Commands/CommandObjectWatchpoint.h +++ b/lldb/source/Commands/CommandObjectWatchpoint.h @@ -9,7 +9,6 @@ #ifndef liblldb_CommandObjectWatchpoint_h_ #define liblldb_CommandObjectWatchpoint_h_ - #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/OptionGroupWatchpoint.h" #include "lldb/Interpreter/Options.h" diff --git a/lldb/source/Commands/CommandObjectWatchpointCommand.h b/lldb/source/Commands/CommandObjectWatchpointCommand.h index f2f15ef50b0f..a8a683ec8d87 100644 --- a/lldb/source/Commands/CommandObjectWatchpointCommand.h +++ b/lldb/source/Commands/CommandObjectWatchpointCommand.h @@ -9,8 +9,6 @@ #ifndef liblldb_CommandObjectWatchpointCommand_h_ #define liblldb_CommandObjectWatchpointCommand_h_ - - #include "lldb/Interpreter/CommandObjectMultiword.h" #include "lldb/Interpreter/Options.h" #include "lldb/lldb-types.h" _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits