[Lldb-commits] [lldb] r144493 - in /lldb/trunk: include/lldb/API/ include/lldb/Symbol/ scripts/Python/ scripts/Python/interface/ source/API/ source/Symbol/

Greg Clayton gclayton at apple.com
Sat Nov 12 22:57:32 PST 2011


Author: gclayton
Date: Sun Nov 13 00:57:31 2011
New Revision: 144493

URL: http://llvm.org/viewvc/llvm-project?rev=144493&view=rev
Log:
<rdar://problem/10126482>

Fixed an issues with the SBType and SBTypeMember classes:
- Fixed SBType to be able to dump itself from python
- Fixed SBType::GetNumberOfFields() to return the correct value for objective C interfaces
- Fixed SBTypeMember to be able to dump itself from python
- Fixed the SBTypeMember ability to get a field offset in bytes (the value
  being returned was wrong)
- Added the SBTypeMember ability to get a field offset in bits


Cleaned up a lot of the Stream usage in the SB API files.


Modified:
    lldb/trunk/include/lldb/API/SBStream.h
    lldb/trunk/include/lldb/API/SBTarget.h
    lldb/trunk/include/lldb/API/SBType.h
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/include/lldb/Symbol/Type.h
    lldb/trunk/scripts/Python/interface/SBTarget.i
    lldb/trunk/scripts/Python/interface/SBType.i
    lldb/trunk/scripts/Python/python-extensions.swig
    lldb/trunk/source/API/SBAddress.cpp
    lldb/trunk/source/API/SBBlock.cpp
    lldb/trunk/source/API/SBBreakpointLocation.cpp
    lldb/trunk/source/API/SBCommandReturnObject.cpp
    lldb/trunk/source/API/SBCompileUnit.cpp
    lldb/trunk/source/API/SBData.cpp
    lldb/trunk/source/API/SBDebugger.cpp
    lldb/trunk/source/API/SBEvent.cpp
    lldb/trunk/source/API/SBFileSpec.cpp
    lldb/trunk/source/API/SBFileSpecList.cpp
    lldb/trunk/source/API/SBFrame.cpp
    lldb/trunk/source/API/SBLineEntry.cpp
    lldb/trunk/source/API/SBModule.cpp
    lldb/trunk/source/API/SBProcess.cpp
    lldb/trunk/source/API/SBSection.cpp
    lldb/trunk/source/API/SBSymbol.cpp
    lldb/trunk/source/API/SBSymbolContext.cpp
    lldb/trunk/source/API/SBTarget.cpp
    lldb/trunk/source/API/SBThread.cpp
    lldb/trunk/source/API/SBType.cpp
    lldb/trunk/source/API/SBValue.cpp
    lldb/trunk/source/API/SBWatchpoint.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Symbol/Type.cpp

Modified: lldb/trunk/include/lldb/API/SBStream.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBStream.h?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBStream.h (original)
+++ lldb/trunk/include/lldb/API/SBStream.h Sun Nov 13 00:57:31 2011
@@ -64,18 +64,25 @@
     friend class SBCommandReturnObject;
     friend class SBCompileUnit;
     friend class SBData;
+    friend class SBDebugger;
     friend class SBEvent;
+    friend class SBFileSpec;
+    friend class SBFileSpecList;
     friend class SBFrame;
     friend class SBFunction;
     friend class SBInstruction;
     friend class SBInstructionList;
+    friend class SBLineEntry;
     friend class SBModule;
+    friend class SBProcess;
     friend class SBSection;
     friend class SBSourceManager;
     friend class SBSymbol;
     friend class SBSymbolContext;
     friend class SBTarget;
     friend class SBThread;
+    friend class SBType;
+    friend class SBTypeMember;
     friend class SBValue;
     friend class SBWatchpoint;
 

Modified: lldb/trunk/include/lldb/API/SBTarget.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBTarget.h?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBTarget.h (original)
+++ lldb/trunk/include/lldb/API/SBTarget.h Sun Nov 13 00:57:31 2011
@@ -496,13 +496,8 @@
 
 #endif
 
-#ifndef SWIG
     bool
     GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
-#endif
-
-    bool
-    GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level) const;
 
 protected:
     friend class SBAddress;

Modified: lldb/trunk/include/lldb/API/SBType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBType.h?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBType.h (original)
+++ lldb/trunk/include/lldb/API/SBType.h Sun Nov 13 00:57:31 2011
@@ -40,7 +40,14 @@
     GetType ();
     
     uint64_t
-    GetOffsetByteSize();
+    GetOffsetInBytes();
+    
+    uint64_t
+    GetOffsetInBits();
+
+    bool
+    GetDescription (lldb::SBStream &description, 
+                    lldb::DescriptionLevel description_level);
     
 protected:
     friend class SBType;
