From f4efecd9587a54e331e14b90f53ef9f2bdfcfc93 Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Tue, 12 Jul 2011 22:56:10 +0000 Subject: smarter summary strings: - formats %s %char[] %c and %a now work to print 0-terminated c-strings if they are applied to a char* or char[] even without the [] operator (e.g. ${var%s}) - array formats (char[], intN[], ..) now work when applied to an array of a scalar type even without the [] operator (e.g. ${var%int32_t[]}) LLDB will not crash because of endless loop when trying to obtain a summary for an object that has no value and references itself in its summary string In many cases, a wrong summary string will now display an "" message instead of giving out an empty string llvm-svn: 135007 --- lldb/source/Core/DataExtractor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lldb/source/Core/DataExtractor.cpp') diff --git a/lldb/source/Core/DataExtractor.cpp b/lldb/source/Core/DataExtractor.cpp index 4cc98f31a65..aea0c471fcb 100644 --- a/lldb/source/Core/DataExtractor.cpp +++ b/lldb/source/Core/DataExtractor.cpp @@ -1610,8 +1610,11 @@ DataExtractor::Dump s->Printf("0x%8.8x", GetU32 (&offset)); break; - case eFormatVectorOfChar: - s->PutChar('{'); +// please keep the single-item formats below in sync with FormatManager::GetSingleItemFormat +// if you fail to do so, users will start getting different outputs depending on internal +// implementation details they should not care about || + case eFormatVectorOfChar: // || + s->PutChar('{'); // \/ offset = Dump (s, start_offset, eFormatCharArray, 1, item_byte_size, item_byte_size, LLDB_INVALID_ADDRESS, 0, 0); s->PutChar('}'); break; -- cgit v1.2.3