diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2018-07-31 17:51:25 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2018-07-31 17:51:25 +0000 |
commit | 6492be7d57b91310e3f3b6fddb0dd747c4311b44 (patch) | |
tree | 4466b107e3de777c9d922ec5dd2c20ed0346d70d /contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | c85947bf324728dd1b26c2a7454535ba2134185c (diff) | |
parent | f73363f1dd94996356cefbf24388f561891acf0b (diff) |
Notes
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp | 77 |
1 files changed, 38 insertions, 39 deletions
diff --git a/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp b/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp index 5a175d61060e..fb0553e482db 100644 --- a/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/contrib/llvm/tools/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -22,6 +22,7 @@ #include "lldb/Interpreter/CommandCompletions.h" #include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" +#include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionValueBoolean.h" #include "lldb/Interpreter/OptionValueString.h" #include "lldb/Interpreter/OptionValueUInt64.h" @@ -84,8 +85,8 @@ public: switch (short_option) { case 'c': - // Normally an empty breakpoint condition marks is as unset. - // But we need to say it was passed in. + // Normally an empty breakpoint condition marks is as unset. But we need + // to say it was passed in. m_bp_opts.SetCondition(option_arg.str().c_str()); m_bp_opts.m_set_flags.Set(BreakpointOptions::eCondition); break; @@ -100,7 +101,7 @@ public: break; case 'G': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_bp_opts.SetAutoContinue(value); } else @@ -121,7 +122,7 @@ public: break; case 'o': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_bp_opts.SetOneShot(value); } else @@ -262,8 +263,9 @@ static OptionDefinition g_breakpoint_set_options[] = { "#included, set target.inline-breakpoint-strategy to \"always\"." }, { LLDB_OPT_SET_1, true, "line", 'l', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeLineNum, "Specifies the line number on which to set this breakpoint." }, - // Comment out this option for the moment, as we don't actually use it, but will in the future. - // This way users won't see it, but the infrastructure is left in place. + // Comment out this option for the moment, as we don't actually use it, but + // will in the future. This way users won't see it, but the infrastructure is + // left in place. // { 0, false, "column", 'C', OptionParser::eRequiredArgument, nullptr, "<column>", // "Set the breakpoint by source location at this particular column."}, @@ -281,7 +283,7 @@ static OptionDefinition g_breakpoint_set_options[] = { { LLDB_OPT_SET_9, false, "source-regexp-function", 'X', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName, "When used with '-p' limits the source regex to source contained in the named " "functions. Can be repeated multiple times." }, { LLDB_OPT_SET_4, true, "fullname", 'F', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFullName, "Set the breakpoint by fully qualified function names. For C++ this means " - "namespaces and all arguments, and for Objective C this means a full function " + "namespaces and all arguments, and for Objective-C this means a full function " "prototype with class and selector. Can be repeated multiple times to make " "one breakpoint for multiple names." }, { LLDB_OPT_SET_5, true, "selector", 'S', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeSelector, "Set the breakpoint by ObjC selector name. Can be repeated multiple times to " @@ -377,8 +379,8 @@ public: switch (short_option) { case 'a': { - m_load_addr = Args::StringToAddress(execution_context, option_arg, - LLDB_INVALID_ADDRESS, &error); + m_load_addr = OptionArgParser::ToAddress(execution_context, option_arg, + LLDB_INVALID_ADDRESS, &error); } break; case 'A': @@ -442,7 +444,7 @@ public: case 'h': { bool success; - m_catch_bp = Args::StringToBoolean(option_arg, true, &success); + m_catch_bp = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "Invalid boolean value for on-catch option: '%s'", @@ -456,7 +458,7 @@ public: case 'K': { bool success; bool value; - value = Args::StringToBoolean(option_arg, true, &success); + value = OptionArgParser::ToBoolean(option_arg, true, &success); if (value) m_skip_prologue = eLazyBoolYes; else @@ -485,7 +487,7 @@ public: case 'm': { bool success; bool value; - value = Args::StringToBoolean(option_arg, true, &success); + value = OptionArgParser::ToBoolean(option_arg, true, &success); if (value) m_move_to_nearest_code = eLazyBoolYes; else @@ -519,8 +521,8 @@ public: case 'R': { lldb::addr_t tmp_offset_addr; - tmp_offset_addr = - Args::StringToAddress(execution_context, option_arg, 0, &error); + tmp_offset_addr = OptionArgParser::ToAddress(execution_context, + option_arg, 0, &error); if (error.Success()) m_offset_addr = tmp_offset_addr; } break; @@ -549,7 +551,7 @@ public: case 'w': { bool success; - m_throw_bp = Args::StringToBoolean(option_arg, true, &success); + m_throw_bp = OptionArgParser::ToBoolean(option_arg, true, &success); if (!success) error.SetErrorStringWithFormat( "Invalid boolean value for on-throw option: '%s'", @@ -853,9 +855,9 @@ protected: output_stream.Printf("Breakpoint set in dummy target, will get copied " "into future targets.\n"); else { - // Don't print out this warning for exception breakpoints. They can get - // set before the target is set, but we won't know how to actually set - // the breakpoint till we run. + // Don't print out this warning for exception breakpoints. They can + // get set before the target is set, but we won't know how to actually + // set the breakpoint till we run. if (bp_sp->GetNumLocations() == 0 && break_type != eSetTypeException) { output_stream.Printf("WARNING: Unable to resolve breakpoint to any " "actual locations.\n"); @@ -874,8 +876,8 @@ private: bool GetDefaultFile(Target *target, FileSpec &file, CommandReturnObject &result) { uint32_t default_line; - // First use the Source Manager's default file. - // Then use the current stack frame's file. + // First use the Source Manager's default file. Then use the current stack + // frame's file. if (!target->GetSourceManager().GetDefaultFileAndLine(file, default_line)) { StackFrame *cur_frame = m_exe_ctx.GetFramePtr(); if (cur_frame == nullptr) { @@ -1451,7 +1453,8 @@ protected: return false; } - // The following are the various types of breakpoints that could be cleared: + // The following are the various types of breakpoints that could be + // cleared: // 1). -f -l (clearing breakpoint by source location) BreakpointClearType break_type = eClearTypeInvalid; @@ -1783,7 +1786,7 @@ public: switch (short_option) { case 'L': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_permissions.SetAllowList(value); } else @@ -1793,7 +1796,7 @@ public: } break; case 'A': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_permissions.SetAllowDisable(value); } else @@ -1803,7 +1806,7 @@ public: } break; case 'D': { bool value, success; - value = Args::StringToBoolean(option_arg, false, &success); + value = OptionArgParser::ToBoolean(option_arg, false, &success); if (success) { m_permissions.SetAllowDelete(value); } else @@ -1897,8 +1900,8 @@ protected: return false; } } - // Now configure them, we already pre-checked the names so we don't need - // to check the error: + // 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()) { @@ -2559,11 +2562,10 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target, } // Create a new Args variable to use; copy any non-breakpoint-id-ranges stuff - // directly from the old ARGS to - // the new TEMP_ARGS. Do not copy breakpoint id range strings over; instead - // generate a list of strings for - // all the breakpoint ids in the range, and shove all of those breakpoint id - // strings into TEMP_ARGS. + // directly from the old ARGS to the new TEMP_ARGS. Do not copy breakpoint + // id range strings over; instead generate a list of strings for all the + // breakpoint ids in the range, and shove all of those breakpoint id strings + // into TEMP_ARGS. BreakpointIDList::FindAndReplaceIDRanges(args, target, allow_locations, purpose, result, temp_args); @@ -2571,18 +2573,15 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target, // NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual // BreakpointIDList: - valid_ids->InsertStringArray(temp_args.GetConstArgumentVector(), - temp_args.GetArgumentCount(), result); + valid_ids->InsertStringArray(temp_args.GetArgumentArrayRef(), result); - // At this point, all of the breakpoint ids that the user passed in have been - // converted to breakpoint IDs - // and put into valid_ids. + // At this point, all of the breakpoint ids that the user passed in have + // been converted to breakpoint IDs and put into valid_ids. if (result.Succeeded()) { // Now that we've converted everything from args into a list of breakpoint - // ids, go through our tentative list - // of breakpoint id's and verify that they correspond to valid/currently set - // breakpoints. + // ids, go through our tentative list of breakpoint id's and verify that + // they correspond to valid/currently set breakpoints. const size_t count = valid_ids->GetSize(); for (size_t i = 0; i < count; ++i) { |