[Lldb-commits] [PATCH] D55653: [lldb-mi] Check raw pointers before passing them to std::string ctor/assignment

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Feb 20 09:49:21 PST 2019


tatyana-krasnukha updated this revision to Diff 187597.
tatyana-krasnukha added a comment.

Thanks for the review!

> So Format() and Printf() don't handle nullptr arguments already?

They just forward arguments to `vsprintf`/`vsnprintf`. Otherwise, the would have to do twice the work parsing format string.

> +1 in general (but it may be a bigger effort)

Since lldb-mi has its own wrapper for strings, we would have a conversion `const char*` -> `StringRef` -> `CMIUtilString` everywhere. This looks redundant to me and it is easy to forget converting a result of SB class's function to the `StringRef`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55653/new/

https://reviews.llvm.org/D55653

Files:
  tools/lldb-mi/MICmdCmdMiscellanous.cpp
  tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
  tools/lldb-mi/MICmnLLDBDebugger.cpp
  tools/lldb-mi/MICmnMIOutOfBandRecord.cpp
  tools/lldb-mi/MICmnMIResultRecord.cpp
  tools/lldb-mi/MIDriverMgr.cpp
  tools/lldb-mi/MIUtilString.cpp
  tools/lldb-mi/MIUtilString.h
  unittests/tools/CMakeLists.txt
  unittests/tools/lldb-mi/CMakeLists.txt
  unittests/tools/lldb-mi/utils/CMakeLists.txt
  unittests/tools/lldb-mi/utils/StringTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55653.187597.patch
Type: text/x-patch
Size: 10239 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190220/6024f4d0/attachment-0001.bin>


More information about the lldb-commits mailing list