[Lldb-commits] [PATCH] D26124: [LLDB-MI] Escape MI output in a more consistent manner

Vadim Macagon via lldb-commits lldb-commits at lists.llvm.org
Sat Oct 29 22:21:26 PDT 2016


enlight created this revision.
enlight added reviewers: ki.stfu, abidh.
enlight added a subscriber: LLDB.
enlight set the repository for this revision to rL LLVM.

While attempting to run lldb-mi on Windows it became apparent that it doesn't consistently escape output, for instance error messages contained paths with unescaped backslashes, and unescaped double-quotes. To address this issue without spending a ridiculous amount of time trying to track down every case where output isn't properly escaped I've opted to move all escaping into `CMICmnMIValueConst`. `CMICmnMIValueConst` is the basic building block of all output emitted by lldb-mi, so handling escaping in a consistent manner here will help to ensure all output is properly escaped. This change required removing any existing escaping of output to prevent double-escaping.

I've also removed the spacing code from `CMICmnMIValueTuple` and `CMICmnMIValueResult`, it was only misused to format composite values in `CMICmnLLDBUtilSBValue::GetCompositeValue()`. The format of composite values isn't specified by the GDB-MI spec, and as such these values shouldn't be built using `CMICmnMIValueTuple`, `CMICmnMIValueResult`, and `CMICmnMIValueConst`.


Repository:
  rL LLVM

https://reviews.llvm.org/D26124

Files:
  packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
  packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
  tools/lldb-mi/MICmdCmdData.cpp
  tools/lldb-mi/MICmdCmdVar.cpp
  tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
  tools/lldb-mi/MICmnLLDBDebugSessionInfo.h
  tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp
  tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp
  tools/lldb-mi/MICmnLLDBUtilSBValue.cpp
  tools/lldb-mi/MICmnLLDBUtilSBValue.h
  tools/lldb-mi/MICmnMIValueConst.cpp
  tools/lldb-mi/MICmnMIValueConst.h
  tools/lldb-mi/MICmnMIValueResult.cpp
  tools/lldb-mi/MICmnMIValueResult.h
  tools/lldb-mi/MICmnMIValueTuple.cpp
  tools/lldb-mi/MICmnMIValueTuple.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26124.76324.patch
Type: text/x-patch
Size: 29332 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161030/b3a999c0/attachment-0001.bin>


More information about the lldb-commits mailing list