[Lldb-commits] [PATCH] D83975: Add an option to "break set" and "source list" that takes a line spec in the form file:line:column

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Jul 16 11:50:47 PDT 2020


jingham created this revision.
jingham added reviewers: JDevlieghere, teemperor.
Herald added subscribers: lldb-commits, dang, mgorny.
Herald added a project: LLDB.

I think it is important to have separate the file & line specifiers in "break set" because that way no matter what you've named your file, it will always be easy to pass it to lldb.  OTOH, for most filenames the "file:line:column" format is unambiguous, and we do print line spec's as "foo.c:10:20" so by rights there should be a way to use that specification.

This patch adds another option to break set (and also source list) that takes a specification of this form.  I called it "-y" partly because there aren't that many letters left to use in "break set".  Also, y is pretty easy to type, and it's the Spanish equivalent of "and", and since this is a "file AND line" specifier, that provides not too bad of a mnemonic.

For now I reused the source file completer for this, since if you are typing the source file part, that will do the right thing, and we don't do much useful completion on the line & column at present.  It would be a nice polish to have another completer that put a ":" after the filename it completes, but I'm not going to do that in this patch.  Even nicer would be to have a completer that would complete the line & column entries to only the file/line/column combinations that have line table entries.  But that's definitely another patch.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83975

Files:
  lldb/include/lldb/Interpreter/OptionValue.h
  lldb/include/lldb/Interpreter/OptionValueFileColonLine.h
  lldb/include/lldb/Interpreter/OptionValues.h
  lldb/include/lldb/lldb-defines.h
  lldb/include/lldb/lldb-enumerations.h
  lldb/packages/Python/lldbsuite/test/lldbutil.py
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectSource.cpp
  lldb/source/Commands/Options.td
  lldb/source/Interpreter/CMakeLists.txt
  lldb/source/Interpreter/CommandObject.cpp
  lldb/source/Interpreter/OptionValue.cpp
  lldb/source/Interpreter/OptionValueArray.cpp
  lldb/source/Interpreter/OptionValueDictionary.cpp
  lldb/source/Interpreter/OptionValueFileColonLine.cpp
  lldb/source/Interpreter/Property.cpp
  lldb/test/API/functionalities/breakpoint/breakpoint_by_file_colon_line/Makefile
  lldb/test/API/functionalities/breakpoint/breakpoint_by_file_colon_line/TestBreakpointByFileColonLine.py
  lldb/test/API/functionalities/breakpoint/breakpoint_by_file_colon_line/main.c
  lldb/test/API/source-manager/TestSourceManager.py
  lldb/unittests/Interpreter/CMakeLists.txt
  lldb/unittests/Interpreter/TestOptionValueFileColonLine.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83975.278560.patch
Type: text/x-patch
Size: 29126 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200716/e7bc0b00/attachment-0001.bin>


More information about the lldb-commits mailing list