summaryrefslogtreecommitdiffstats
path: root/lldb/test/tools/lldb-mi/syntax/main.cpp
diff options
context:
space:
mode:
authorIlia K <ki.stfu@gmail.com>2015-02-26 18:14:30 +0000
committerIlia K <ki.stfu@gmail.com>2015-02-26 18:14:30 +0000
commitda86749a92f60e63aadd25a3cfed173a1cb189e4 (patch)
treea93a25d62a8fd6ecb4df95f8f39c69e6a73ee4f6 /lldb/test/tools/lldb-mi/syntax/main.cpp
parent28a3b86b069c05418234bd16890843ca400b8639 (diff)
downloadbcm5719-llvm-da86749a92f60e63aadd25a3cfed173a1cb189e4.tar.gz
bcm5719-llvm-da86749a92f60e63aadd25a3cfed173a1cb189e4.zip
Fix process's output to stdout/stderr (MI)
Summary: * Add CMIUtilString::Escape/Unescape methods (MI) * Fix process's output to stdout/stderr (MI): lldb-mi escapes process's output to show it in the following format: ``` ~"..." ``` But previously not all characters were escaped by CMICmnLLDBDebuggerHandleEvents::ConvertPrintfCtrlCodeToString and output of ``` printf("'\n` - it's \\n\x12\"\\\"") ``` looked like: ``` ~"'\r\n` - it's \n"\"" ``` This patch fixes it by using CMIUtilString::Escape method and now it looks like: ``` ~"'\r\n` - it's \\n\x12\"\\\"" ``` Reviewers: abidh, emaste, clayborg Reviewed By: clayborg Subscribers: zturner, lldb-commits, emaste, clayborg, abidh Differential Revision: http://reviews.llvm.org/D7858 llvm-svn: 230652
Diffstat (limited to 'lldb/test/tools/lldb-mi/syntax/main.cpp')
-rw-r--r--lldb/test/tools/lldb-mi/syntax/main.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/test/tools/lldb-mi/syntax/main.cpp b/lldb/test/tools/lldb-mi/syntax/main.cpp
new file mode 100644
index 00000000000..d2935b08f87
--- /dev/null
+++ b/lldb/test/tools/lldb-mi/syntax/main.cpp
@@ -0,0 +1,17 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include <cstdio>
+
+int
+main(int argc, char const *argv[])
+{
+ printf("'\n` - it's \\n\x12\"\\\"");
+ return 0;
+}
OpenPOWER on IntegriCloud