[Lldb-commits] [lldb] r227289 - Emit a warning the first time that one tries to resolve the size of a type passing a nullptr ExecutionContext - but only when it might actually make a difference

Enrico Granata egranata at apple.com
Tue Jan 27 17:41:01 PST 2015


Author: enrico
Date: Tue Jan 27 19:41:00 2015
New Revision: 227289

URL: http://llvm.org/viewvc/llvm-project?rev=227289&view=rev
Log:
Emit a warning the first time that one tries to resolve the size of a type passing a nullptr ExecutionContext - but only when it might actually make a difference

This should help us find these cases and act on them


Modified:
    lldb/trunk/source/Symbol/ClangASTType.cpp

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=227289&r1=227288&r2=227289&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Tue Jan 27 19:41:00 2015
@@ -2081,6 +2081,20 @@ ClangASTType::GetBitSize (ExecutionConte
                             return bit_size;
                     }
                 }
+                else
+                {
+                    static bool g_printed = false;
+                    StreamString s;
+                    s.Printf("warning: trying to determine the size of type ");
+                    DumpTypeDescription(&s);
+                    s.Printf("\n without a valid ExecutionContext. this is not reliable. please file a bug against LLDB.\nbacktrace:\n");
+                    Host::Backtrace(s, 10);
+                    if (!g_printed)
+                    {
+                        printf("%s\n", s.GetData());
+                        g_printed = true;
+                    }
+                }
                 // fallthrough
             default:
                 const uint32_t bit_size = m_ast->getTypeSize (qual_type);





More information about the lldb-commits mailing list