[Lldb-commits] [lldb] r117437 - in /lldb/trunk: include/lldb/API/ include/lldb/Core/ include/lldb/Symbol/ lldb.xcodeproj/ source/ source/API/ source/Core/ source/Expression/ source/Interpreter/ source/Plugins/DynamicLoader/MacOSX-DYLD/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/Process/MacOSX-User/source/ source/Plugins/Process/MacOSX-User/source/MacOSX/ source/Plugins/Process/gdb-remote/ source/Plugins/SymbolFile/DWARF/ source/Symbol/ source/Target/ tools/debugserver/debugserver.xcodeproj/

Greg Clayton gclayton at apple.com
Tue Oct 26 20:32:59 PDT 2010


Author: gclayton
Date: Tue Oct 26 22:32:59 2010
New Revision: 117437

URL: http://llvm.org/viewvc/llvm-project?rev=117437&view=rev
Log:
Updated the lldb_private::Flags class to have better method names and made
all of the calls inlined in the header file for better performance.

Fixed the summary for C string types (array of chars (with any combo if
modifiers), and pointers to chars) work in all cases.

Fixed an issue where a forward declaration to a clang type could cause itself
to resolve itself more than once if, during the resolving of the type itself
it caused something to try and resolve itself again. We now remove the clang
type from the forward declaration map in the DWARF parser when we start to 
resolve it and avoid this additional call. This should stop any duplicate
members from appearing and throwing all the alignment of structs, unions and
classes.


Removed:
    lldb/trunk/source/Core/Flags.cpp
Modified:
    lldb/trunk/include/lldb/API/SBValue.h
    lldb/trunk/include/lldb/Core/Flags.h
    lldb/trunk/include/lldb/Core/ValueObject.h
    lldb/trunk/include/lldb/Symbol/ClangASTContext.h
    lldb/trunk/lldb.xcodeproj/project.pbxproj
    lldb/trunk/source/API/SBValue.cpp
    lldb/trunk/source/Core/Log.cpp
    lldb/trunk/source/Core/Section.cpp
    lldb/trunk/source/Core/Stream.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Expression/ClangUserExpression.cpp
    lldb/trunk/source/Interpreter/CommandObject.cpp
    lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLDLog.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachTask.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachVMRegion.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp
    lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
    lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Symbol/ClangASTContext.cpp
    lldb/trunk/source/Symbol/Type.cpp
    lldb/trunk/source/Target/StackFrame.cpp
    lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
    lldb/trunk/source/lldb-log.cpp
    lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj

Modified: lldb/trunk/include/lldb/API/SBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBValue.h?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBValue.h (original)
+++ lldb/trunk/include/lldb/API/SBValue.h Tue Oct 26 22:32:59 2010
@@ -44,6 +44,9 @@
     const char *
     GetValue (const lldb::SBFrame &frame);
 
+    ValueType
+    GetValueType ();
+
     bool
     GetValueDidChange (const lldb::SBFrame &frame);
 

Modified: lldb/trunk/include/lldb/Core/Flags.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Flags.h?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Flags.h (original)
+++ lldb/trunk/include/lldb/Core/Flags.h Tue Oct 26 22:32:59 2010
@@ -19,38 +19,45 @@
 
 //----------------------------------------------------------------------
 /// @class Flags Flags.h "lldb/Core/Flags.h"
-/// @brief A class to manage flag bits.
+/// @brief A class to manage flags.
 ///
-/// The Flags class does bits.
+/// The Flags class managed flag bits and allows testing and 
+/// modification of individual or multiple flag bits.
 //----------------------------------------------------------------------
 class Flags
 {
 public:
     //----------------------------------------------------------------------
-    /// The value type for flag bits is a 32 bit unsigned integer type.
+    /// The value type for flags is a 32 bit unsigned integer type.
     //----------------------------------------------------------------------
     typedef uint32_t ValueType;
 
     //----------------------------------------------------------------------
     /// Construct with initial flag bit values.
     ///
-    /// Constructs this object with \a bits as the initial value for all
-    /// of the flag bits.
+    /// Constructs this object with \a mask as the initial value for all
+    /// of the flags.
     ///
-    /// @param[in] bits
-    ///     The initial value for all flag bits.
+    /// @param[in] mask
+    ///     The initial value for all flags.
     //----------------------------------------------------------------------
-    Flags (ValueType bits = 0);
+    Flags (ValueType flags = 0) :
+        m_flags (flags)
+    {
+    }
 
     //----------------------------------------------------------------------
     /// Copy constructor.
     ///
-    /// Construct and copy the flag bits from \a rhs.
+    /// Construct and copy the flags from \a rhs.
     ///
     /// @param[in] rhs
     ///     A const Flags object reference to copy.
     //----------------------------------------------------------------------
-    Flags (const Flags& rhs);
+    Flags (const Flags& rhs) :
+        m_flags(rhs.m_flags)
+    {
+    }
 
     //----------------------------------------------------------------------
     /// Destructor.
@@ -58,72 +65,150 @@
     /// The destructor is virtual in case this class is subclassed.
     //----------------------------------------------------------------------
     virtual
-    ~Flags ();
+    ~Flags ()
+    {
+    }
 
     //----------------------------------------------------------------------
-    /// Get accessor for all flag bits.
+    /// Get accessor for all flags.
     ///
     /// @return
-    ///     Returns all of the flag bits as a Flags::ValueType.
+    ///     Returns all of the flags as a Flags::ValueType.
     //----------------------------------------------------------------------
     ValueType
-    GetAllFlagBits () const;
+    Get () const
+    {
+        return m_flags;
+    }
 
+    //----------------------------------------------------------------------
+    /// Return the number of flags that can be represented in this 
+    /// object.
+    ///
+    /// @return
+    ///     The maximum number bits in this flag object.
+    //----------------------------------------------------------------------
     size_t
-    GetBitSize() const;
+    GetBitSize() const
+    {
+        return sizeof (ValueType) * 8;
+    }
 
     //----------------------------------------------------------------------
-    /// Set accessor for all flag bits.
+    /// Set accessor for all flags.
     ///
-    /// @param[in] bits
-    ///     The bits with which to replace all of the current flag bits.
+    /// @param[in] flags
+    ///     The bits with which to replace all of the current flags.
     //----------------------------------------------------------------------
     void
-    SetAllFlagBits (ValueType bits);
+    Reset (ValueType flags)
+    {
+        m_flags = flags;
+    }
 
     //----------------------------------------------------------------------
-    /// Clear one or more flag bits.
+    /// Clear one or more flags.
     ///
-    /// @param[in] bits
-    ///     A bitfield containing one or more flag bits.
+    /// @param[in] mask
+    ///     A bitfield containing one or more flags.
     ///
     /// @return
-    ///     The new flag bits after clearing all bits from \a bits.
+    ///     The new flags after clearing all bits from \a mask.
     //----------------------------------------------------------------------
     ValueType
-    Clear (ValueType bits);
+    Clear (ValueType mask = ~(ValueType)0)
+    {
+        m_flags &= ~mask;
+        return m_flags;
+    }
+
 
     //----------------------------------------------------------------------
-    /// Set one or more flag bits.
+    /// Set one or more flags by logical OR'ing \a mask with the current
+    /// flags.
     ///
-    /// @param[in] bits
-    ///     A bitfield containing one or more flag bits.
+    /// @param[in] mask
+    ///     A bitfield containing one or more flags.
     ///
     /// @return
-    ///     The new flag bits after setting all bits from \a bits.
+    ///     The new flags after setting all bits from \a mask.
     //----------------------------------------------------------------------
     ValueType
-    Set (ValueType bits);
+    Set (ValueType mask)
+    {
+        m_flags |= mask;
+        return m_flags;
+    }
+
 
     //----------------------------------------------------------------------
-    /// Test one or more flag bits.
+    /// Test if all bits in \a mask are 1 in the current flags
     ///
     /// @return
-    ///     \b true if \b any flag bits in \a bits are set, \b false
+    ///     \b true if all flags in \a mask are 1, \b false
     ///     otherwise.
     //----------------------------------------------------------------------
     bool
-    IsSet (ValueType bits) const;
+    AllSet (ValueType mask) const
+    {
+        return (m_flags & mask) == mask;
+    }
 
     //----------------------------------------------------------------------
-    /// Test one or more flag bits.
+    /// Test one or more flags.
     ///
     /// @return
-    ///     \b true if \b all flag bits in \a bits are clear, \b false
+    ///     \b true if any flags in \a mask are 1, \b false
     ///     otherwise.
     //----------------------------------------------------------------------
     bool
-    IsClear (ValueType bits) const;
+    AnySet (ValueType mask) const
+    {
+        return (m_flags & mask) != 0;
+    }
+
+    //----------------------------------------------------------------------
+    /// Test a single flag bit.
+    ///
+    /// @return
+    ///     \b true if \a bit is set, \b false otherwise.
+    //----------------------------------------------------------------------
+    bool
+    Test (ValueType bit) const
+    {
+        return (m_flags & bit) != 0;
+    }
+    
+    //----------------------------------------------------------------------
+    /// Test if all bits in \a mask are clear.
+    ///
+    /// @return
+    ///     \b true if \b all flags in \a mask are clear, \b false
+    ///     otherwise.
+    //----------------------------------------------------------------------
+    bool
+    AllClear (ValueType mask) const
+    {
+        return (m_flags & mask) == 0;
+    }
+
+    bool
+    AnyClear (ValueType mask) const
+    {
+        return (m_flags & mask) != mask;
+    }
+    
+    //----------------------------------------------------------------------
+    /// Test a single flag bit to see if it is clear (zero).
+    ///
+    /// @return
+    ///     \b true if \a bit is 0, \b false otherwise.
+    //----------------------------------------------------------------------
+    bool
+    IsClear (ValueType bit) const
+    {
+        return (m_flags & bit) == 0;
+    }
 
     //----------------------------------------------------------------------
     /// Get the number of zero bits in \a m_flags.
@@ -132,7 +217,16 @@
     ///     The number of bits that are set to 0 in the current flags.
     //----------------------------------------------------------------------
     size_t
-    ClearCount () const;
+    ClearCount () const
+    {
+        size_t count = 0;
+        for (ValueType shift = 0; shift < sizeof(ValueType)*8; ++shift)
+        {
+            if ((m_flags & (1u << shift)) == 0)
+                ++count;
+        }
+        return count;
+    }
 
     //----------------------------------------------------------------------
     /// Get the number of one bits in \a m_flags.
@@ -141,10 +235,19 @@
     ///     The number of bits that are set to 1 in the current flags.
     //----------------------------------------------------------------------
     size_t
-    SetCount () const;
+    SetCount () const
+    {
+        size_t count = 0;
+        for (ValueType mask = m_flags; mask; mask >>= 1)
+        {
+            if (mask & 1u)
+                ++count;
+        }
+        return count;
+    }
 
 protected:
-    ValueType   m_flags;    ///< The flag bits.
+    ValueType   m_flags;    ///< The flags.
 };
 
 } // namespace lldb_private

Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Tue Oct 26 22:32:59 2010
@@ -300,6 +300,10 @@
     lldb::addr_t
     GetPointerValue (lldb::AddressType &address_type, 
                      bool scalar_is_load_address);