@@ -127,6 +134,10 @@
     static bool
     IsPointerType (void * clang_type);
         
+    bool
+    GetDescription (lldb::SBStream &description, 
+                    lldb::DescriptionLevel description_level);
+
 protected:
     
 #ifndef SWIG

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Sun Nov 13 00:57:31 2011
@@ -513,20 +513,20 @@
     GetDirectBaseClassAtIndex (clang::ASTContext *ast, 
                                lldb::clang_type_t clang_type,
                                uint32_t idx, 
-                               uint32_t *byte_offset_ptr);
+                               uint32_t *bit_offset_ptr);
 
     static lldb::clang_type_t
     GetVirtualBaseClassAtIndex (clang::ASTContext *ast, 
                                 lldb::clang_type_t clang_type,
                                 uint32_t idx, 
-                                uint32_t *byte_offset_ptr);
+                                uint32_t *bit_offset_ptr);
 
     static lldb::clang_type_t
     GetFieldAtIndex (clang::ASTContext *ast, 
                      lldb::clang_type_t clang_type,
                      uint32_t idx, 
                      std::string& name,
-                     uint32_t *byte_offset_ptr);
+                     uint32_t *bit_offset_ptr);
 
     static uint32_t
     GetNumPointeeChildren (lldb::clang_type_t clang_type);

Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Sun Nov 13 00:57:31 2011
@@ -355,6 +355,11 @@
     lldb::clang_type_t
     GetOpaqueQualType();    
 
+    bool
+    GetDescription (lldb_private::Stream &strm, 
+                    lldb::DescriptionLevel description_level);
+    
+
 private:
     ClangASTType m_clang_ast_type;
     lldb::TypeSP m_type_sp;

Modified: lldb/trunk/scripts/Python/interface/SBTarget.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBTarget.i?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBTarget.i (original)
+++ lldb/trunk/scripts/Python/interface/SBTarget.i Sun Nov 13 00:57:31 2011
@@ -472,7 +472,7 @@
     GetBroadcaster () const;
 
     bool
-    GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level) const;
+    GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
 };
 
 } // namespace lldb

Modified: lldb/trunk/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBType.i?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBType.i (original)
+++ lldb/trunk/scripts/Python/interface/SBType.i Sun Nov 13 00:57:31 2011
@@ -32,8 +32,11 @@
     GetType ();
 
     uint64_t
-    GetOffsetByteSize();
-
+    GetOffsetInBytes();
+    
+    uint64_t
+    GetOffsetInBits();
+    
 protected:
     std::auto_ptr<lldb_private::TypeMemberImpl> m_opaque_ap;
 };

Modified: lldb/trunk/scripts/Python/python-extensions.swig
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/python-extensions.swig?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/python-extensions.swig (original)
+++ lldb/trunk/scripts/Python/python-extensions.swig Sun Nov 13 00:57:31 2011
@@ -146,6 +146,20 @@
                 return PyString_FromString (description.GetData());
         }
 }
