[Lldb-commits] [lldb] r134827 - /lldb/trunk/source/Core/ValueObject.cpp

Greg Clayton gclayton at apple.com
Sat Jul 9 10:17:07 PDT 2011


Author: gclayton
Date: Sat Jul  9 12:17:07 2011
New Revision: 134827

URL: http://llvm.org/viewvc/llvm-project?rev=134827&view=rev
Log:
Limit the character array summary to 512 bytes.


Modified:
    lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=134827&r1=134826&r2=134827&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Sat Jul  9 12:17:07 2011
@@ -567,10 +567,20 @@
                             AddressType cstr_address_type = eAddressTypeInvalid;
 
                             size_t cstr_len = 0;
+                            bool capped_data = false;
                             if (type_flags.Test (ClangASTContext::eTypeIsArray))
                             {
                                 // We have an array
                                 cstr_len = ClangASTContext::GetArraySize (clang_type);
+                                if (cstr_len > 512) // TODO: make cap a setting
+                                {
+                                    cstr_len = ClangASTContext::GetArraySize (clang_type);
+                                    if (cstr_len > 512) // TODO: make cap a setting
+                                    {
+                                        capped_data = true;
+                                        cstr_len = 512;
+                                    }
+                                }
                                 cstr_address = GetAddressOf (cstr_address_type, true);
                             }
                             else
@@ -601,6 +611,8 @@
                                                    LLDB_INVALID_ADDRESS,// base address
                                                    0,                 // bitfield bit size
                                                    0);                // bitfield bit offset
+                                        if (capped_data)
+                                            sstr << "...";
                                         sstr << '"';
                                     }
                                 }





More information about the lldb-commits mailing list