diff options
author | Jim Ingham <jingham@apple.com> | 2020-07-16 11:34:50 -0700 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2020-07-20 17:40:36 -0700 |
commit | bc0a9a17a4a658153f4b524da3274d33a98d1c5b (patch) | |
tree | b979d42a6899e46ae198935b0f444a4d07b71fa7 /lldb/source/Commands/CommandObjectBreakpoint.cpp | |
parent | b79dff02795074ca5a4937fc1c93cf0dc7b8d943 (diff) | |
download | llvm-bc0a9a17a4a658153f4b524da3274d33a98d1c5b.zip llvm-bc0a9a17a4a658153f4b524da3274d33a98d1c5b.tar.gz llvm-bc0a9a17a4a658153f4b524da3274d33a98d1c5b.tar.bz2 |
Add an option (-y) to "break set" and "source list" that uses the same
file:line:column form that we use to print out locations. Since we
print them this way it makes sense we also accept that form.
Differential Revision: https://reviews.llvm.org/D83975
Diffstat (limited to 'lldb/source/Commands/CommandObjectBreakpoint.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectBreakpoint.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectBreakpoint.cpp b/lldb/source/Commands/CommandObjectBreakpoint.cpp index be7ef8a..b62fe6c 100644 --- a/lldb/source/Commands/CommandObjectBreakpoint.cpp +++ b/lldb/source/Commands/CommandObjectBreakpoint.cpp @@ -17,6 +17,7 @@ #include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupPythonClassWithDict.h" #include "lldb/Interpreter/OptionValueBoolean.h" +#include "lldb/Interpreter/OptionValueFileColonLine.h" #include "lldb/Interpreter/OptionValueString.h" #include "lldb/Interpreter/OptionValueUInt64.h" #include "lldb/Interpreter/Options.h" @@ -443,7 +444,22 @@ public: case 'X': m_source_regex_func_names.insert(std::string(option_arg)); break; - + + case 'y': + { + OptionValueFileColonLine value; + Status fcl_err = value.SetValueFromString(option_arg); + if (!fcl_err.Success()) { + error.SetErrorStringWithFormat( + "Invalid value for file:line specifier: %s", + fcl_err.AsCString()); + } else { + m_filenames.AppendIfUnique(value.GetFileSpec()); + m_line_num = value.GetLineNumber(); + m_column = value.GetColumnNumber(); + } + } break; + default: llvm_unreachable("Unimplemented option"); } |