+%extend lldb::SBType {
+        PyObject *lldb::SBType::__repr__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                return PyString_FromString (description.GetData());
+        }
+}
+%extend lldb::SBTypeMember {
+        PyObject *lldb::SBTypeMember::__repr__ (){
+                lldb::SBStream description;
+                $self->GetDescription (description, lldb::eDescriptionLevelBrief);
+                return PyString_FromString (description.GetData());
+        }
+}
 %extend lldb::SBThread {
         PyObject *lldb::SBThread::__repr__ (){
                 lldb::SBStream description;

Modified: lldb/trunk/source/API/SBAddress.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBAddress.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBAddress.cpp (original)
+++ lldb/trunk/source/API/SBAddress.cpp Sun Nov 13 00:57:31 2011
@@ -277,11 +277,11 @@
 {
     // Call "ref()" on the stream to make sure it creates a backing stream in
     // case there isn't one already...
-    description.ref();
+    Stream &strm = description.ref();
     if (m_opaque_ap.get())
-        m_opaque_ap->GetAddress().Dump (description.get(), NULL, Address::DumpStyleModuleWithFileAddress, Address::DumpStyleInvalid, 4);
+        m_opaque_ap->GetAddress().Dump (&strm, NULL, Address::DumpStyleModuleWithFileAddress, Address::DumpStyleInvalid, 4);
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBBlock.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBlock.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBlock.cpp (original)
+++ lldb/trunk/source/API/SBBlock.cpp Sun Nov 13 00:57:31 2011
@@ -171,24 +171,26 @@
 bool
 SBBlock::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ptr)
     {
         lldb::user_id_t id = m_opaque_ptr->GetID();
-        description.Printf ("Block: {id: %llu} ", id);
+        strm.Printf ("Block: {id: %llu} ", id);
         if (IsInlined())
         {
-            description.Printf (" (inlined, '%s') ", GetInlinedName());
+            strm.Printf (" (inlined, '%s') ", GetInlinedName());
         }
         lldb_private::SymbolContext sc;
         m_opaque_ptr->CalculateSymbolContext (&sc);
         if (sc.function)
         {
-            m_opaque_ptr->DumpAddressRanges (description.get(), 
+            m_opaque_ptr->DumpAddressRanges (&strm,
                                              sc.function->GetAddressRange().GetBaseAddress().GetFileAddress());
         }
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBBreakpointLocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBBreakpointLocation.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBBreakpointLocation.cpp (original)
+++ lldb/trunk/source/API/SBBreakpointLocation.cpp Sun Nov 13 00:57:31 2011
@@ -275,15 +275,16 @@
 bool
 SBBreakpointLocation::GetDescription (SBStream &description, DescriptionLevel level)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
         Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex());
-        description.ref();
-        m_opaque_sp->GetDescription (description.get(), level);
-        description.get()->EOL();
+        m_opaque_sp->GetDescription (&strm, level);
+        strm.EOL();
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBCommandReturnObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCommandReturnObject.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCommandReturnObject.cpp (original)
+++ lldb/trunk/source/API/SBCommandReturnObject.cpp Sun Nov 13 00:57:31 2011
@@ -221,27 +221,29 @@
 bool
 SBCommandReturnObject::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ap.get())
     {
         description.Printf ("Status:  ");
         lldb::ReturnStatus status = m_opaque_ap->GetStatus();
         if (status == lldb::eReturnStatusStarted)
-            description.Printf ("Started");
+            strm.PutCString ("Started");
         else if (status == lldb::eReturnStatusInvalid)
-            description.Printf ("Invalid");
+            strm.PutCString ("Invalid");
         else if (m_opaque_ap->Succeeded())
-            description.Printf ("Success");
+            strm.PutCString ("Success");
         else
-            description.Printf ("Fail");
+            strm.PutCString ("Fail");
 
         if (GetOutputSize() > 0)
-            description.Printf ("\nOutput Message:\n%s", GetOutput());
+            strm.Printf ("\nOutput Message:\n%s", GetOutput());
 
         if (GetErrorSize() > 0)
-            description.Printf ("\nError Message:\n%s", GetError());
+            strm.Printf ("\nError Message:\n%s", GetError());
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBCompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBCompileUnit.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBCompileUnit.cpp (original)
+++ lldb/trunk/source/API/SBCompileUnit.cpp Sun Nov 13 00:57:31 2011
@@ -189,13 +189,14 @@
 bool
 SBCompileUnit::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ptr)
     {
-        description.ref();
-        m_opaque_ptr->Dump (description.get(), false);
+        m_opaque_ptr->Dump (&strm, false);
     }
     else
-        description.Printf ("No Value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBData.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBData.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBData.cpp (original)
+++ lldb/trunk/source/API/SBData.cpp Sun Nov 13 00:57:31 2011
@@ -13,6 +13,8 @@
 
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
+
 
 using namespace lldb;
 using namespace lldb_private;
@@ -414,21 +416,22 @@
 bool
 SBData::GetDescription (lldb::SBStream &description, lldb::addr_t base_addr)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
-        description.ref();
-        m_opaque_sp->Dump(description.get(),
-                          0,
-                          lldb::eFormatBytesWithASCII,
-                          1,
-                          m_opaque_sp->GetByteSize(),
-                          16,
-                          base_addr,
-                          0,
-                          0);
+        m_opaque_sp->Dump (&strm,
+                           0,
+                           lldb::eFormatBytesWithASCII,
+                           1,
+                           m_opaque_sp->GetByteSize(),
+                           16,
+                           base_addr,
+                           0,
+                           0);
     }
     else
-        description.Printf ("No Value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBDebugger.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBDebugger.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBDebugger.cpp (original)
+++ lldb/trunk/source/API/SBDebugger.cpp Sun Nov 13 00:57:31 2011
@@ -965,14 +965,16 @@
 bool
 SBDebugger::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
         const char *name = m_opaque_sp->GetInstanceName().AsCString();
         user_id_t id = m_opaque_sp->GetID();
-        description.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id);
+        strm.Printf ("Debugger (instance: \"%s\", id: %llu)", name, id);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBEvent.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBEvent.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBEvent.cpp (original)
+++ lldb/trunk/source/API/SBEvent.cpp Sun Nov 13 00:57:31 2011
@@ -205,13 +205,14 @@
 bool
 SBEvent::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (get())
     {
-        description.ref();
-        m_opaque_ptr->Dump (description.get());
+        m_opaque_ptr->Dump (&strm);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }
@@ -219,13 +220,14 @@
 bool
 SBEvent::GetDescription (SBStream &description) const
 {
+    Stream &strm = description.ref();
+
     if (get())
     {
-        description.ref();
-        m_opaque_ptr->Dump (description.get());
+        m_opaque_ptr->Dump (&strm);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBFileSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpec.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpec.cpp (original)
+++ lldb/trunk/source/API/SBFileSpec.cpp Sun Nov 13 00:57:31 2011
@@ -13,6 +13,7 @@
 #include "lldb/API/SBStream.h"
 #include "lldb/Host/FileSpec.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -200,14 +201,15 @@
 bool
 SBFileSpec::GetDescription (SBStream &description) const
 {
+    Stream &strm = description.ref();
     if (m_opaque_ap.get())
     {
         char path[PATH_MAX];
         if (m_opaque_ap->GetPath(path, sizeof(path)))
-            description.Printf ("%s", path);
+            strm.PutCString (path);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBFileSpecList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFileSpecList.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFileSpecList.cpp (original)
+++ lldb/trunk/source/API/SBFileSpecList.cpp Sun Nov 13 00:57:31 2011
@@ -14,6 +14,7 @@
 #include "lldb/API/SBStream.h"
 #include "lldb/Core/FileSpecList.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
 #include "lldb/Host/FileSpec.h"
 
 using namespace lldb;
@@ -121,19 +122,21 @@
 bool
 SBFileSpecList::GetDescription (SBStream &description) const
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ap.get())
     {
         uint32_t num_files = m_opaque_ap->GetSize();
-        description.Printf ("%d files: ", num_files);
+        strm.Printf ("%d files: ", num_files);
         for (uint32_t i = 0; i < num_files; i++)
         {
             char path[PATH_MAX];
             if (m_opaque_ap->GetFileSpecAtIndex(i).GetPath(path, sizeof(path)))
-                description.Printf ("\n    %s", path);
+                strm.Printf ("\n    %s", path);
         }
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Sun Nov 13 00:57:31 2011
@@ -708,14 +708,15 @@
 bool
 SBFrame::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
         Mutex::Locker api_locker (m_opaque_sp->GetThread().GetProcess().GetTarget().GetAPIMutex());
-        Stream &s = description.ref();
-        m_opaque_sp->DumpUsingSettingsFormat (&s);
+        m_opaque_sp->DumpUsingSettingsFormat (&strm);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBLineEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBLineEntry.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBLineEntry.cpp (original)
+++ lldb/trunk/source/API/SBLineEntry.cpp Sun Nov 13 00:57:31 2011
@@ -225,16 +225,18 @@
 bool
 SBLineEntry::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ap.get())
     {
         char file_path[PATH_MAX*2];
         m_opaque_ap->file.GetPath (file_path, sizeof (file_path));
-        description.Printf ("%s:%u", file_path, GetLine());
+        strm.Printf ("%s:%u", file_path, GetLine());
         if (GetColumn() > 0)
-            description.Printf (":%u", GetColumn());
+            strm.Printf (":%u", GetColumn());
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Sun Nov 13 00:57:31 2011
@@ -255,13 +255,14 @@
 bool
 SBModule::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
-        description.ref();
-        m_opaque_sp->GetDescription (description.get());
+        m_opaque_sp->GetDescription (&strm);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBProcess.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBProcess.cpp (original)
+++ lldb/trunk/source/API/SBProcess.cpp Sun Nov 13 00:57:31 2011
@@ -814,6 +814,8 @@
 bool
 SBProcess::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
         char path[PATH_MAX];
@@ -823,15 +825,15 @@
         if (exe_module)
             exe_name = exe_module->GetFileSpec().GetFilename().AsCString();
 
-        description.Printf ("SBProcess: pid = %llu, state = %s, threads = %d%s%s", 
-                            m_opaque_sp->GetID(),
-                            lldb_private::StateAsCString (GetState()), 
-                            GetNumThreads(),
-                            exe_name ? ", executable = " : "",
-                            exe_name ? exe_name : "");
+        strm.Printf ("SBProcess: pid = %llu, state = %s, threads = %d%s%s", 
+                     m_opaque_sp->GetID(),
+                     lldb_private::StateAsCString (GetState()), 
+                     GetNumThreads(),
+                     exe_name ? ", executable = " : "",
+                     exe_name ? exe_name : "");
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSection.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSection.cpp (original)
+++ lldb/trunk/source/API/SBSection.cpp Sun Nov 13 00:57:31 2011
@@ -326,16 +326,18 @@
 bool
 SBSection::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (IsValid())
     {
         const Section *section = m_opaque_ap->GetSection();
         const addr_t file_addr = section->GetFileAddress();
-        description.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section->GetByteSize());
-        section->DumpName(description.get());
+        strm.Printf ("[0x%16.16llx-0x%16.16llx) ", file_addr, file_addr + section->GetByteSize());
+        section->DumpName(&strm);
     }
     else
     {
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     }
 
     return true;

Modified: lldb/trunk/source/API/SBSymbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbol.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbol.cpp (original)
+++ lldb/trunk/source/API/SBSymbol.cpp Sun Nov 13 00:57:31 2011
@@ -100,14 +100,15 @@
 bool
 SBSymbol::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ptr)
     {
-        description.ref();
-        m_opaque_ptr->GetDescription (description.get(), 
+        m_opaque_ptr->GetDescription (&strm,
                                       lldb::eDescriptionLevelFull, NULL);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBSymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBSymbolContext.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBSymbolContext.cpp (original)
+++ lldb/trunk/source/API/SBSymbolContext.cpp Sun Nov 13 00:57:31 2011
@@ -254,13 +254,14 @@
 bool
 SBSymbolContext::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_ap.get())
     {
-        description.ref();
-        m_opaque_ap->GetDescription (description.get(), lldb::eDescriptionLevelFull, NULL);
+        m_opaque_ap->GetDescription (&strm, lldb::eDescriptionLevelFull, NULL);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Sun Nov 13 00:57:31 2011
@@ -1152,32 +1152,18 @@
 bool
 SBTarget::GetDescription (SBStream &description, lldb::DescriptionLevel description_level)
 {
-    if (m_opaque_sp)
-    {
-        description.ref();
-        m_opaque_sp->Dump (description.get(), description_level);
-    }
-    else
-        description.Printf ("No value");
-    
-    return true;
-}
+    Stream &strm = description.ref();
 
-bool
-SBTarget::GetDescription (SBStream &description, lldb::DescriptionLevel description_level) const
-{
     if (m_opaque_sp)
     {
-        description.ref();
-        m_opaque_sp->Dump (description.get(), description_level);
+        m_opaque_sp->Dump (&strm, description_level);
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }
 
-
 uint32_t
 SBTarget::FindFunctions (const char *name, 
                          uint32_t name_type_mask, 

Modified: lldb/trunk/source/API/SBThread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBThread.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBThread.cpp (original)
+++ lldb/trunk/source/API/SBThread.cpp Sun Nov 13 00:57:31 2011
@@ -951,13 +951,14 @@
 bool
 SBThread::GetDescription (SBStream &description) const
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
-        StreamString strm;
-        description.Printf("SBThread: tid = 0x%4.4llx", m_opaque_sp->GetID());
+        strm.Printf("SBThread: tid = 0x%4.4llx", m_opaque_sp->GetID());
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
     
     return true;
 }

Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Sun Nov 13 00:57:31 2011
@@ -18,6 +18,7 @@
 #include "lldb/API/SBStream.h"
 #include "lldb/Core/ConstString.h"
 #include "lldb/Core/Log.h"
+#include "lldb/Core/Stream.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Symbol/ClangASTType.h"
 #include "lldb/Symbol/Type.h"
@@ -342,6 +343,23 @@
     return 0;
 }
 
+bool
+SBType::GetDescription (SBStream &description, lldb::DescriptionLevel description_level)
+{
+    Stream &strm = description.ref();
+
+    if (m_opaque_sp)
+    {
+        m_opaque_sp->GetDescription (strm, description_level);
+    }
+    else
+        strm.PutCString ("No value");
+    
+    return true;
+}
+
+
+
 SBTypeMember
 SBType::GetDirectBaseClassAtIndex (uint32_t idx)
 {
@@ -349,12 +367,12 @@
     if (IsValid())
     {
         clang::ASTContext* ast = m_opaque_sp->GetASTContext();
-        uint32_t byte_offset = 0;
-        clang_type_t clang_type = ClangASTContext::GetDirectBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &byte_offset);
+        uint32_t bit_offset = 0;
+        clang_type_t clang_type = ClangASTContext::GetDirectBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &bit_offset);
         if (clang_type)
         {
             TypeImplSP type_impl_sp (new TypeImpl(ClangASTType (ast, clang_type)));
-            sb_type_member.reset (new TypeMemberImpl (type_impl_sp, byte_offset));
+            sb_type_member.reset (new TypeMemberImpl (type_impl_sp, bit_offset));
         }
     }
     return sb_type_member;
@@ -367,13 +385,13 @@
     SBTypeMember sb_type_member;
     if (IsValid())
     {
-        uint32_t byte_offset = 0;
+        uint32_t bit_offset = 0;
         clang::ASTContext* ast = m_opaque_sp->GetASTContext();
-        clang_type_t clang_type = ClangASTContext::GetVirtualBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &byte_offset);
+        clang_type_t clang_type = ClangASTContext::GetVirtualBaseClassAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, &bit_offset);
         if (clang_type)
         {
             TypeImplSP type_impl_sp (new TypeImpl(ClangASTType (ast, clang_type)));
-            sb_type_member.reset (new TypeMemberImpl (type_impl_sp, byte_offset));
+            sb_type_member.reset (new TypeMemberImpl (type_impl_sp, bit_offset));
         }        
     }
     return sb_type_member;
@@ -385,17 +403,17 @@
     SBTypeMember sb_type_member;
     if (IsValid())
     {
-        uint32_t byte_offset = 0;
+        uint32_t bit_offset = 0;
         clang::ASTContext* ast = m_opaque_sp->GetASTContext();
         std::string name_sstr;
-        clang_type_t clang_type = ClangASTContext::GetFieldAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, name_sstr, &byte_offset);
+        clang_type_t clang_type = ClangASTContext::GetFieldAtIndex (ast, m_opaque_sp->GetOpaqueQualType(), idx, name_sstr, &bit_offset);
         if (clang_type)
         {
             ConstString name;
             if (!name_sstr.empty())
                 name.SetCString(name_sstr.c_str());
             TypeImplSP type_impl_sp (new TypeImpl(ClangASTType (ast, clang_type)));
-            sb_type_member.reset (new TypeMemberImpl (type_impl_sp, byte_offset, name));
+            sb_type_member.reset (new TypeMemberImpl (type_impl_sp, bit_offset, name));
         }        
     }
     return sb_type_member;
@@ -545,13 +563,46 @@
 }
 
 uint64_t
-SBTypeMember::GetOffsetByteSize()
+SBTypeMember::GetOffsetInBytes()
 {
     if (m_opaque_ap.get())
         return (m_opaque_ap->GetBitOffset() + 7) / 8u;
     return 0;
 }
 
+uint64_t
+SBTypeMember::GetOffsetInBits()
+{
+    if (m_opaque_ap.get())
+        return m_opaque_ap->GetBitOffset();
+    return 0;
+}
+
+bool
+SBTypeMember::GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level)
+{
+    Stream &strm = description.ref();
+
+    if (m_opaque_ap.get())
+    {
+        const uint32_t byte_offset = (m_opaque_ap->GetBitOffset() + 7) / 8u;
+        const char *name = m_opaque_ap->GetName().GetCString();
+        strm.Printf ("+%u: (", byte_offset);
+        
+        TypeImplSP type_impl_sp (m_opaque_ap->GetTypeImpl());
+        if (type_impl_sp)
+            type_impl_sp->GetDescription(strm, description_level);
+        
+        strm.Printf (") %s", name);
+    }
+    else
+    {
+        strm.PutCString ("No value");
+    }
+    return true;   
+}
+
+
 void
 SBTypeMember::reset(TypeMemberImpl *type_member_impl)
 {

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Sun Nov 13 00:57:31 2011
@@ -917,25 +917,14 @@
 bool
 SBValue::GetDescription (SBStream &description)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
-        /*uint32_t ptr_depth = 0;
-        uint32_t curr_depth = 0;
-        uint32_t max_depth = UINT32_MAX;
-        bool show_types = false;
-        bool show_location = false;
-        bool use_objc = false;
-        lldb::DynamicValueType use_dynamic = eNoDynamicValues;
-        bool scope_already_checked = false;
-        bool flat_output = false;
-        bool use_synthetic = true;
-        uint32_t no_summary_depth = 0;
-        bool ignore_cap = false;*/
-        ValueObject::DumpValueObject (description.ref(), 
-                                      m_opaque_sp.get());
+        ValueObject::DumpValueObject (strm, m_opaque_sp.get());
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/API/SBWatchpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBWatchpoint.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/API/SBWatchpoint.cpp (original)
+++ lldb/trunk/source/API/SBWatchpoint.cpp Sun Nov 13 00:57:31 2011
@@ -229,15 +229,16 @@
 bool
 SBWatchpoint::GetDescription (SBStream &description, DescriptionLevel level)
 {
+    Stream &strm = description.ref();
+
     if (m_opaque_sp)
     {
         Mutex::Locker api_locker (m_opaque_sp->GetTarget().GetAPIMutex());
-        description.ref();
-        m_opaque_sp->GetDescription (description.get(), level);
-        description.get()->EOL();
+        m_opaque_sp->GetDescription (&strm, level);
+        strm.EOL();
     }
     else
-        description.Printf ("No value");
+        strm.PutCString ("No value");
 
     return true;
 }

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Sun Nov 13 00:57:31 2011
@@ -2844,6 +2844,21 @@
             count = ClangASTContext::GetNumFields (ast, cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());
             break;
             
+        case clang::Type::ObjCObject:
+        case clang::Type::ObjCInterface:
+            if (GetCompleteQualType (ast, qual_type))
+            {
+                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(qual_type.getTypePtr());
+                if (objc_class_type)
+                {
+                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    
+                    if (class_interface_decl)
+                        count = class_interface_decl->ivar_size();
+                }
+            }
+            break;
+
         default:
             break;
     }
