[Lldb-commits] [PATCH] Handle trailing spaces on "settings set" command more correctly

Pavel Labath labath at google.com
Thu Feb 12 08:31:07 PST 2015


Hi clayborg, zturner,

Currently we have some settings which treat "\ " on settings set commands specially. E.g., it is
a valid way of specifying an argument of " " to a target. However, this fails if "\ " is the last
argument as CommandObjectSettingsSet strips trailing whitespace. This resulted in a surprising
argument of "\" to the target.

This patch disables the training whitespace removal at a global
level. Instead, for each argument type we locally determine whether whitespace stripping makes
sense. Currently, I strip whitespace for all simple object type except of regex and
format-string, with the rationale that these two object types do their own complex parsing and we
want to interfere with them as least as possible. Specifically, stripping the whitespace of a
regex "\ " will result in a (surprising?) error "trailing backslash". Furthermore, the default
value of dissasembly-format setting already contains a trailing space and there is no way for the
user to type this in manually if we strip whitespace.

http://reviews.llvm.org/D7592

Files:
  include/lldb/Interpreter/Args.h
  source/Commands/CommandObjectSettings.cpp
  source/Interpreter/Args.cpp
  source/Interpreter/OptionValueArch.cpp
  source/Interpreter/OptionValueEnumeration.cpp
  source/Interpreter/OptionValueSInt64.cpp
  source/Interpreter/OptionValueString.cpp
  source/Interpreter/OptionValueUInt64.cpp
  test/settings/TestSettings.py

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7592.19835.patch
Type: text/x-patch
Size: 9036 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150212/020a7fe4/attachment.bin>


More information about the lldb-commits mailing list