From da04fbb5351fa38d43c85f98c12ce346fc4e1bb6 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Thu, 18 Dec 2014 19:43:29 +0000 Subject: [PATCH] We don't really handle printing embedded NULs in strings, but if we were to, we would need to have this logic inside the StringPrinter. So, add it.. For, you know, one day in the future where we might want to handle embedded NULs in strings... llvm-svn: 224537 --- lldb/source/DataFormatters/StringPrinter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lldb/source/DataFormatters/StringPrinter.cpp b/lldb/source/DataFormatters/StringPrinter.cpp index ec1bf5584553..571ef2f46bf8 100644 --- a/lldb/source/DataFormatters/StringPrinter.cpp +++ b/lldb/source/DataFormatters/StringPrinter.cpp @@ -149,6 +149,9 @@ GetPrintableImpl (uint8_t* buffer, uint8_t* buffer_end switch (*buffer) { + case 0: + retval = {"\\0",2}; + break; case '\a': retval = {"\\a",2}; break; @@ -250,6 +253,9 @@ GetPrintableImpl (uint8_t* buffer, uint8_t* buffer_end, { switch (codepoint) { + case 0: + retval = {"\\0",2}; + break; case '\a': retval = {"\\a",2}; break;