@@ -2854,7 +2869,7 @@
 ClangASTContext::GetDirectBaseClassAtIndex (clang::ASTContext *ast, 
                                             clang_type_t clang_type,
                                             uint32_t idx, 
-                                            uint32_t *byte_offset_ptr)
+                                            uint32_t *bit_offset_ptr)
 {
     if (clang_type == NULL)
         return 0;
@@ -2877,14 +2892,14 @@
                     {
                         if (curr_idx == idx)
                         {
-                            if (byte_offset_ptr)
+                            if (bit_offset_ptr)
                             {
                                 const ASTRecordLayout &record_layout = ast->getASTRecordLayout(cxx_record_decl);
                                 const CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
 //                                if (base_class->isVirtual())
-//                                    *byte_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
+//                                    *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
 //                                else
-                                    *byte_offset_ptr = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8;
+                                    *bit_offset_ptr = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8;
                             }
                             return base_class->getType().getAsOpaquePtr();
                         }
@@ -2907,8 +2922,8 @@
                         ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
                         if (superclass_interface_decl)
                         {
-                            if (byte_offset_ptr)
-                                *byte_offset_ptr = 0;
+                            if (bit_offset_ptr)
+                                *bit_offset_ptr = 0;
                             return ast->getObjCInterfaceType(superclass_interface_decl).getAsOpaquePtr();
                         }
                     }
@@ -2921,13 +2936,13 @@
             return ClangASTContext::GetDirectBaseClassAtIndex (ast, 
                                                                cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
                                                                idx,
-                                                               byte_offset_ptr);
+                                                               bit_offset_ptr);
             
         case clang::Type::Elaborated:
             return  ClangASTContext::GetDirectBaseClassAtIndex (ast, 
                                                                 cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
                                                                 idx,
-                                                                byte_offset_ptr);
+                                                                bit_offset_ptr);
             
         default:
             break;