+
+    lldb::addr_t
+    GetAddressOf (lldb::AddressType &address_type, 
+                  bool scalar_is_load_address);
 private:
     //------------------------------------------------------------------
     // For ValueObject only

Modified: lldb/trunk/include/lldb/Symbol/ClangASTContext.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTContext.h?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTContext.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTContext.h Tue Oct 26 22:32:59 2010
@@ -326,7 +326,9 @@
 
     // Returns a mask containing bits from the ClangASTContext::eTypeXXX enumerations
     static uint32_t
-    GetTypeInfoMask (lldb::clang_type_t clang_type);
+    GetTypeInfo (lldb::clang_type_t clang_type, 
+                     clang::ASTContext *ast_context,                // The AST for clang_type (can be NULL)
+                     lldb::clang_type_t *pointee_or_element_type);  // (can be NULL)
 
     static uint32_t
     GetNumChildren (lldb::clang_type_t clang_type,
@@ -564,6 +566,12 @@
     static bool
     IsObjCClassType (lldb::clang_type_t clang_type);
 
+    static bool
+    IsCharType (lldb::clang_type_t clang_type);
+
+    static size_t
+    GetArraySize (lldb::clang_type_t clang_type);
+
     //static bool
     //ConvertFloatValueToString (clang::ASTContext *ast_context, 
     //                           lldb::clang_type_t clang_type, 

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Oct 26 22:32:59 2010
@@ -127,7 +127,6 @@
 		26D5B09E11B07550009A862E /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7910F1B85900F91463 /* Event.cpp */; };
 		26D5B09F11B07550009A862E /* FileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7A10F1B85900F91463 /* FileSpec.cpp */; };
 		26D5B0A011B07550009A862E /* FileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */; };
-		26D5B0A111B07550009A862E /* Flags.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7C10F1B85900F91463 /* Flags.cpp */; };
 		26D5B0A211B07550009A862E /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7D10F1B85900F91463 /* Language.cpp */; };
 		26D5B0A311B07550009A862E /* Listener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7E10F1B85900F91463 /* Listener.cpp */; };
 		26D5B0A411B07550009A862E /* Log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7F10F1B85900F91463 /* Log.cpp */; };
@@ -812,7 +811,6 @@
 		26BC7E7910F1B85900F91463 /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Event.cpp; path = source/Core/Event.cpp; sourceTree = "<group>"; };
 		26BC7E7A10F1B85900F91463 /* FileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpec.cpp; path = source/Core/FileSpec.cpp; sourceTree = "<group>"; };
 		26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpecList.cpp; path = source/Core/FileSpecList.cpp; sourceTree = "<group>"; };
-		26BC7E7C10F1B85900F91463 /* Flags.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Flags.cpp; path = source/Core/Flags.cpp; sourceTree = "<group>"; };
 		26BC7E7D10F1B85900F91463 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Language.cpp; path = source/Core/Language.cpp; sourceTree = "<group>"; };
 		26BC7E7E10F1B85900F91463 /* Listener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Listener.cpp; path = source/Core/Listener.cpp; sourceTree = "<group>"; };
 		26BC7E7F10F1B85900F91463 /* Log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Log.cpp; path = source/Core/Log.cpp; sourceTree = "<group>"; };
@@ -1731,7 +1729,6 @@
 				26BC7D6310F1B77400F91463 /* FileSpecList.h */,
 				26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */,
 				26BC7D6410F1B77400F91463 /* Flags.h */,
-				26BC7E7C10F1B85900F91463 /* Flags.cpp */,
 				9AA69DBB118A029E00D753A0 /* InputReader.h */,
 				9AA69DB5118A027A00D753A0 /* InputReader.cpp */,
 				26BC7D6510F1B77400F91463 /* IOStreamMacros.h */,
@@ -2680,7 +2677,6 @@
 				26D5B09E11B07550009A862E /* Event.cpp in Sources */,
 				26D5B09F11B07550009A862E /* FileSpec.cpp in Sources */,
 				26D5B0A011B07550009A862E /* FileSpecList.cpp in Sources */,
-				26D5B0A111B07550009A862E /* Flags.cpp in Sources */,
 				26D5B0A211B07550009A862E /* Language.cpp in Sources */,
 				26D5B0A311B07550009A862E /* Listener.cpp in Sources */,
 				26D5B0A411B07550009A862E /* Log.cpp in Sources */,

Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Tue Oct 26 22:32:59 2010
@@ -138,6 +138,14 @@
     return value_string;
 }
 
