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/CommandObjectSource.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/CommandObjectSource.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 1ccfd3a..8fff22a0 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -16,6 +16,7 @@ #include "lldb/Host/OptionParser.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/OptionArgParser.h" +#include "lldb/Interpreter/OptionValueFileColonLine.h" #include "lldb/Interpreter/Options.h" #include "lldb/Symbol/CompileUnit.h" #include "lldb/Symbol/Function.h" @@ -667,6 +668,22 @@ class CommandObjectSourceList : public CommandObjectParsed { case 'r': reverse = true; 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 { + file_name = value.GetFileSpec().GetPath(); + start_line = value.GetLineNumber(); + // I don't see anything useful to do with a column number, but I don't + // want to complain since someone may well have cut and pasted a + // listing from somewhere that included a column. + } + } break; default: llvm_unreachable("Unimplemented option"); } |