summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectWatchpoint.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-03-02 12:46:22 +0000
committerPavel Labath <labath@google.com>2015-03-02 12:46:22 +0000
commit00b7f95b122372d57b7d3f00ae435512024bb45e (patch)
treede21220b268ac58be38145b2e315040481b43080 /lldb/source/Commands/CommandObjectWatchpoint.cpp
parent2689d78909e115573d85075b5030b8acd1d14c75 (diff)
downloadbcm5719-llvm-00b7f95b122372d57b7d3f00ae435512024bb45e.tar.gz
bcm5719-llvm-00b7f95b122372d57b7d3f00ae435512024bb45e.zip
Fix handling of backslashes in Args parsing
Summary: Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the backslash itself is not removed from the argument, nor there is a way to escape the backslash itself. This leads to surprising results: "a b" c" -> 'a b', 'c' # Here we actually have an unterminated quote, but that is ignored "a b\" c" -> 'a b\" c' # We try to escape the quote. That works but the backslash is not removed. "a b\\" c" -> 'a b\\" c' # Escaping the backslash has no effect. This change changes quote handling to be more shell-like: - single quotes and backquotes are literal and there is no way to escape the closing quote or anything else inside; - inside double quotes you can use backslash to escape the closing quote and another backslash - outside any quotes, you can use backslash to escape quotes, spaces and itself. This makes the parsing more consistent with what the user is familiar and increases the probability that pasting the command line from shell to the "process launch" command "just work". Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7855 llvm-svn: 230955
Diffstat (limited to 'lldb/source/Commands/CommandObjectWatchpoint.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectWatchpoint.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectWatchpoint.cpp b/lldb/source/Commands/CommandObjectWatchpoint.cpp
index bef59ca30b3..6f15c09c3f1 100644
--- a/lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ b/lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -1211,7 +1211,7 @@ protected:
if (end_options)
{
- Args args (raw_command, end_options - raw_command);
+ Args args (llvm::StringRef(raw_command, end_options - raw_command));
if (!ParseOptions (args, result))
return false;
OpenPOWER on IntegriCloud