+ValueType
+SBValue::GetValueType ()
+{
+    if (m_opaque_sp)
+        return m_opaque_sp->GetValueType();
+    return eValueTypeInvalid;
+}
+
 const char *
 SBValue::GetObjectDescription (const SBFrame &frame)
 {

Removed: lldb/trunk/source/Core/Flags.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Flags.cpp?rev=117436&view=auto
==============================================================================
--- lldb/trunk/source/Core/Flags.cpp (original)
+++ lldb/trunk/source/Core/Flags.cpp (removed)
@@ -1,122 +0,0 @@
-//===-- Flags.cpp -----------------------------------------------*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/Core/Flags.h"
-
-using namespace lldb_private;
-
-//----------------------------------------------------------------------
-// Default Constructor
-//----------------------------------------------------------------------
-Flags::Flags (ValueType flags) :
-    m_flags(flags)
-{
-}
-
-//----------------------------------------------------------------------
-// Copy Constructor
-//----------------------------------------------------------------------
-Flags::Flags (const Flags& rhs) :
-    m_flags(rhs.m_flags)
-{
-}
-
-//----------------------------------------------------------------------
-// Virtual destructor in case anyone inherits from this class.
-//----------------------------------------------------------------------
-Flags::~Flags ()
-{
-}
-
-//----------------------------------------------------------------------
-// Get accessor for all of the current flag bits.
-//----------------------------------------------------------------------
-Flags::ValueType
-Flags::GetAllFlagBits () const
-{
-    return m_flags;
-}
-
-size_t
-Flags::GetBitSize() const
-{
-    return sizeof (ValueType) * 8;
-}
-
-//----------------------------------------------------------------------
-// Set accessor for all of the current flag bits.
-//----------------------------------------------------------------------
-void
-Flags::SetAllFlagBits (ValueType flags)
-{
-    m_flags = flags;
-}
-
-//----------------------------------------------------------------------
-// Clear one or more bits in our flag bits
-//----------------------------------------------------------------------
-Flags::ValueType
-Flags::Clear (ValueType bits)
-{
-    m_flags &= ~bits;
-    return m_flags;
-}
-
-//----------------------------------------------------------------------
-// Set one or more bits in our flag bits
-//----------------------------------------------------------------------
-Flags::ValueType
-Flags::Set (ValueType bits)
-{
-    m_flags |= bits;
-    return m_flags;
-}
-
-//----------------------------------------------------------------------
-// Returns true if any flag bits in "bits" are set
-//----------------------------------------------------------------------
-bool
-Flags::IsSet (ValueType bits) const
-{
-    return (m_flags & bits) != 0;
-}
-
-//----------------------------------------------------------------------
-// Returns true if all flag bits in "bits" are clear
-//----------------------------------------------------------------------
-bool
-Flags::IsClear (ValueType bits) const
-{
-    return (m_flags & bits) == 0;
-}
-
-
-size_t
-Flags::SetCount () const
-{
-    size_t count = 0;
-    for (ValueType mask = m_flags; mask; mask >>= 1)
-    {
-        if (mask & 1)
-            ++count;
-    }
-    return count;
-}
-
-size_t
-Flags::ClearCount () const
-{
-    size_t count = 0;
-    for (ValueType shift = 0; shift < sizeof(ValueType)*8; ++shift)
-    {
-        if ((m_flags & (1u << shift)) == 0)
-            ++count;
-    }
-    return count;
-}

Modified: lldb/trunk/source/Core/Log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Log.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Core/Log.cpp (original)
+++ lldb/trunk/source/Core/Log.cpp Tue Oct 26 22:32:59 2010
@@ -91,29 +91,27 @@
 
         Mutex::Locker locker;
 
-        uint32_t log_options = m_options.GetAllFlagBits();
-
         // Lock the threaded logging mutex if we are doing thread safe logging
-        if (log_options & LLDB_LOG_OPTION_THREADSAFE)
+        if (m_options.Test (LLDB_LOG_OPTION_THREADSAFE))
             locker.Reset(g_LogThreadedMutex.GetMutex());
 
         // Add a sequence ID if requested
-        if (log_options & LLDB_LOG_OPTION_PREPEND_SEQUENCE)
+        if (m_options.Test (LLDB_LOG_OPTION_PREPEND_SEQUENCE))
             header.Printf ("%u ", ++g_sequence_id);
 
         // Timestamp if requested
-        if (log_options & LLDB_LOG_OPTION_PREPEND_TIMESTAMP)
+        if (m_options.Test (LLDB_LOG_OPTION_PREPEND_TIMESTAMP))
         {
             struct timeval tv = TimeValue::Now().GetAsTimeVal();
             header.Printf ("%9llu.%6.6llu ", tv.tv_sec, tv.tv_usec);
         }
 
         // Add the process and thread if requested
-        if (log_options & LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD)
+        if (m_options.Test (LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD))
             header.Printf ("[%4.4x/%4.4x]: ", getpid(), Host::GetCurrentThreadID());
 
         // Add the process and thread if requested
-        if (log_options & LLDB_LOG_OPTION_PREPEND_THREAD_NAME)
+        if (m_options.Test (LLDB_LOG_OPTION_PREPEND_THREAD_NAME))
         {
             const char *thread_name_str = Host::GetThreadName (getpid(), Host::GetCurrentThreadID());
             if (thread_name_str)
@@ -171,7 +169,7 @@
 void
 Log::Debug (const char *format, ...)
 {
-    if (GetOptions().IsSet(LLDB_LOG_OPTION_DEBUG))
+    if (GetOptions().Test(LLDB_LOG_OPTION_DEBUG))
     {
         va_list args;
         va_start (args, format);
@@ -188,7 +186,7 @@
 void
 Log::DebugVerbose (const char *format, ...)
 {
-    if (GetOptions().IsSet(LLDB_LOG_OPTION_DEBUG) && GetOptions().IsSet(LLDB_LOG_OPTION_VERBOSE))
+    if (GetOptions().AllSet (LLDB_LOG_OPTION_DEBUG | LLDB_LOG_OPTION_VERBOSE))
     {
         va_list args;
         va_start (args, format);
@@ -204,7 +202,7 @@
 void
 Log::LogIf (uint32_t bits, const char *format, ...)
 {
-    if ((bits & m_options.GetAllFlagBits()) == bits)
+    if (m_options.AllSet (bits))
     {
         va_list args;
         va_start (args, format);
@@ -262,7 +260,7 @@
 void
 Log::Verbose (const char *format, ...)
 {
-    if (m_options.IsSet(LLDB_LOG_OPTION_VERBOSE))
+    if (m_options.Test(LLDB_LOG_OPTION_VERBOSE))
     {
         va_list args;
         va_start (args, format);
@@ -278,7 +276,7 @@
 void
 Log::WarningVerbose (const char *format, ...)
 {
-    if (m_options.IsSet(LLDB_LOG_OPTION_VERBOSE))
+    if (m_options.Test(LLDB_LOG_OPTION_VERBOSE))
     {
         char *arg_msg = NULL;
         va_list args;

Modified: lldb/trunk/source/Core/Section.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Section.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Core/Section.cpp (original)
+++ lldb/trunk/source/Core/Section.cpp Tue Oct 26 22:32:59 2010
@@ -248,7 +248,7 @@
         range.Dump (s, 0);
     }
 
-    s->Printf("%c 0x%8.8llx 0x%8.8llx 0x%8.8x ", resolved ? ' ' : '*', m_file_offset, m_file_size, GetAllFlagBits());
+    s->Printf("%c 0x%8.8llx 0x%8.8llx 0x%8.8x ", resolved ? ' ' : '*', m_file_offset, m_file_size, Get());
 
     DumpName (s);
 

Modified: lldb/trunk/source/Core/Stream.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Stream.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Core/Stream.cpp (original)
+++ lldb/trunk/source/Core/Stream.cpp Tue Oct 26 22:32:59 2010
@@ -64,7 +64,7 @@
 Stream::PutSLEB128 (int64_t sval)
 {
     int bytes_written = 0;
-    if (m_flags.IsSet(eBinary))
+    if (m_flags.Test(eBinary))
     {
         bool more = true;
         while (more)
@@ -98,7 +98,7 @@
 Stream::PutULEB128 (uint64_t uval)
 {
     int bytes_written = 0;
-    if (m_flags.IsSet(eBinary))
+    if (m_flags.Test(eBinary))
     {
         do
         {
@@ -129,7 +129,7 @@
 {
     int cstr_len = strlen(cstr);
     // when in binary mode, emit the NULL terminator
-    if (m_flags.IsSet(eBinary))
+    if (m_flags.Test(eBinary))
         ++cstr_len;
     return Write (cstr, cstr_len);
 }
@@ -212,7 +212,7 @@
     {
         va_end (args);
         // Include the NULL termination byte for binary output
-        if (m_flags.IsSet(eBinary))
+        if (m_flags.Test(eBinary))
             length += 1;
         // The formatted string fit into our stack based buffer, so we can just
         // append that to our packet
@@ -227,7 +227,7 @@
         if (str_ptr)
         {
             // Include the NULL termination byte for binary output
-            if (m_flags.IsSet(eBinary))
+            if (m_flags.Test(eBinary))
                 length += 1;
             bytes_written = Write (str_ptr, length);
             ::free (str_ptr);
@@ -429,7 +429,7 @@
 bool
 Stream::GetVerbose() const
 {
-    return m_flags.IsSet(eVerbose);
+    return m_flags.Test(eVerbose);
 }
 
 //------------------------------------------------------------------
@@ -438,7 +438,7 @@
 bool
 Stream::GetDebug() const
 {
-    return m_flags.IsSet(eDebug);
+    return m_flags.Test(eDebug);
 }
 
 //------------------------------------------------------------------
@@ -512,7 +512,7 @@
 {
     int bytes_written = 0;
     for (size_t i=0; i<n; ++i)
-        bytes_written += _PutHex8 (uvalue, m_flags.IsSet(eAddPrefix));
+        bytes_written += _PutHex8 (uvalue, m_flags.Test(eAddPrefix));
     return bytes_written;
 }
 
@@ -520,7 +520,7 @@
 Stream::_PutHex8 (uint8_t uvalue, bool add_prefix)
 {
     int bytes_written = 0;
-    if (m_flags.IsSet(eBinary))
+    if (m_flags.Test(eBinary))
     {
         bytes_written = Write (&uvalue, 1);
     }
@@ -541,7 +541,7 @@
 int
 Stream::PutHex8 (uint8_t uvalue)
 {
-    return _PutHex8 (uvalue, m_flags.IsSet(eAddPrefix));
+    return _PutHex8 (uvalue, m_flags.Test(eAddPrefix));
 }
 
 int
@@ -550,7 +550,7 @@
     if (byte_order == eByteOrderInvalid)
         byte_order = m_byte_order;
 
-    bool add_prefix = m_flags.IsSet(eAddPrefix);
+    bool add_prefix = m_flags.Test(eAddPrefix);
     int bytes_written = 0;
     if (byte_order == eByteOrderLittle)
     {
@@ -571,7 +571,7 @@
     if (byte_order == eByteOrderInvalid)
         byte_order = m_byte_order;
 
-    bool add_prefix = m_flags.IsSet(eAddPrefix);
+    bool add_prefix = m_flags.Test(eAddPrefix);
     int bytes_written = 0;
     if (byte_order == eByteOrderLittle)
     {
@@ -592,7 +592,7 @@
     if (byte_order == eByteOrderInvalid)
         byte_order = m_byte_order;
 
-    bool add_prefix = m_flags.IsSet(eAddPrefix);
+    bool add_prefix = m_flags.Test(eAddPrefix);
     int bytes_written = 0;
     if (byte_order == eByteOrderLittle)
     {
@@ -669,8 +669,9 @@
 
     int bytes_written = 0;
     const uint8_t *src = (const uint8_t *)s;
-    bool binary_is_clear = m_flags.IsClear (eBinary);
-    m_flags.Set (eBinary);
+    bool binary_was_set = m_flags.Test (eBinary);
+    if (!binary_was_set)
+        m_flags.Set (eBinary);
     if (src_byte_order == dst_byte_order)
     {
         for (size_t i = 0; i < src_len; ++i)
@@ -681,7 +682,7 @@
         for (size_t i = src_len-1; i < src_len; --i)
             bytes_written += _PutHex8 (src[i], false);
     }
-    if (binary_is_clear)
+    if (!binary_was_set)
         m_flags.Clear (eBinary);
 
     return bytes_written;
@@ -698,7 +699,7 @@
 
     int bytes_written = 0;
     const uint8_t *src = (const uint8_t *)s;
-    bool binary_is_set = m_flags.IsSet(eBinary);
+    bool binary_is_set = m_flags.Test(eBinary);
     m_flags.Clear(eBinary);
     if (src_byte_order == dst_byte_order)
     {
@@ -720,7 +721,7 @@
 Stream::PutCStringAsRawHex8 (const char *s)
 {
     int bytes_written = 0;
-    bool binary_is_set = m_flags.IsSet(eBinary);
+    bool binary_is_set = m_flags.Test(eBinary);
     m_flags.Clear(eBinary);
     do
     {

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Tue Oct 26 22:32:59 2010
@@ -358,8 +358,8 @@
     bool child_is_base_class = false;
     const bool transparent_pointers = synthetic_array_member == false;
     clang::ASTContext *clang_ast = GetClangAST();
-    void *clang_type = GetClangType();
-    void *child_clang_type;
+    clang_type_t clang_type = GetClangType();
+    clang_type_t child_clang_type;
     child_clang_type = ClangASTContext::GetChildClangTypeAtIndex (clang_ast,
                                                                   GetName().AsCString(),
                                                                   clang_type,
@@ -401,22 +401,38 @@
     {
         if (m_summary_str.empty())
         {
-            void *clang_type = GetClangType();
+            clang_type_t clang_type = GetClangType();
 
             // See if this is a pointer to a C string?
-            uint32_t fixed_length = 0;
             if (clang_type)
             {
                 StreamString sstr;
+                clang_type_t elem_or_pointee_clang_type;
+                const Flags type_flags (ClangASTContext::GetTypeInfo (clang_type, 
+                                                                          GetClangAST(), 
+                                                                          &elem_or_pointee_clang_type));
 
-                if (ClangASTContext::IsCStringType (clang_type, fixed_length))
+                if (type_flags.AnySet (ClangASTContext::eTypeIsArray | ClangASTContext::eTypeIsPointer) &&
+                    ClangASTContext::IsCharType (elem_or_pointee_clang_type))
                 {
                     Process *process = exe_scope->CalculateProcess();
                     if (process != NULL)
                     {
+                        lldb::addr_t cstr_address = LLDB_INVALID_ADDRESS;
                         lldb::AddressType cstr_address_type = eAddressTypeInvalid;
-                        lldb::addr_t cstr_address = GetPointerValue (cstr_address_type, true);
 
+                        size_t cstr_len = 0;
+                        if (type_flags.Test (ClangASTContext::eTypeIsArray))
+                        {
+                            // We have an array
+                            cstr_len = ClangASTContext::GetArraySize (clang_type);
+                            cstr_address = GetAddressOf (cstr_address_type, true);
+                        }
+                        else
+                        {
+                            // We have a pointer
+                            cstr_address = GetPointerValue (cstr_address_type, true);
+                        }
                         if (cstr_address != LLDB_INVALID_ADDRESS)
                         {
                             DataExtractor data;
@@ -425,14 +441,14 @@
                             std::vector<char> cstr_buffer;
                             size_t cstr_length;
                             Error error;
-                            if (fixed_length > 0)
+                            if (cstr_len > 0)
                             {
-                                data_buffer.resize(fixed_length);
+                                data_buffer.resize(cstr_len);
                                 // Resize the formatted buffer in case every character
                                 // uses the "\xXX" format and one extra byte for a NULL
                                 cstr_buffer.resize(data_buffer.size() * 4 + 1);
                                 data.SetData (&data_buffer.front(), data_buffer.size(), eByteOrderHost);
-                                bytes_read = process->ReadMemory (cstr_address, &data_buffer.front(), fixed_length, error);
+                                bytes_read = process->ReadMemory (cstr_address, &data_buffer.front(), cstr_len, error);
                                 if (bytes_read > 0)
                                 {
                                     sstr << '"';
@@ -590,7 +606,7 @@
                 case Value::eContextTypeDCType:
                 case Value::eContextTypeDCVariable:
                     {
-                        void *clang_type = GetClangType ();
+                        clang_type_t clang_type = GetClangType ();
                         if (clang_type)
                         {
                             StreamString sstr;
@@ -644,11 +660,37 @@
 }
 
 addr_t
+ValueObject::GetAddressOf (lldb::AddressType &address_type, bool scalar_is_load_address)
+{
+    switch (m_value.GetValueType())
+    {
+    case Value::eValueTypeScalar:
+        if (scalar_is_load_address)
+        {
+            address_type = eAddressTypeLoad;
+            return m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
+        }
+        break;
+
+    case Value::eValueTypeLoadAddress: 
+    case Value::eValueTypeFileAddress:
+    case Value::eValueTypeHostAddress:
+        {
+            address_type = m_value.GetValueAddressType ();
+            return m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
+        }
+        break;
+    }
+    address_type = eAddressTypeInvalid;
+    return LLDB_INVALID_ADDRESS;
+}
+
+addr_t
 ValueObject::GetPointerValue (lldb::AddressType &address_type, bool scalar_is_load_address)
 {
     lldb::addr_t address = LLDB_INVALID_ADDRESS;
     address_type = eAddressTypeInvalid;
-    switch (GetValue().GetValueType())
+    switch (m_value.GetValueType())
     {
     case Value::eValueTypeScalar:
         if (scalar_is_load_address)
@@ -773,7 +815,7 @@
 lldb::LanguageType
 ValueObject::GetObjectRuntimeLanguage ()
 {
-    void *opaque_qual_type = GetClangType();
+    clang_type_t opaque_qual_type = GetClangType();
     if (opaque_qual_type == NULL)
         return lldb::eLanguageTypeC;
     
@@ -825,6 +867,8 @@
     return ClangASTContext::IsPointerType (GetClangType());
 }
 
+
+
 bool
 ValueObject::IsPointerOrReferenceType ()
 {
@@ -909,7 +953,6 @@
     }
 }
 
-
 void
 ValueObject::DumpValueObject 
 (
@@ -929,13 +972,12 @@
 {
     if (valobj)
     {
-        //const char *loc_cstr = valobj->GetLocationAsCString();
         clang_type_t clang_type = valobj->GetClangType();
 
-        const Flags type_info_flags (ClangASTContext::GetTypeInfoMask (clang_type));
+        const Flags type_flags (ClangASTContext::GetTypeInfo (clang_type, NULL, NULL));
         const char *err_cstr = NULL;
-        const bool has_children = type_info_flags.IsSet (ClangASTContext::eTypeHasChildren);
-        const bool has_value = type_info_flags.IsSet (ClangASTContext::eTypeHasValue);
+        const bool has_children = type_flags.Test (ClangASTContext::eTypeHasChildren);
+        const bool has_value = type_flags.Test (ClangASTContext::eTypeHasValue);
         
         const bool print_valobj = flat_output == false || has_value;
         
@@ -983,6 +1025,7 @@
         }
         else
         {
+            const bool is_ref = type_flags.Test (ClangASTContext::eTypeIsReference);
             if (print_valobj)
             {
                 const char *sum_cstr = valobj->GetSummaryAsCString(exe_scope);
@@ -1006,9 +1049,39 @@
 
             if (curr_depth < max_depth)
             {
-                bool is_ptr_or_ref = type_info_flags.IsSet (ClangASTContext::eTypeIsPointer | ClangASTContext::eTypeIsReference);
+                // We will show children for all concrete types. We won't show
+                // pointer contents unless a pointer depth has been specified.
+                // We won't reference contents unless the reference is the 
+                // root object (depth of zero).
+                bool print_children = true;
+
+                // Use a new temporary pointer depth in case we override the
+                // current pointer depth below...
+                uint32_t curr_ptr_depth = ptr_depth;
+
+                const bool is_ptr = type_flags.Test (ClangASTContext::eTypeIsPointer);
+                if (is_ptr || is_ref)
+                {
+                    // We have a pointer or reference whose value is an address.
+                    // Make sure that address is not NULL
+                    lldb::AddressType ptr_address_type;
+                    if (valobj->GetPointerValue (ptr_address_type, true) == 0)
+                        print_children = false;
+
+                    else if (is_ref && curr_depth == 0)
+                    {
+                        // If this is the root object (depth is zero) that we are showing
+                        // and it is a reference, and no pointer depth has been supplied
+                        // print out what it references. Don't do this at deeper depths
+                        // otherwise we can end up with infinite recursion...
+                        curr_ptr_depth = 1;
+                    }
+                    
+                    if (curr_ptr_depth == 0)
+                        print_children = false;
+                }
                 
-                if (!is_ptr_or_ref || ptr_depth > 0)
+                if (print_children)
                 {
                     const uint32_t num_children = valobj->GetNumChildren();
                     if (num_children)
@@ -1034,7 +1107,7 @@
                                                  exe_scope,
                                                  child_sp.get(),
                                                  NULL,
-                                                 is_ptr_or_ref ? ptr_depth - 1 : ptr_depth,
+                                                 (is_ptr || is_ref) ? curr_ptr_depth - 1 : curr_ptr_depth,
                                                  curr_depth + 1,
                                                  max_depth,
                                                  show_types,
@@ -1055,7 +1128,7 @@
                     {
                         // Aggregate, no children...
                         if (print_valobj)
-                            s.PutCString("{}\n");
+                            s.PutCString(" {}\n");
                     }
                     else
                     {
@@ -1066,8 +1139,6 @@
                 }
                 else
                 {  
-                    // We printed a pointer, but we are stopping and not printing
-                    // and children of this pointer...
                     s.EOL();
                 }
             }

Modified: lldb/trunk/source/Expression/ClangUserExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangUserExpression.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangUserExpression.cpp (original)
+++ lldb/trunk/source/Expression/ClangUserExpression.cpp Tue Oct 26 22:32:59 2010
@@ -125,11 +125,12 @@
     //
     
     ApplyObjcCastHack(m_expr_text);
-    ApplyUnicharHack(m_expr_text);
+    //ApplyUnicharHack(m_expr_text);
 
     if (m_cplusplus)
     {
-        m_transformed_stream.Printf("void                                   \n"
+        m_transformed_stream.Printf("typedef unsigned short unichar;        \n"
+                                    "void                                   \n"
                                     "$__lldb_class::%s(void *$__lldb_arg)   \n"
                                     "{                                      \n"
                                     "    %s;                                \n" 
@@ -141,7 +142,8 @@
     }
     else
     {
-        m_transformed_stream.Printf("void                           \n"
+        m_transformed_stream.Printf("typedef unsigned short unichar;\n"
+                                    "void                           \n"
                                     "%s(void *$__lldb_arg)          \n"
                                     "{                              \n"
                                     "    %s;                        \n" 

Modified: lldb/trunk/source/Interpreter/CommandObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandObject.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandObject.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandObject.cpp Tue Oct 26 22:32:59 2010
@@ -220,7 +220,7 @@
     Process *process = m_interpreter.GetDebugger().GetExecutionContext().process;
     if (process == NULL)
     {
-        if (GetFlags().IsSet(CommandObject::eFlagProcessMustBeLaunched | CommandObject::eFlagProcessMustBePaused))
+        if (GetFlags().AnySet (CommandObject::eFlagProcessMustBeLaunched | CommandObject::eFlagProcessMustBePaused))
         {
             result.AppendError ("Process must exist.");
             result.SetStatus (eReturnStatusFailed);
@@ -244,7 +244,7 @@
         case eStateDetached:
         case eStateExited:
         case eStateUnloaded:
-            if (GetFlags().IsSet(CommandObject::eFlagProcessMustBeLaunched))
+            if (GetFlags().Test(CommandObject::eFlagProcessMustBeLaunched))
             {
                 result.AppendError ("Process must be launched.");
                 result.SetStatus (eReturnStatusFailed);
@@ -254,7 +254,7 @@
 
         case eStateRunning:
         case eStateStepping:
-            if (GetFlags().IsSet(CommandObject::eFlagProcessMustBePaused))
+            if (GetFlags().Test(CommandObject::eFlagProcessMustBePaused))
             {
                 result.AppendError ("Process is running.  Use 'process interrupt' to pause execution.");
                 result.SetStatus (eReturnStatusFailed);

Modified: lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLDLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLDLog.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLDLog.cpp (original)
+++ lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLDLog.cpp Tue Oct 26 22:32:59 2010
@@ -44,7 +44,7 @@
     Log *log = LogAccessor (true, NULL);
     if (log && mask)
     {
-        uint32_t log_mask = log->GetMask().GetAllFlagBits();
+        uint32_t log_mask = log->GetMask().Get();
         if ((log_mask & mask) != mask)
             return NULL;
     }

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Oct 26 22:32:59 2010
@@ -1049,7 +1049,7 @@
                                 }
                                 else
                                 {
-                                    uint32_t section_type = symbol_section->GetAllFlagBits() & SectionFlagMaskSectionType;
+                                    uint32_t section_type = symbol_section->Get() & SectionFlagMaskSectionType;
 
                                     switch (section_type)
                                     {

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachException.cpp Tue Oct 26 22:32:59 2010
@@ -367,7 +367,7 @@
         else
             err.Clear();
 
-        if (log && log->GetMask().IsSet(PD_LOG_EXCEPTIONS) || err.Fail())
+        if (log && log->GetMask().Test(PD_LOG_EXCEPTIONS) || err.Fail())
             err.PutToLog(log, "::ptrace (request = PT_THUPDATE, pid = %i, tid = 0x%4.4x, signal = %i)", state_pid, state.thread_port, signal);
     }
 
@@ -490,7 +490,7 @@
 MachException::PortInfo::Restore (task_t task)
 {
     Log *log = ProcessMacOSXLog::GetLogIfAllCategoriesSet (PD_LOG_EXCEPTIONS);
-    if (log && log->GetMask().IsSet(PD_LOG_VERBOSE))
+    if (log && log->GetMask().Test(PD_LOG_VERBOSE))
         log->Printf("MachException::PortInfo::Restore (task = 0x%4.4x)", task);
     uint32_t i = 0;
     Error err;

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachTask.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachTask.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachTask.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachTask.cpp Tue Oct 26 22:32:59 2010
@@ -163,7 +163,7 @@
         if (log)
         {
             log->Printf ("MachTask::ReadMemory ( addr = 0x%16.16llx, size = %zu, buf = %8.8p) => %u bytes read", (uint64_t)addr, size, buf, n);
-            if (log->GetMask().IsSet(PD_LOG_MEMORY_DATA_LONG) || (log->GetMask().IsSet(PD_LOG_MEMORY_DATA_SHORT) && size <= 8))
+            if (log->GetMask().Test(PD_LOG_MEMORY_DATA_LONG) || (log->GetMask().Test(PD_LOG_MEMORY_DATA_SHORT) && size <= 8))
             {
                 DataExtractor data((uint8_t*)buf, n, eByteOrderHost, 4);
                 data.PutToLog(log, 0, n, addr, 16, DataExtractor::TypeUInt8);
@@ -189,7 +189,7 @@
         if (log)
         {
             log->Printf ("MachTask::WriteMemory ( addr = 0x%16.16llx, size = %zu, buf = %8.8p) => %u bytes written", (uint64_t)addr, size, buf, n);
-            if (log->GetMask().IsSet(PD_LOG_MEMORY_DATA_LONG) || (log->GetMask().IsSet(PD_LOG_MEMORY_DATA_SHORT) && size <= 8))
+            if (log->GetMask().Test(PD_LOG_MEMORY_DATA_LONG) || (log->GetMask().Test(PD_LOG_MEMORY_DATA_SHORT) && size <= 8))
             {
                 DataExtractor data((uint8_t*)buf, n, eByteOrderHost, 4);
                 data.PutToLog(log, 0, n, addr, 16, DataExtractor::TypeUInt8);
@@ -329,7 +329,7 @@
     Log *log = ProcessMacOSXLog::GetLogIfAllCategoriesSet (PD_LOG_TASK);
     if (log || err.Fail())
         err.PutToLog(log, "::task_info ( target_task = 0x%4.4x, flavor = TASK_BASIC_INFO, task_info_out => %p, task_info_outCnt => %u )", task, info, count);
-    if (log && log->GetMask().IsSet(PD_LOG_VERBOSE) && err.Success())
+    if (log && log->GetMask().Test(PD_LOG_VERBOSE) && err.Success())
     {
         float user = (float)info->user_time.seconds + (float)info->user_time.microseconds / 1000000.0f;
         float system = (float)info->user_time.seconds + (float)info->user_time.microseconds / 1000000.0f;

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_i386.cpp Tue Oct 26 22:32:59 2010
@@ -142,7 +142,7 @@
 //              rflags.Clear(trace_bit);
 //      }
 //
-//      rflags_scalar = rflags.GetAllFlagBits();
+//      rflags_scalar = rflags.Get();
 //      // If the code makes it here we have changes to the GPRs which
 //      // we need to write back out, so lets do that.
 //        if (reg_ctx->WriteRegisterValue(m_flags_reg, rflags_scalar))

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachThreadContext_x86_64.cpp Tue Oct 26 22:32:59 2010
@@ -141,7 +141,7 @@
 //              rflags.Clear(trace_bit);
 //      }
 //
-//      rflags_scalar = rflags.GetAllFlagBits();
+//      rflags_scalar = rflags.Get();
 //      // If the code makes it here we have changes to the GPRs which
 //      // we need to write back out, so lets do that.
 //        if (reg_ctx->WriteRegisterValue(m_flags_reg, rflags_scalar))

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachVMRegion.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachVMRegion.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachVMRegion.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/MacOSX/MachVMRegion.cpp Tue Oct 26 22:32:59 2010
@@ -146,7 +146,7 @@
     }
     else
     {
-        if (log && log->GetMask().IsSet(PD_LOG_VERBOSE))
+        if (log && log->GetMask().Test(PD_LOG_VERBOSE))
         {
             log->Printf("info = { prot = %u, "
                         "max_prot = %u, "

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.cpp Tue Oct 26 22:32:59 2010
@@ -584,7 +584,7 @@
 {
     // locker will keep a mutex locked until it goes out of scope
     Log *log = ProcessMacOSXLog::GetLogIfAllCategoriesSet (PD_LOG_THREAD);
-    if (log && log->GetMask().IsSet(PD_LOG_VERBOSE))
+    if (log && log->GetMask().Test(PD_LOG_VERBOSE))
         log->Printf ("ProcessMacOSX::%s (pid = %4.4x)", __FUNCTION__, GetID());
 
     const uint32_t stop_id = GetStopID();

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSX.h Tue Oct 26 22:32:59 2010
@@ -417,7 +417,7 @@
     bool
     ProcessUsingSpringBoard() const
     {
-        return m_flags.IsSet(eFlagsUsingSBS);
+        return m_flags.Test (eFlagsUsingSBS);
     }
 
     lldb_private::ArchSpec&

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ProcessMacOSXLog.cpp Tue Oct 26 22:32:59 2010
@@ -27,7 +27,7 @@
     Log *log = g_log;
     if (log && mask)
     {
-        uint32_t log_mask = log->GetMask().GetAllFlagBits();
+        uint32_t log_mask = log->GetMask().Get();
         if ((log_mask & mask) != mask)
             return NULL;
     }
@@ -84,8 +84,8 @@
         }
         if (flag_bits == 0)
             flag_bits = PD_LOG_DEFAULT;
-        g_log->GetMask().SetAllFlagBits(flag_bits);
-        g_log->GetOptions().SetAllFlagBits(log_options);
+        g_log->GetMask().Reset(flag_bits);
+        g_log->GetOptions().Reset(log_options);
     }
     return g_log;
 }

Modified: lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-User/source/ThreadMacOSX.cpp Tue Oct 26 22:32:59 2010
@@ -249,7 +249,7 @@
 ThreadMacOSX::Suspend()
 {
     Log *log = ProcessMacOSXLog::GetLogIfAllCategoriesSet(PD_LOG_THREAD);
-    if (log && log->GetMask().IsSet(PD_LOG_VERBOSE))
+    if (log && log->GetMask().Test(PD_LOG_VERBOSE))
         log->Printf ("ThreadMacOSX::%s ( )", __FUNCTION__);
     lldb::tid_t tid = GetID ();
     if (ThreadIDIsValid(tid))
@@ -267,7 +267,7 @@
 ThreadMacOSX::Resume()
 {
     Log *log = ProcessMacOSXLog::GetLogIfAllCategoriesSet(PD_LOG_THREAD);
-    if (log && log->GetMask().IsSet(PD_LOG_VERBOSE))
+    if (log && log->GetMask().Test(PD_LOG_VERBOSE))
         log->Printf ("ThreadMacOSX::%s ()", __FUNCTION__);
     lldb::tid_t tid = GetID ();
     if (ThreadIDIsValid(tid))
@@ -288,7 +288,7 @@
 ThreadMacOSX::RestoreSuspendCount()
 {
     Log *log = ProcessMacOSXLog::GetLogIfAllCategoriesSet(PD_LOG_THREAD);
-    if (log && log->GetMask().IsSet(PD_LOG_VERBOSE))
+    if (log && log->GetMask().Test(PD_LOG_VERBOSE))
         log->Printf ("ThreadMacOSX::%s ( )", __FUNCTION__);
     Error err;
     lldb::tid_t tid = GetID ();

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp Tue Oct 26 22:32:59 2010
@@ -397,6 +397,9 @@
 bool
 GDBRemoteRegisterContext::WriteAllRegisterValues (const lldb::DataBufferSP &data_sp)
 {
+    if (!data_sp || data_sp->GetBytes() == NULL || data_sp->GetByteSize() == 0)
+        return false;
+
     GDBRemoteCommunication &gdb_comm = GetGDBProcess().GetGDBRemote();
     StringExtractorGDBRemote response;
     Mutex::Locker locker;

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Tue Oct 26 22:32:59 2010
@@ -949,7 +949,7 @@
 {
     // locker will keep a mutex locked until it goes out of scope
     Log *log = ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_THREAD);
-    if (log && log->GetMask().IsSet(GDBR_LOG_VERBOSE))
+    if (log && log->GetMask().Test(GDBR_LOG_VERBOSE))
         log->Printf ("ProcessGDBRemote::%s (pid = %i)", __FUNCTION__, GetID());
 
     Mutex::Locker locker (m_thread_list.GetMutex ());

Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemoteLog.cpp Tue Oct 26 22:32:59 2010
@@ -27,7 +27,7 @@
     Log *log = g_log;
     if (log && mask)
     {
-        uint32_t log_mask = log->GetMask().GetAllFlagBits();
+        uint32_t log_mask = log->GetMask().Get();
         if ((log_mask & mask) != mask)
             return NULL;
     }
@@ -84,8 +84,8 @@
         }
         if (flag_bits == 0)
             flag_bits = GDBR_LOG_DEFAULT;
-        g_log->GetMask().SetAllFlagBits(flag_bits);
-        g_log->GetOptions().SetAllFlagBits(log_options);
+        g_log->GetMask().Reset(flag_bits);
+        g_log->GetOptions().Reset(log_options);
     }
     return g_log;
 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Tue Oct 26 22:32:59 2010
@@ -908,7 +908,7 @@
     const DWARFCompileUnit* cu = cu_sp.get();
 
     Stream *s = dumpInfo->strm;
-    bool show_parents = s->GetFlags().IsSet(DWARFDebugInfo::eDumpFlag_ShowAncestors);
+    bool show_parents = s->GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowAncestors);
 
     if (die)
     {

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Tue Oct 26 22:32:59 2010
@@ -1098,7 +1098,7 @@
 {
     const DataExtractor& debug_info_data = dwarf2Data->get_debug_info_data();
     uint32_t offset = m_offset;
-    bool english    = s->GetFlags().IsSet (DWARFDebugInfo::eDumpFlag_EnglishyNames);
+    bool english    = s->GetFlags().Test (DWARFDebugInfo::eDumpFlag_EnglishyNames);
 
     if (debug_info_data.ValidOffset(offset))
     {
@@ -1171,8 +1171,8 @@
 )
 {
     bool verbose    = s->GetVerbose();
-    bool show_form  = s->GetFlags().IsSet(DWARFDebugInfo::eDumpFlag_ShowForm);
-    bool english    = s->GetFlags().IsSet(DWARFDebugInfo::eDumpFlag_EnglishyNames);
+    bool show_form  = s->GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm);
+    bool english    = s->GetFlags().Test(DWARFDebugInfo::eDumpFlag_EnglishyNames);
     const DataExtractor* debug_str_data = dwarf2Data ? &dwarf2Data->get_debug_str_data() : NULL;
     if (verbose)
         s->Offset(*offset_ptr);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/LogChannelDWARF.cpp Tue Oct 26 22:32:59 2010
@@ -156,8 +156,8 @@
     }
     if (flag_bits == 0)
         flag_bits = DWARF_LOG_DEFAULT;
-    m_log_sp->GetMask().SetAllFlagBits(flag_bits);
-    m_log_sp->GetOptions().SetAllFlagBits(log_options);
+    m_log_sp->GetMask().Reset(flag_bits);
+    m_log_sp->GetOptions().Reset(log_options);
     return m_log_sp.get() != NULL;
 }
 
@@ -187,8 +187,10 @@
 {
     Log *log = GetLog();
     if (log)
-        if (log->GetMask().IsSet(mask))
+    {
+        if (log->GetMask().AllSet(mask))
             return log;
+    }
     return NULL;
 }
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Oct 26 22:32:59 2010
@@ -1075,12 +1075,12 @@
                 if (num_attributes > 0)
                 {
                     Declaration decl;
-                    DWARFExpression location;
+                    //DWARFExpression location;
                     const char *name = NULL;
                     bool is_artificial = false;
                     lldb::user_id_t encoding_uid = LLDB_INVALID_UID;
                     AccessType accessibility = eAccessNone;
-                    off_t member_offset = 0;
+                    //off_t member_offset = 0;
                     size_t byte_size = 0;
                     size_t bit_offset = 0;
                     size_t bit_size = 0;
@@ -1102,18 +1102,18 @@
                             case DW_AT_bit_size:    bit_size = form_value.Unsigned(); break;
                             case DW_AT_byte_size:   byte_size = form_value.Unsigned(); break;
                             case DW_AT_data_member_location:
-                                if (form_value.BlockData())
-                                {
-                                    Value initialValue(0);
-                                    Value memberOffset(0);
-                                    const DataExtractor& debug_info_data = get_debug_info_data();
-                                    uint32_t block_length = form_value.Unsigned();
-                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
-                                    if (DWARFExpression::Evaluate(NULL, NULL, debug_info_data, NULL, NULL, block_offset, block_length, eRegisterKindDWARF, &initialValue, memberOffset, NULL))
-                                    {
-                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
-                                    }
-                                }
+//                                if (form_value.BlockData())
+//                                {
+//                                    Value initialValue(0);
+//                                    Value memberOffset(0);
+//                                    const DataExtractor& debug_info_data = get_debug_info_data();
+//                                    uint32_t block_length = form_value.Unsigned();
+//                                    uint32_t block_offset = form_value.BlockData() - debug_info_data.GetDataStart();
+//                                    if (DWARFExpression::Evaluate(NULL, NULL, debug_info_data, NULL, NULL, block_offset, block_length, eRegisterKindDWARF, &initialValue, memberOffset, NULL))
+//                                    {
+//                                        member_offset = memberOffset.ResolveValue(NULL, NULL).UInt();
+//                                    }
+//                                }
                                 break;
 
                             case DW_AT_accessibility: accessibility = DW_ACCESS_to_AccessType (form_value.Unsigned()); break;
@@ -1262,9 +1262,17 @@
 {
     // We have a struct/union/class/enum that needs to be fully resolved.
     const DWARFDebugInfoEntry* die = m_forward_decl_clang_type_to_die.lookup (ClangASTType::RemoveFastQualifiers(clang_type));
-    assert (die);
     if (die == NULL)
-        return NULL;
+    {
+        // We have already resolved this type...
+        return clang_type;
+    }
+    // Once we start resolving this type, remove it from the forward declaration
+    // map in case anyone child members or other types require this type to get resolved.
+    // The type will get resolved when all of the calls to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition
+    // are done.
+    m_forward_decl_clang_type_to_die.erase (ClangASTType::RemoveFastQualifiers(clang_type));
+    
 
     DWARFDebugInfo* debug_info = DebugInfo();
 

Modified: lldb/trunk/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTContext.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp Tue Oct 26 22:32:59 2010
@@ -31,6 +31,7 @@
 #undef NDEBUG
 
 #include "lldb/Core/dwarf.h"
+#include "lldb/Core/Flags.h"
 
 #include <stdio.h>
 
@@ -1652,10 +1653,18 @@
 
 
 uint32_t
-ClangASTContext::GetTypeInfoMask (clang_type_t clang_type)
+ClangASTContext::GetTypeInfo 
+(
+    clang_type_t clang_type, 
+    clang::ASTContext *ast_context, 
+    clang_type_t *pointee_or_element_clang_type
+)
 {
     if (clang_type == NULL)
-        return false;
+        return 0;
+        
+    if (pointee_or_element_clang_type)
+        *pointee_or_element_clang_type = NULL;
     
     QualType qual_type (QualType::getFromOpaquePtr(clang_type));
 
@@ -1665,51 +1674,87 @@
     case clang::Type::Builtin:
         switch (cast<clang::BuiltinType>(qual_type)->getKind())
         {
-        default:
-            break;
         case clang::BuiltinType::ObjCId:
         case clang::BuiltinType::ObjCClass:
-        case clang::BuiltinType::ObjCSel:
+            if (ast_context && pointee_or_element_clang_type)
+                *pointee_or_element_clang_type = ast_context->ObjCBuiltinClassTy.getAsOpaquePtr();
             return eTypeIsBuiltIn | eTypeIsPointer | eTypeHasValue;
+
+        default: 
+            break;
         }
         return eTypeIsBuiltIn | eTypeHasValue;
-    case clang::Type::BlockPointer:                     return eTypeIsPointer | eTypeHasChildren | eTypeIsBlock;
+
+    case clang::Type::BlockPointer:                     
+        if (pointee_or_element_clang_type)
+            *pointee_or_element_clang_type = qual_type->getPointeeType().getAsOpaquePtr();
+        return eTypeIsPointer | eTypeHasChildren | eTypeIsBlock;
+
     case clang::Type::Complex:                          return eTypeHasChildren | eTypeIsBuiltIn | eTypeHasValue;
-    case clang::Type::ConstantArray:                    return eTypeHasChildren | eTypeIsArray;
+
+    case clang::Type::ConstantArray:
+    case clang::Type::DependentSizedArray:
+    case clang::Type::IncompleteArray:
+    case clang::Type::VariableArray:                    
+        if (pointee_or_element_clang_type)
+            *pointee_or_element_clang_type = cast<ArrayType>(qual_type.getTypePtr())->getElementType().getAsOpaquePtr();
+        return eTypeHasChildren | eTypeIsArray;
+
     case clang::Type::DependentName:                    return 0;
-    case clang::Type::DependentSizedArray:              return eTypeHasChildren | eTypeIsArray;
     case clang::Type::DependentSizedExtVector:          return eTypeHasChildren | eTypeIsVector;
     case clang::Type::DependentTemplateSpecialization:  return eTypeIsTemplate;
     case clang::Type::Decltype:                         return 0;
-    case clang::Type::Enum:                             return eTypeIsEnumeration | eTypeHasValue;
+
+    case clang::Type::Enum:
+        if (pointee_or_element_clang_type)
+            *pointee_or_element_clang_type = cast<EnumType>(qual_type)->getDecl()->getIntegerType().getAsOpaquePtr();
+        return eTypeIsEnumeration | eTypeHasValue;
+
     case clang::Type::Elaborated:                       return 0;
     case clang::Type::ExtVector:                        return eTypeHasChildren | eTypeIsVector;
     case clang::Type::FunctionProto:                    return eTypeIsFuncPrototype | eTypeHasValue;
     case clang::Type::FunctionNoProto:                  return eTypeIsFuncPrototype | eTypeHasValue;
-    case clang::Type::IncompleteArray:                  return eTypeHasChildren | eTypeIsArray;
     case clang::Type::InjectedClassName:                return 0;
-    case clang::Type::LValueReference:                  return eTypeHasChildren | eTypeIsReference | eTypeHasValue;
+
+    case clang::Type::LValueReference:                  
+    case clang::Type::RValueReference:                  
+        if (pointee_or_element_clang_type)
+            *pointee_or_element_clang_type = cast<ReferenceType>(qual_type.getTypePtr())->getPointeeType().getAsOpaquePtr();
+        return eTypeHasChildren | eTypeIsReference | eTypeHasValue;
+
     case clang::Type::MemberPointer:                    return eTypeIsPointer   | eTypeIsMember | eTypeHasValue;
-    case clang::Type::ObjCObjectPointer:                return eTypeHasChildren | eTypeIsObjC | eTypeIsClass | eTypeIsPointer | eTypeHasValue;
+
+    case clang::Type::ObjCObjectPointer:
+        if (pointee_or_element_clang_type)
+            *pointee_or_element_clang_type = qual_type->getPointeeType().getAsOpaquePtr();
+        return eTypeHasChildren | eTypeIsObjC | eTypeIsClass | eTypeIsPointer | eTypeHasValue;
+
     case clang::Type::ObjCObject:                       return eTypeHasChildren | eTypeIsObjC | eTypeIsClass;
     case clang::Type::ObjCInterface:                    return eTypeHasChildren | eTypeIsObjC | eTypeIsClass;
-    case clang::Type::Pointer:                      	return eTypeHasChildren | eTypeIsPointer | eTypeHasValue;
+
+    case clang::Type::Pointer:                      	
+        if (pointee_or_element_clang_type)
+            *pointee_or_element_clang_type = qual_type->getPointeeType().getAsOpaquePtr();
+        return eTypeHasChildren | eTypeIsPointer | eTypeHasValue;
+
     case clang::Type::Record:
         if (qual_type->getAsCXXRecordDecl())
             return eTypeHasChildren | eTypeIsClass | eTypeIsCPlusPlus;
         else
             return eTypeHasChildren | eTypeIsStructUnion;
         break;
-    case clang::Type::RValueReference:                  return eTypeHasChildren | eTypeIsReference | eTypeHasValue;
     case clang::Type::SubstTemplateTypeParm:            return eTypeIsTemplate;
     case clang::Type::TemplateTypeParm:                 return eTypeIsTemplate;
     case clang::Type::TemplateSpecialization:           return eTypeIsTemplate;
-    case clang::Type::Typedef:                          return eTypeIsTypedef | 
-                                                               ClangASTContext::GetTypeInfoMask (cast<TypedefType>(qual_type)->LookThroughTypedefs().getAsOpaquePtr());
+
+    case clang::Type::Typedef:                         
+        return eTypeIsTypedef | ClangASTContext::GetTypeInfo (cast<TypedefType>(qual_type)->LookThroughTypedefs().getAsOpaquePtr(),
+                                                                  ast_context, 
+                                                                  pointee_or_element_clang_type);
+
     case clang::Type::TypeOfExpr:                       return 0;
     case clang::Type::TypeOf:                           return 0;
     case clang::Type::UnresolvedUsing:                  return 0;
-    case clang::Type::VariableArray:                    return eTypeHasChildren | eTypeIsArray;
     case clang::Type::Vector:                           return eTypeHasChildren | eTypeIsVector;
     default:                                            return 0;
     }
@@ -1767,10 +1812,10 @@
     case clang::Type::Builtin:
         switch (cast<clang::BuiltinType>(qual_type)->getKind())
         {
-        case clang::BuiltinType::ObjCId:    // Child is Class
+        case clang::BuiltinType::ObjCId:    // child is Class
         case clang::BuiltinType::ObjCClass: // child is Class
-        case clang::BuiltinType::ObjCSel:   // child is const char *
             num_children = 1;
+            break;
 
         default:
             break;
@@ -1880,6 +1925,22 @@
         }
         break;
 
+    case clang::Type::LValueReference:
+    case clang::Type::RValueReference:
+        {
+            ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
+            QualType pointee_type = reference_type->getPointeeType();
+            uint32_t num_pointee_children = ClangASTContext::GetNumChildren (pointee_type.getAsOpaquePtr(), 
+                                                                             omit_empty_base_classes);
+            // If this type points to a simple type, then it has 1 child
+            if (num_pointee_children == 0)
+                num_children = 1;
+            else
+                num_children = num_pointee_children;
+        }
+        break;
+
+
     case clang::Type::Typedef:
         num_children = ClangASTContext::GetNumChildren (cast<TypedefType>(qual_type)->LookThroughTypedefs().getAsOpaquePtr(), omit_empty_base_classes);
         break;
@@ -1963,15 +2024,6 @@
                 child_byte_size = ast_context->getTypeSize(ast_context->ObjCBuiltinClassTy) / CHAR_BIT;
                 return ast_context->ObjCBuiltinClassTy.getAsOpaquePtr();
                 
-            case clang::BuiltinType::ObjCSel:
-                {
-                    QualType char_type(ast_context->CharTy);
-                    char_type.addConst();
-                    child_byte_size = ast_context->getTypeSize(char_type);
-                    return char_type.getAsOpaquePtr();
-                }
-                break;
-
             default:
                 break;
             }
@@ -2247,6 +2299,48 @@
             }
             break;
 
+        case clang::Type::LValueReference:
+        case clang::Type::RValueReference:
+            {
+                ReferenceType *reference_type = cast<ReferenceType>(parent_qual_type.getTypePtr());
+                QualType pointee_type(reference_type->getPointeeType());
+                clang_type_t pointee_clang_type = pointee_type.getAsOpaquePtr();
+                if (transparent_pointers && ClangASTContext::IsAggregateType (pointee_clang_type))
+                {
+                    return GetChildClangTypeAtIndex (ast_context,
+                                                     parent_name,
+                                                     pointee_clang_type,
+                                                     idx,
+                                                     transparent_pointers,
+                                                     omit_empty_base_classes,
+                                                     child_name,
+                                                     child_byte_size,
+                                                     child_byte_offset,
+                                                     child_bitfield_bit_size,
+                                                     child_bitfield_bit_offset,
+                                                     child_is_base_class);
+                }
+                else
+                {
+                    if (parent_name)
+                    {
+                        child_name.assign(1, '&');
+                        child_name += parent_name;
+                    }
+
+                    // We have a pointer to an simple type
+                    if (idx == 0)
+                    {
+                        std::pair<uint64_t, unsigned> clang_type_info = ast_context->getTypeInfo(pointee_type);
+                        assert(clang_type_info.first % 8 == 0);
+                        child_byte_size = clang_type_info.first / 8;
+                        child_byte_offset = 0;
+                        return pointee_type.getAsOpaquePtr();
+                    }
+                }
+            }
+            break;
+
         case clang::Type::Typedef:
             return GetChildClangTypeAtIndex (ast_context,
                                              parent_name,
@@ -3379,7 +3473,6 @@
             break;
         case clang::BuiltinType::ObjCId:
         case clang::BuiltinType::ObjCClass:
-        case clang::BuiltinType::ObjCSel:
             return true;
         }
         return false;
@@ -3451,7 +3544,6 @@
                 break;
             case clang::BuiltinType::ObjCId:
             case clang::BuiltinType::ObjCClass:
-            case clang::BuiltinType::ObjCSel:
                 return true;
             }
             return false;
@@ -3564,67 +3656,43 @@
 }
 
 
-
+bool 
+ClangASTContext::IsCharType (clang_type_t clang_type)
+{
+    if (clang_type)
+        return QualType::getFromOpaquePtr(clang_type)->isCharType();
+    return false;
+}
 
 bool
 ClangASTContext::IsCStringType (clang_type_t clang_type, uint32_t &length)
 {
-    if (clang_type)
+    clang_type_t pointee_or_element_clang_type = NULL;
+    Flags type_flags (ClangASTContext::GetTypeInfo (clang_type, NULL, &pointee_or_element_clang_type));
+    
+    if (pointee_or_element_clang_type == NULL)
+        return false;
+
+    if (type_flags.AnySet (eTypeIsArray | eTypeIsPointer))
     {
-        QualType qual_type (QualType::getFromOpaquePtr(clang_type));
-        const clang::Type::TypeClass type_class = qual_type->getTypeClass();
-        switch (type_class)
+        QualType pointee_or_element_qual_type (QualType::getFromOpaquePtr (pointee_or_element_clang_type));
+        
+        if (pointee_or_element_qual_type.getUnqualifiedType()->isCharType())
         {
-        case clang::Type::ConstantArray:
+            QualType qual_type (QualType::getFromOpaquePtr(clang_type));
+            if (type_flags.Test (eTypeIsArray))
             {
-                ConstantArrayType *array = cast<ConstantArrayType>(qual_type.getTypePtr());
-                QualType element_qual_type = array->getElementType();
-                clang::Type *canonical_type = element_qual_type->getCanonicalTypeInternal().getTypePtr();
-                if (canonical_type && canonical_type->isCharType())
-                {
-                    // We know the size of the array and it could be a C string
-                    // since it is an array of characters
-                    length = array->getSize().getLimitedValue();
-                    return true;
-                }
+                // We know the size of the array and it could be a C string
+                // since it is an array of characters
+                length = cast<ConstantArrayType>(qual_type.getTypePtr())->getSize().getLimitedValue();
+                return true;
             }
-            break;
-
-        case clang::Type::Pointer:
+            else
             {
-                PointerType *pointer_type = cast<PointerType>(qual_type.getTypePtr());
-                clang::Type *pointee_type_ptr = pointer_type->getPointeeType().getTypePtr();
-                if (pointee_type_ptr)
-                {
-                    clang::Type *canonical_type_ptr = pointee_type_ptr->getCanonicalTypeInternal().getTypePtr();
-                    length = 0; // No length info, read until a NULL terminator is received
-                    if (canonical_type_ptr)
-                        return canonical_type_ptr->isCharType();
-                    else
-                        return pointee_type_ptr->isCharType();
-                }
+                length = 0;
+                return true;
             }
-            break;
 
-        case clang::Type::Typedef:
-            return ClangASTContext::IsCStringType (cast<TypedefType>(qual_type)->LookThroughTypedefs().getAsOpaquePtr(), length);
-
-        case clang::Type::LValueReference:
-        case clang::Type::RValueReference:
-            {
-                ReferenceType *reference_type = cast<ReferenceType>(qual_type.getTypePtr());
-                clang::Type *pointee_type_ptr = reference_type->getPointeeType().getTypePtr();
-                if (pointee_type_ptr)
-                {
-                    clang::Type *canonical_type_ptr = pointee_type_ptr->getCanonicalTypeInternal().getTypePtr();
-                    length = 0; // No length info, read until a NULL terminator is received
-                    if (canonical_type_ptr)
-                        return canonical_type_ptr->isCharType();
-                    else
-                        return pointee_type_ptr->isCharType();
-                }
-            }
-            break;
         }
     }
     return false;
@@ -3659,8 +3727,17 @@
     return false;
 }
 
-    
-
+size_t
+ClangASTContext::GetArraySize (clang_type_t clang_type)
+{
+    if (clang_type)
+    {
+        ConstantArrayType *array = cast<ConstantArrayType>(QualType::getFromOpaquePtr(clang_type).getTypePtr());
+        if (array)
+            return array->getSize().getLimitedValue();
+    }
+    return 0;
+}
 
 bool
 ClangASTContext::IsArrayType (clang_type_t clang_type, clang_type_t*member_type, uint64_t *size)

Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Tue Oct 26 22:32:59 2010
@@ -542,16 +542,16 @@
             if (encoding_type != NULL)
             {
                 bool forward_decl_is_ok_for_encoding = forward_decl_is_ok;
-                switch (m_encoding_uid_type)
-                {
-                case eEncodingIsPointerUID:
-                case eEncodingIsLValueReferenceUID:
-                case eEncodingIsRValueReferenceUID:
-                    forward_decl_is_ok_for_encoding = true;
-                    break;
-                default:
-                    break;
-                }
+//                switch (m_encoding_uid_type)
+//                {
+//                case eEncodingIsPointerUID:
+//                case eEncodingIsLValueReferenceUID:
+//                case eEncodingIsRValueReferenceUID:
+//                    forward_decl_is_ok_for_encoding = true;
+//                    break;
+//                default:
+//                    break;
+//                }
                 
                 if (encoding_type->ResolveClangType (forward_decl_is_ok_for_encoding))
                 {

Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Tue Oct 26 22:32:59 2010
@@ -239,7 +239,7 @@
     m_frame_code_addr.SetOffset(pc);
     m_frame_code_addr.SetSection(NULL);
     m_sc.Clear();
-    m_flags.SetAllFlagBits(0);
+    m_flags.Reset(0);
     m_thread.ClearStackFrames ();
 }
 
@@ -299,7 +299,7 @@
 StackFrame::GetSymbolContext (uint32_t resolve_scope)
 {
     // Copy our internal symbol context into "sc".
-    if ((m_flags.GetAllFlagBits() & resolve_scope) != resolve_scope)
+    if ((m_flags.Get() & resolve_scope) != resolve_scope)
     {
         // Resolve our PC to section offset if we haven't alreday done so
         // and if we don't have a module. The resolved address section will

Modified: lldb/trunk/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepInRange.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepInRange.cpp Tue Oct 26 22:32:59 2010
@@ -231,7 +231,7 @@
     StackFrame *frame = current_plan->GetThread().GetStackFrameAtIndex(0).get();
     Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP);
 
-    if (flags.IsSet(eAvoidNoDebug))
+    if (flags.Test(eAvoidNoDebug))
     {
         if (!frame->HasDebugInformation())
         {

Modified: lldb/trunk/source/lldb-log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb-log.cpp?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/source/lldb-log.cpp (original)
+++ lldb/trunk/source/lldb-log.cpp Tue Oct 26 22:32:59 2010
@@ -47,7 +47,7 @@
 {
     Log *log = LogAccessor (true, NULL);
     if (log)
-        return log->GetMask().GetAllFlagBits();
+        return log->GetMask().Get();
     return 0;
 }
 
@@ -64,7 +64,7 @@
     Log *log = LogAccessor (true, NULL);
     if (log && mask)
     {
-        uint32_t log_mask = log->GetMask().GetAllFlagBits();
+        uint32_t log_mask = log->GetMask().Get();
         if ((log_mask & mask) != mask)
             return NULL;
     }
@@ -101,7 +101,7 @@
 lldb_private::GetLogIfAnyCategoriesSet (uint32_t mask)
 {
     Log *log = LogAccessor (true, NULL);
-    if (log && mask && (mask & log->GetMask().GetAllFlagBits()))
+    if (log && mask && (mask & log->GetMask().Get()))
         return log;
     return NULL;
 }
@@ -121,7 +121,7 @@
     uint32_t flag_bits;
     Log* log = LogAccessor (true, NULL);
     if (log)
-        flag_bits = log->GetMask().GetAllFlagBits();
+        flag_bits = log->GetMask().Get();
     else
         flag_bits = 0;
 
@@ -166,8 +166,8 @@
             }
         }
 
-        log->GetMask().SetAllFlagBits(flag_bits);
-        log->GetOptions().SetAllFlagBits(log_options);
+        log->GetMask().Reset(flag_bits);
+        log->GetOptions().Reset(log_options);
     }
     return log;
 }

Modified: lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=117437&r1=117436&r2=117437&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Oct 26 22:32:59 2010
@@ -369,6 +369,7 @@
 			isa = PBXProject;
 			buildConfigurationList = 1DEB914E08733D8E0010E9CD /* Build configuration list for PBXProject "debugserver" */;
 			compatibilityVersion = "Xcode 3.1";
+			developmentRegion = English;
 			hasScannedForEncodings = 1;
 			knownRegions = (
 				English,





More information about the lldb-commits mailing list