Fix process's output to stdout/stderr (MI)
authorIlia K <ki.stfu@gmail.com>
Thu, 26 Feb 2015 18:14:30 +0000 (18:14 +0000)
committerIlia K <ki.stfu@gmail.com>
Thu, 26 Feb 2015 18:14:30 +0000 (18:14 +0000)
commitda86749a92f60e63aadd25a3cfed173a1cb189e4
treea93a25d62a8fd6ecb4df95f8f39c69e6a73ee4f6
parent28a3b86b069c05418234bd16890843ca400b8639
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
lldb/test/tools/lldb-mi/syntax/Makefile [new file with mode: 0644]
lldb/test/tools/lldb-mi/syntax/TestMiSyntax.py [moved from lldb/test/tools/lldb-mi/TestMiSyntax.py with 73% similarity]
lldb/test/tools/lldb-mi/syntax/main.cpp [new file with mode: 0644]
lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
lldb/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
lldb/tools/lldb-mi/MIUtilString.cpp
lldb/tools/lldb-mi/MIUtilString.h