@@ -2939,7 +2954,7 @@
 ClangASTContext::GetVirtualBaseClassAtIndex (clang::ASTContext *ast, 
                                              clang_type_t clang_type,
                                              uint32_t idx, 
-                                             uint32_t *byte_offset_ptr)
+                                             uint32_t *bit_offset_ptr)
 {
     if (clang_type == NULL)
         return 0;
@@ -2962,11 +2977,11 @@
                     {
                         if (curr_idx == idx)
                         {
-                            if (byte_offset_ptr)
+                            if (bit_offset_ptr)
                             {
                                 const ASTRecordLayout &record_layout = ast->getASTRecordLayout(cxx_record_decl);
                                 const CXXRecordDecl *base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
-                                *byte_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
+                                *bit_offset_ptr = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
 
                             }
                             return base_class->getType().getAsOpaquePtr();
@@ -2980,13 +2995,13 @@
             return ClangASTContext::GetVirtualBaseClassAtIndex (ast, 
                                                                 cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
                                                                 idx,
-                                                                byte_offset_ptr);
+                                                                bit_offset_ptr);
             
         case clang::Type::Elaborated:
             return  ClangASTContext::GetVirtualBaseClassAtIndex (ast, 
                                                                  cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
                                                                  idx,
-                                                                 byte_offset_ptr);
+                                                                 bit_offset_ptr);
             
         default:
             break;
@@ -2999,7 +3014,7 @@
                                   clang_type_t clang_type,
                                   uint32_t idx, 
                                   std::string& name,
-                                  uint32_t *byte_offset_ptr)
+                                  uint32_t *bit_offset_ptr)
 {
     if (clang_type == NULL)
         return 0;
@@ -3025,10 +3040,10 @@
                         
                         // Figure out the type byte size (field_type_info.first) and
                         // alignment (field_type_info.second) from the AST context.
-                        if (byte_offset_ptr)
+                        if (bit_offset_ptr)
                         {
                             const ASTRecordLayout &record_layout = ast->getASTRecordLayout(record_decl);
-                            *byte_offset_ptr = (record_layout.getFieldOffset (field_idx) + 7) / 8;
+                            *bit_offset_ptr = record_layout.getFieldOffset (field_idx);
                         }
                         
                         return field->getType().getAsOpaquePtr();
@@ -3064,10 +3079,10 @@
                                     
                                     name.assign(ivar_decl->getNameAsString());
 
-                                    if (byte_offset_ptr)
+                                    if (bit_offset_ptr)
                                     {
                                         const ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
-                                        *byte_offset_ptr = (interface_layout.getFieldOffset (ivar_idx) + 7)/8;
+                                        *bit_offset_ptr = interface_layout.getFieldOffset (ivar_idx);
                                     }
                                     
                                     return ivar_qual_type.getAsOpaquePtr();
@@ -3085,14 +3100,14 @@
                                                      cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
                                                      idx,
                                                      name,
-                                                     byte_offset_ptr);
+                                                     bit_offset_ptr);
             
         case clang::Type::Elaborated:
             return  ClangASTContext::GetFieldAtIndex (ast, 
                                                       cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
                                                       idx,
                                                       name,
-                                                      byte_offset_ptr);
+                                                      bit_offset_ptr);
             
         default:
             break;

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Sun Nov 13 00:57:31 2011
@@ -1272,46 +1272,64 @@
         llvm::SmallVector<char, 1024> buf;
         llvm::raw_svector_ostream llvm_ostrm (buf);
 
