[Lldb-commits] [PATCH] D52788: Add EchoCommentCommands to CommandInterpreterRunOptions in addition to the existing EchoCommands and expose both as interpreter settings.

Adrian Prantl via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Oct 3 10:07:21 PDT 2018

aprantl added inline comments.

Comment at: source/Interpreter/CommandInterpreter.cpp:2733
+  const char *k_space_characters = "\t\n\v\f\r ";
+  size_t first_non_space = line.find_first_not_of(k_space_characters);
sgraenitz wrote:
> sgraenitz wrote:
> > shafik wrote:
> > > This looks like duplicate code from from `HandleCommand` I also see that at the the top of the file there is `k_white_space` although I am not sure why it is not in a anonymous namespace and why perhaps it is not a `ConstString`
> > Right, this is confusing. Any chance the extra escape sequences could make a difference in the context of line-wise command strings?
> > Anyway, yes I would feel better with one set of white space characters. Will check the details.
> > ```
> > \f    Form Feed
> > \r    Carriage Return
> > \v    Vertical Tab
> > ```
> We have more of them in CommandObjectCommands.cpp:1131, FormattersContainer.h:62, Args.cpp:397 and MIUtilString.cpp:511. LLVM has no named definition we could use. 
Drive-by-comment: It's also always good to double-check whether functionality like this already exists in either LLVM's StringRef or StringExtras.h (https://llvm.org/doxygen/StringExtras_8h_source.html).


More information about the lldb-commits mailing list