-        const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr());
-        if (tag_type)
+        const clang::Type::TypeClass type_class = qual_type->getTypeClass();
+        switch (type_class)
         {
-            clang::TagDecl *tag_decl = tag_type->getDecl();
-            if (tag_decl)
-                tag_decl->print(llvm_ostrm, 0);
-        }
-        else
-        {
-            const clang::Type::TypeClass type_class = qual_type->getTypeClass();
-            switch (type_class)
+        case clang::Type::ObjCObject:
+        case clang::Type::ObjCInterface:
+            if (ClangASTContext::GetCompleteType (ast_context, clang_type))
             {
-            case clang::Type::ObjCObject:
-            case clang::Type::ObjCInterface:
-                {
-                    const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
-                    assert (objc_class_type);
-                    if (objc_class_type)
-                    {
-                        clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
-                        if (class_interface_decl)
-                            class_interface_decl->print(llvm_ostrm, ast_context->getPrintingPolicy(), s->GetIndentLevel());
-                    }
+                const clang::ObjCObjectType *objc_class_type = llvm::dyn_cast<clang::ObjCObjectType>(qual_type.getTypePtr());
+                assert (objc_class_type);
+                if (objc_class_type)
+                {
+                    clang::ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+                    if (class_interface_decl)
+                        class_interface_decl->print(llvm_ostrm, ast_context->getPrintingPolicy(), s->GetIndentLevel());
                 }
-                break;
-            
-            case clang::Type::Typedef:
+            }
+            break;
+        
+        case clang::Type::Typedef:
+            {
+                const clang::TypedefType *typedef_type = qual_type->getAs<clang::TypedefType>();
+                if (typedef_type)
                 {
-                    const clang::TypedefType *typedef_type = qual_type->getAs<clang::TypedefType>();
-                    if (typedef_type)
+                    const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl();
+                    std::string clang_typedef_name (typedef_decl->getQualifiedNameAsString());
+                    if (!clang_typedef_name.empty())
                     {
-                        const clang::TypedefNameDecl *typedef_decl = typedef_type->getDecl();
-                        std::string clang_typedef_name (typedef_decl->getQualifiedNameAsString());
-                        if (!clang_typedef_name.empty())
-                            s->PutCString (clang_typedef_name.c_str());
+                        s->PutCString ("typedef ");
+                        s->PutCString (clang_typedef_name.c_str());
                     }
                 }
-                break;
+            }
+            break;
 
-            default:
+        case clang::Type::Record:
+            if (ClangASTContext::GetCompleteType (ast_context, clang_type))
+            {
+                const clang::RecordType *record_type = llvm::cast<clang::RecordType>(qual_type.getTypePtr());
+                const clang::RecordDecl *record_decl = record_type->getDecl();
+                const clang::CXXRecordDecl *cxx_record_decl = llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
+
+                if (cxx_record_decl)
+                    cxx_record_decl->print(llvm_ostrm, ast_context->getPrintingPolicy(), s->GetIndentLevel());
+                else
+                    record_decl->print(llvm_ostrm, ast_context->getPrintingPolicy(), s->GetIndentLevel());
+            }
+            break;
+
+        default:
+            {
+                const clang::TagType *tag_type = llvm::dyn_cast<clang::TagType>(qual_type.getTypePtr());
+                if (tag_type)
+                {
+                    clang::TagDecl *tag_decl = tag_type->getDecl();
+                    if (tag_decl)
+                        tag_decl->print(llvm_ostrm, 0);
+                }
+                else
                 {
                     std::string clang_type_name(qual_type.getAsString());
                     if (!clang_type_name.empty())

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=144493&r1=144492&r2=144493&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Sun Nov 13 00:57:31 2011
@@ -777,3 +777,21 @@
     
     return m_clang_ast_type.GetOpaqueQualType();
 }
+
+bool
+TypeImpl::GetDescription (lldb_private::Stream &strm, 
+                          lldb::DescriptionLevel description_level)
+{
+    if (m_clang_ast_type.IsValid())
+    {
+        ClangASTType::DumpTypeDescription (m_clang_ast_type.GetASTContext(), 
+                                           m_clang_ast_type.GetOpaqueQualType(), 
+                                           &strm);
+    }
+    else
+    {
+        strm.PutCString ("No value");
+    }
+    return true;
+}
+





More information about the lldb-commits mailing list