[Lldb-commits] [lldb] r143114 - in /lldb/trunk: include/lldb/ include/lldb/Core/ include/lldb/Interpreter/ include/lldb/Symbol/ source/ source/Commands/ source/Core/ source/Interpreter/ source/Plugins/ObjectFile/Mach-O/ source/Plugins/SymbolFile/DWARF/ source/Symbol/ test/functionalities/data-formatter/data-formatter-advanced/

Greg Clayton gclayton at apple.com
Thu Oct 27 10:55:14 PDT 2011


Author: gclayton
Date: Thu Oct 27 12:55:14 2011
New Revision: 143114

URL: http://llvm.org/viewvc/llvm-project?rev=143114&view=rev
Log:
Added support for the new ".apple_objc" accelerator tables. These tables are
in the same hashed format as the ".apple_names", but they map objective C
class names to all of the methods and class functions. We need to do this 
because in the DWARF the methods for Objective C are never contained in the
class definition, they are scattered about at the translation unit level and
they don't even have attributes that say the are contained within the class
itself. 

Added 3 new formats which can be used to display data:

    eFormatAddressInfo
    eFormatHexFloat
    eFormatInstruction
    
eFormatAddressInfo describes an address such as function+offset and file+line,
or symbol + offset, or constant data (c string, 2, 4, 8, or 16 byte constants).
The format character for this is "A", the long format is "address".

eFormatHexFloat will print out the hex float format that compilers tend to use.
The format character for this is "X", the long format is "hex float".

eFormatInstruction will print out disassembly with bytes and it will use the
current target's architecture. The format character for this is "i" (which
used to be being used for the integer format, but the integer format also has
"d", so we gave the "i" format to disassembly), the long format is 
"instruction".

Mate the lldb::FormatterChoiceCriterion enumeration private as it should have
been from the start. It is very specialized and doesn't belong in the public 
API.


Modified:
    lldb/trunk/include/lldb/Core/DataExtractor.h
    lldb/trunk/include/lldb/Core/Disassembler.h
    lldb/trunk/include/lldb/Core/FormatNavigator.h
    lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h
    lldb/trunk/include/lldb/Symbol/ClangASTType.h
    lldb/trunk/include/lldb/lldb-enumerations.h
    lldb/trunk/include/lldb/lldb-private-enumerations.h
    lldb/trunk/source/Commands/CommandObjectExpression.cpp
    lldb/trunk/source/Commands/CommandObjectFrame.cpp
    lldb/trunk/source/Commands/CommandObjectMemory.cpp
    lldb/trunk/source/Commands/CommandObjectRegister.cpp
    lldb/trunk/source/Commands/CommandObjectTarget.cpp
    lldb/trunk/source/Core/DataExtractor.cpp
    lldb/trunk/source/Core/Disassembler.cpp
    lldb/trunk/source/Core/FormatManager.cpp
    lldb/trunk/source/Core/ValueObject.cpp
    lldb/trunk/source/Interpreter/OptionGroupFormat.cpp
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
    lldb/trunk/source/Symbol/ClangASTType.cpp
    lldb/trunk/source/Symbol/ObjectFile.cpp
    lldb/trunk/source/lldb.cpp
    lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py

Modified: lldb/trunk/include/lldb/Core/DataExtractor.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/DataExtractor.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/DataExtractor.h (original)
+++ lldb/trunk/include/lldb/Core/DataExtractor.h Thu Oct 27 12:55:14 2011
@@ -274,15 +274,16 @@
     ///     The offset at which dumping ended.
     //------------------------------------------------------------------
     uint32_t
-    Dump(Stream *s,
-         uint32_t offset,
-         lldb::Format item_format,
-         uint32_t item_byte_size,
-         uint32_t item_count,
-         uint32_t num_per_line,
-         uint64_t base_addr,
-         uint32_t item_bit_size,
-         uint32_t item_bit_offset) const;
+    Dump (Stream *s,
+          uint32_t offset,
+          lldb::Format item_format,
+          uint32_t item_byte_size,
+          uint32_t item_count,
+          uint32_t num_per_line,
+          uint64_t base_addr,
+          uint32_t item_bit_size,
+          uint32_t item_bit_offset,
+          ExecutionContextScope *exe_scope = NULL) const;
 
     //------------------------------------------------------------------
     /// Dump a UUID value at \a offset.

Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Thu Oct 27 12:55:14 2011
@@ -169,6 +169,12 @@
     void
     Append (lldb::InstructionSP &inst_sp);
 
+    void
+    Dump (Stream *s,
+          bool show_address,
+          bool show_bytes,
+          const ExecutionContext* exe_ctx);
+
 private:
     typedef std::vector<lldb::InstructionSP> collection;
     typedef collection::iterator iterator;
@@ -178,7 +184,7 @@
 };
 
 class PseudoInstruction : 
-    public lldb_private::Instruction
+    public Instruction
 {
 public:
 
@@ -188,11 +194,11 @@
      ~PseudoInstruction ();
      
     virtual void
-    Dump (lldb_private::Stream *s,
+    Dump (Stream *s,
           uint32_t max_opcode_byte_size,
           bool show_address,
           bool show_bytes,
-          const lldb_private::ExecutionContext* exe_ctx,
+          const ExecutionContext* exe_ctx,
           bool raw);
     
     virtual bool
@@ -217,8 +223,8 @@
     }
 
     virtual size_t
-    Decode (const lldb_private::Disassembler &disassembler,
-            const lldb_private::DataExtractor &data,
+    Decode (const Disassembler &disassembler,
+            const DataExtractor &data,
             uint32_t data_offset);
             
     void

Modified: lldb/trunk/include/lldb/Core/FormatNavigator.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/FormatNavigator.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/FormatNavigator.h (original)
+++ lldb/trunk/include/lldb/Core/FormatNavigator.h Thu Oct 27 12:55:14 2011
@@ -25,7 +25,6 @@
 
 // Project includes
 #include "lldb/lldb-public.h"
-#include "lldb/lldb-enumerations.h"
 
 #include "lldb/Core/FormatClasses.h"
 #include "lldb/Core/Log.h"
@@ -262,7 +261,7 @@
         lldb::DynamicValueType use_dynamic,
         uint32_t* why = NULL)
     {
-        uint32_t value = lldb::eFormatterChoiceCriterionDirectChoice;
+        uint32_t value = lldb_private::eFormatterChoiceCriterionDirectChoice;
         clang::QualType type = clang::QualType::getFromOpaquePtr(valobj.GetClangType());
         bool ret = Get(valobj, type, entry, use_dynamic, value);
         if (ret)
@@ -423,7 +422,7 @@
         }
         if (Get_ObjC(valobj, parent, entry, reason))
         {
-            reason |= lldb::eFormatterChoiceCriterionNavigatedBaseClasses;
+            reason |= lldb_private::eFormatterChoiceCriterionNavigatedBaseClasses;
             return true;
         }
         return false;
@@ -468,7 +467,7 @@
             }
             else
             {
-                reason |= lldb::eFormatterChoiceCriterionStrippedBitField;
+                reason |= lldb_private::eFormatterChoiceCriterionStrippedBitField;
                 if (log)
                     log->Printf("no bitfield direct match");
             }
@@ -493,7 +492,7 @@
                 log->Printf("stripping reference");
             if (Get(valobj,type.getNonReferenceType(),entry, use_dynamic, reason) && !entry->m_skip_references)
             {
-                reason |= lldb::eFormatterChoiceCriterionStrippedPointerReference;
+                reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;
                 return true;
             }
         }
@@ -514,7 +513,7 @@
             {
                 if (Get_ObjC(valobj, runtime->GetISA(valobj), entry, reason))
                 {
-                    reason |= lldb::eFormatterChoiceCriterionDynamicObjCHierarchy;
+                    reason |= lldb_private::eFormatterChoiceCriterionDynamicObjCHierarchy;
                     return true;
                 }
             }
@@ -535,7 +534,7 @@
             clang::QualType pointee = typePtr->getPointeeType();
             if (Get(valobj, pointee, entry, use_dynamic, reason) && !entry->m_skip_pointers)
             {
-                reason |= lldb::eFormatterChoiceCriterionStrippedPointerReference;
+                reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;
                 return true;
             }
         }
@@ -557,7 +556,7 @@
                 {
                     if (Get_ObjC(valobj, runtime->GetISA(valobj), entry, reason))
                     {
-                        reason |= lldb::eFormatterChoiceCriterionDynamicObjCHierarchy;
+                        reason |= lldb_private::eFormatterChoiceCriterionDynamicObjCHierarchy;
                         return true;
                     }
                 }
@@ -576,7 +575,7 @@
                 return false;
             if (Get(*target, typePtr->getPointeeType(), entry, use_dynamic, reason) && !entry->m_skip_pointers)
             {
-                reason |= lldb::eFormatterChoiceCriterionStrippedPointerReference;
+                reason |= lldb_private::eFormatterChoiceCriterionStrippedPointerReference;
                 return true;
             }
         }
@@ -601,7 +600,7 @@
                         clang::QualType ivar_qual_type(ast->getObjCInterfaceType(superclass_interface_decl));
                         if (Get(valobj, ivar_qual_type, entry, use_dynamic, reason) && entry->m_cascades)
                         {
-                            reason |= lldb::eFormatterChoiceCriterionNavigatedBaseClasses;
+                            reason |= lldb_private::eFormatterChoiceCriterionNavigatedBaseClasses;
                             return true;
                         }
                     }
@@ -630,7 +629,7 @@
                         {
                             if ((Get(valobj, pos->getType(), entry, use_dynamic, reason)) && entry->m_cascades)
                             {
-                                reason |= lldb::eFormatterChoiceCriterionNavigatedBaseClasses;
+                                reason |= lldb_private::eFormatterChoiceCriterionNavigatedBaseClasses;
                                 return true;
                             }
                         }
@@ -644,7 +643,7 @@
                         {
                             if ((Get(valobj, pos->getType(), entry, use_dynamic, reason)) && entry->m_cascades)
                             {
-                                reason |= lldb::eFormatterChoiceCriterionNavigatedBaseClasses;
+                                reason |= lldb_private::eFormatterChoiceCriterionNavigatedBaseClasses;
                                 return true;
                             }
                         }
@@ -660,7 +659,7 @@
                 log->Printf("stripping typedef");
             if ((Get(valobj, type_tdef->getDecl()->getUnderlyingType(), entry, use_dynamic, reason)) && entry->m_cascades)
             {
-                reason |= lldb::eFormatterChoiceCriterionNavigatedTypedefs;
+                reason |= lldb_private::eFormatterChoiceCriterionNavigatedTypedefs;
                 return true;
             }
         }

Modified: lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h (original)
+++ lldb/trunk/include/lldb/Interpreter/OptionGroupFormat.h Thu Oct 27 12:55:14 2011
@@ -26,9 +26,10 @@
 class OptionGroupFormat : public OptionGroup
 {
 public:
-    static const uint32_t OPTION_GROUP_FORMAT = LLDB_OPT_SET_1;
-    static const uint32_t OPTION_GROUP_SIZE   = LLDB_OPT_SET_2;
-    static const uint32_t OPTION_GROUP_COUNT  = LLDB_OPT_SET_3;
+    static const uint32_t OPTION_GROUP_FORMAT   = LLDB_OPT_SET_1;
+    static const uint32_t OPTION_GROUP_GDB_FMT  = LLDB_OPT_SET_2;
+    static const uint32_t OPTION_GROUP_SIZE     = LLDB_OPT_SET_3;
+    static const uint32_t OPTION_GROUP_COUNT    = LLDB_OPT_SET_4;
     
     OptionGroupFormat (lldb::Format default_format, 
                        uint64_t default_byte_size = UINT64_MAX,  // Pass UINT64_MAX to disable the "--size" option

Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Thu Oct 27 12:55:14 2011
@@ -148,7 +148,8 @@
                    uint32_t data_offset,
                    size_t data_byte_size,
                    uint32_t bitfield_bit_size,
-                   uint32_t bitfield_bit_offset);
+                   uint32_t bitfield_bit_offset,
+                   ExecutionContextScope *exe_scope);
     
     
     static bool
@@ -160,7 +161,8 @@
                    uint32_t data_offset,
                    size_t data_byte_size,
                    uint32_t bitfield_bit_size,
-                   uint32_t bitfield_bit_offset);
+                   uint32_t bitfield_bit_offset,
+                   ExecutionContextScope *exe_scope);
 
     void
     DumpSummary (ExecutionContext *exe_ctx,

Modified: lldb/trunk/include/lldb/lldb-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-enumerations.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-enumerations.h Thu Oct 27 12:55:14 2011
@@ -117,8 +117,11 @@
         eFormatVectorOfFloat32,
         eFormatVectorOfFloat64,
         eFormatVectorOfUInt128,
-        eFormatComplexInteger,   // Integer complex type
-        eFormatCharArray,       // Print characters with no single quotes, used for character arrays that can contain non printable characters
+        eFormatComplexInteger,      // Integer complex type
+        eFormatCharArray,           // Print characters with no single quotes, used for character arrays that can contain non printable characters
+        eFormatAddressInfo,         // Describe what an address points to (func + offset with file/line, symbol + offset, data, etc)
+        eFormatHexFloat,            // ISO C99 hex float string
+        eFormatInstruction,         // Disassemble an opcode
         kNumFormats
     } Format;
 
@@ -479,6 +482,7 @@
         eSectionTypeDWARFAppleNames,
         eSectionTypeDWARFAppleTypes,
         eSectionTypeDWARFAppleNamespaces,
+        eSectionTypeDWARFAppleObjC,
         eSectionTypeEHFrame,
         eSectionTypeOther
         
@@ -507,20 +511,6 @@
         eFunctionNameTypeSelector   = (1u << 5)     // Find function by selector name (ObjC) names
     } FunctionNameType;
     
-    //----------------------------------------------------------------------
-    // Ways that the FormatManager picks a particular format for a type
-    //----------------------------------------------------------------------
-    typedef enum FormatterChoiceCriterion
-    {
-        eFormatterChoiceCriterionDirectChoice =                  0x00000000,
-        eFormatterChoiceCriterionStrippedPointerReference =      0x00000001,
-        eFormatterChoiceCriterionNavigatedTypedefs =             0x00000002,
-        eFormatterChoiceCriterionNavigatedBaseClasses =          0x00000004,
-        eFormatterChoiceCriterionRegularExpressionSummary =      0x00000008,
-        eFormatterChoiceCriterionRegularExpressionFilter =       0x00000008,
-        eFormatterChoiceCriterionDynamicObjCHierarchy =          0x00000010,
-        eFormatterChoiceCriterionStrippedBitField =              0x00000020
-    } FormatterChoiceCriterion;
     
     //----------------------------------------------------------------------
     // Basic types enumeration for the public API SBType::GetBasicType()

Modified: lldb/trunk/include/lldb/lldb-private-enumerations.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-private-enumerations.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-private-enumerations.h (original)
+++ lldb/trunk/include/lldb/lldb-private-enumerations.h Thu Oct 27 12:55:14 2011
@@ -222,7 +222,22 @@
     eExecutionPolicyNever,
     eExecutionPolicyAlways
 } ExecutionPolicy;
-    
+
+//----------------------------------------------------------------------
+// Ways that the FormatManager picks a particular format for a type
+//----------------------------------------------------------------------
+typedef enum FormatterChoiceCriterion
+{
+    eFormatterChoiceCriterionDirectChoice =                  0x00000000,
+    eFormatterChoiceCriterionStrippedPointerReference =      0x00000001,
+    eFormatterChoiceCriterionNavigatedTypedefs =             0x00000002,
+    eFormatterChoiceCriterionNavigatedBaseClasses =          0x00000004,
+    eFormatterChoiceCriterionRegularExpressionSummary =      0x00000008,
+    eFormatterChoiceCriterionRegularExpressionFilter =       0x00000008,
+    eFormatterChoiceCriterionDynamicObjCHierarchy =          0x00000010,
+    eFormatterChoiceCriterionStrippedBitField =              0x00000020
+} FormatterChoiceCriterion;
+
 } // namespace lldb
 
 

Modified: lldb/trunk/source/Commands/CommandObjectExpression.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectExpression.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectExpression.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectExpression.cpp Thu Oct 27 12:55:14 2011
@@ -164,8 +164,8 @@
     // Push the data for the first argument into the m_arguments vector.
     m_arguments.push_back (arg);
     
-    // Add the "--format" and "--count" options to group 1 and 3
-    m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1);
+    // Add the "--format" and "--gdb-format"
+    m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1);
     m_option_group.Append (&m_command_options);
     m_option_group.Finalize();
 }

Modified: lldb/trunk/source/Commands/CommandObjectFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectFrame.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectFrame.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectFrame.cpp Thu Oct 27 12:55:14 2011
@@ -355,7 +355,7 @@
         m_arguments.push_back (arg);
         
         m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
-        m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1);
+        m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1);
         m_option_group.Append (&m_option_watchpoint, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Finalize();

Modified: lldb/trunk/source/Commands/CommandObjectMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectMemory.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectMemory.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectMemory.cpp Thu Oct 27 12:55:14 2011
@@ -136,7 +136,21 @@
                 
             case eFormatCString:
                 break;
-                
+
+            case eFormatInstruction:
+                if (count_option_set)
+                    byte_size_value = target->GetArchitecture().GetMaximumOpcodeByteSize() * format_options.GetCountValue().GetCurrentValue();
+                m_num_per_line = 1;
+                break;
+
+            case eFormatAddressInfo:
+                if (!byte_size_option_set)
+                    byte_size_value = target->GetArchitecture().GetAddressByteSize();
+                m_num_per_line = 1;
+                if (!count_option_set)
+                    format_options.GetCountValue() = 8;
+                break;
+
             case eFormatPointer:
                 byte_size_value = target->GetArchitecture().GetAddressByteSize();
                 if (!num_per_line_option_set)
@@ -153,6 +167,7 @@
             case eFormatUnicode16:
             case eFormatUnicode32:
             case eFormatUnsigned:
+            case eFormatHexFloat:
                 if (!byte_size_option_set)
                     byte_size_value = 4;
                 if (!num_per_line_option_set)
@@ -160,7 +175,7 @@
                 if (!count_option_set)
                     format_options.GetCountValue() = 8;
                 break;
-                
+            
             case eFormatBytes:
             case eFormatBytesWithASCII:
                 if (byte_size_option_set)
@@ -309,6 +324,9 @@
         m_option_group.Append (&m_format_options, 
                                OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_COUNT, 
                                LLDB_OPT_SET_1 | LLDB_OPT_SET_3);
+        m_option_group.Append (&m_format_options, 
+                               OptionGroupFormat::OPTION_GROUP_GDB_FMT, 
+                               LLDB_OPT_SET_1 | LLDB_OPT_SET_2 | LLDB_OPT_SET_3);
         // Add the "--size" option to group 1 and 2
         m_option_group.Append (&m_format_options, 
                                OptionGroupFormat::OPTION_GROUP_SIZE, 
@@ -653,6 +671,7 @@
         }
 
 
+        ExecutionContextScope *exe_scope = exe_ctx.GetBestExecutionContextScope();
         if (clang_ast_type.GetOpaqueQualType())
         {
             for (uint32_t i = 0; i<item_count; ++i)
@@ -661,7 +680,7 @@
                 Address address (NULL, item_addr);
                 StreamString name_strm;
                 name_strm.Printf ("0x%llx", item_addr);
-                ValueObjectSP valobj_sp (ValueObjectMemory::Create (exe_ctx.GetBestExecutionContextScope(), 
+                ValueObjectSP valobj_sp (ValueObjectMemory::Create (exe_scope, 
                                                                     name_strm.GetString().c_str(), 
                                                                     address, 
                                                                     clang_ast_type));
@@ -715,7 +734,8 @@
                    num_per_line,
                    addr,
                    0,
-                   0);
+                   0,
+                   exe_scope);
         output_stream->EOL();
         return true;
     }
@@ -1030,6 +1050,9 @@
             case eFormatVectorOfUInt128:
             case eFormatOSType:
             case eFormatComplexInteger:
+            case eFormatAddressInfo:
+            case eFormatHexFloat:
+            case eFormatInstruction:
                 result.AppendError("unsupported format for writing memory");
                 result.SetStatus(eReturnStatusFailed);
                 return false;

Modified: lldb/trunk/source/Commands/CommandObjectRegister.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectRegister.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectRegister.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectRegister.cpp Thu Oct 27 12:55:14 2011
@@ -62,7 +62,7 @@
         m_arguments.push_back (arg);
 
         // Add the "--format"
-        m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_ALL);
+        m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_ALL);
         m_option_group.Append (&m_command_options);
         m_option_group.Finalize();
 

Modified: lldb/trunk/source/Commands/CommandObjectTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectTarget.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectTarget.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectTarget.cpp Thu Oct 27 12:55:14 2011
@@ -525,7 +525,7 @@
         
         m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
         m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);
-        m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1);
+        m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1);
         m_option_group.Append (&m_option_compile_units, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);   
         m_option_group.Append (&m_option_shared_libraries, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1);   
         m_option_group.Finalize();

Modified: lldb/trunk/source/Core/DataExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/DataExtractor.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Core/DataExtractor.cpp (original)
+++ lldb/trunk/source/Core/DataExtractor.cpp Thu Oct 27 12:55:14 2011
@@ -13,6 +13,7 @@
 #include <bitset>
 #include <string>
 
+#include "llvm/ADT/APFloat.h"
 #include "llvm/ADT/APInt.h"
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/Support/MathExtras.h"
@@ -20,12 +21,16 @@
 #include "lldb/Core/DataBufferHeap.h"
 #include "lldb/Core/DataExtractor.h"
 #include "lldb/Core/DataBuffer.h"
+#include "lldb/Core/Disassembler.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamString.h"
 #include "lldb/Core/UUID.h"
 #include "lldb/Core/dwarf.h"
 #include "lldb/Host/Endian.h"
+#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Target/ExecutionContextScope.h"
+#include "lldb/Target/Target.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -1300,18 +1305,16 @@
 }
 
 uint32_t
-DataExtractor::Dump
-(
-    Stream *s,
-    uint32_t start_offset,
-    lldb::Format item_format,
-    uint32_t item_byte_size,
-    uint32_t item_count,
-    uint32_t num_per_line,
-    uint64_t base_addr,
-    uint32_t item_bit_size,     // If zero, this is not a bitfield value, if non-zero, the value is a bitfield
-    uint32_t item_bit_offset    // If "item_bit_size" is non-zero, this is the shift amount to apply to a bitfield
-) const
+DataExtractor::Dump (Stream *s,
+                     uint32_t start_offset,
+                     lldb::Format item_format,
+                     uint32_t item_byte_size,
+                     uint32_t item_count,
+                     uint32_t num_per_line,
+                     uint64_t base_addr,
+                     uint32_t item_bit_size,     // If zero, this is not a bitfield value, if non-zero, the value is a bitfield
+                     uint32_t item_bit_offset,    // If "item_bit_size" is non-zero, this is the shift amount to apply to a bitfield
+                     ExecutionContextScope *exe_scope) const
 {
     if (s == NULL)
         return start_offset;
@@ -1326,9 +1329,44 @@
             item_byte_size = s->GetAddressByteSize();
     }
     
-    if (item_format == eFormatOSType && item_byte_size > 8)
+    if (item_format == eFormatInstruction)
+    {
+        Target *target = NULL;
+        if (exe_scope)
+            target = exe_scope->CalculateTarget();
+        if (target)
+        {
+            DisassemblerSP disassembler_sp (Disassembler::FindPlugin(target->GetArchitecture(), NULL));
+            if (disassembler_sp)
+            {
+                lldb::addr_t addr = base_addr + start_offset;
+                lldb_private::Address so_addr;
+                if (!target->GetSectionLoadList().ResolveLoadAddress(addr, so_addr))
+                {
+                    so_addr.SetOffset(addr);
+                    so_addr.SetSection(NULL);
+                }
+
+                if (disassembler_sp->DecodeInstructions (so_addr, *this, start_offset, item_count, false))
+                {
+                    const bool show_address = base_addr != LLDB_INVALID_ADDRESS;
+                    const bool show_bytes = true;
+                    ExecutionContext exe_ctx;
+                    exe_scope->CalculateExecutionContext(exe_ctx);
+                    disassembler_sp->GetInstructionList().Dump (s,  show_address, show_bytes, &exe_ctx);
+                }
+            }
+        }
+        else
+            s->Printf ("invalid target");
+
+        return offset;
+    }
+
+    if ((item_format == eFormatOSType || item_format == eFormatAddressInfo) && item_byte_size > 8)
         item_format = eFormatHex;
 
+    
     for (offset = start_offset, line_start_offset = start_offset, count = 0; ValidOffset(offset) && count < item_count; ++count)
     {
         if ((count % num_per_line) == 0)
@@ -1624,6 +1662,51 @@
             s->Printf("0x%8.8x", GetU32 (&offset));
             break;
 
+        case eFormatAddressInfo:
+            {
+                addr_t addr = GetMaxU64Bitfield(&offset, item_byte_size, item_bit_size, item_bit_offset);
+                s->Printf("0x%*.*llx", 2 * item_byte_size, 2 * item_byte_size, addr);
+                if (exe_scope)
+                {
+                    Target *target = exe_scope->CalculateTarget();
+                    lldb_private::Address so_addr;
+                    if (target && target->GetSectionLoadList().ResolveLoadAddress(addr, so_addr))
+                    {
+                        s->PutChar(' ');
+                        so_addr.Dump (s, 
+                                      exe_scope, 
+                                      Address::DumpStyleResolvedDescription, 
+                                      Address::DumpStyleModuleWithFileAddress);
+                        break;
+                    }
+                }
+            }
+            break;
+
+        case eFormatHexFloat:
+            if (sizeof(float) == item_byte_size)
+            {
+                char float_cstr[256];
+                llvm::APFloat ap_float (GetFloat (&offset));
+                ap_float.convertToHexString (float_cstr, 0, false, llvm::APFloat::rmNearestTiesToEven);
+                s->Printf ("%s", float_cstr);
+                break;
+            }
+            else if (sizeof(double) == item_byte_size)
+            {
+                char float_cstr[256];
+                llvm::APFloat ap_float (GetDouble (&offset));
+                ap_float.convertToHexString (float_cstr, 0, false, llvm::APFloat::rmNearestTiesToEven);
+                s->Printf ("%s", float_cstr);
+                break;
+            }
+            else if (sizeof(long double) * 2 == item_byte_size)
+            {
+                s->Printf ("unsupported hex float byte size %u", item_byte_size);
+                return start_offset;
+            }
+            break;
+
 // please keep the single-item formats below in sync with FormatManager::GetSingleItemFormat
 // if you fail to do so, users will start getting different outputs depending on internal
 // implementation details they should not care about ||

Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Thu Oct 27 12:55:14 2011
@@ -834,6 +834,25 @@
 }
 
 void
+InstructionList::Dump (Stream *s,
+                       bool show_address,
+                       bool show_bytes,
+                       const ExecutionContext* exe_ctx)
+{
+    const uint32_t max_opcode_byte_size = GetMaxOpcocdeByteSize();
+    collection::const_iterator pos, begin, end;
+    for (begin = m_instructions.begin(), end = m_instructions.end(), pos = begin;
+         pos != end;
+         ++pos)
+    {
+        if (pos != begin)
+            s->EOL();
+        (*pos)->Dump(s, max_opcode_byte_size, show_address, show_bytes, exe_ctx, false);
+    }
+}
+
+
+void
 InstructionList::Clear()
 {
   m_instructions.clear();

Modified: lldb/trunk/source/Core/FormatManager.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/FormatManager.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Core/FormatManager.cpp (original)
+++ lldb/trunk/source/Core/FormatManager.cpp Thu Oct 27 12:55:14 2011
@@ -39,7 +39,7 @@
     { eFormatCharPrintable  , 'C'   , "printable character" },
     { eFormatComplexFloat   , 'F'   , "complex float"       },
     { eFormatCString        , 's'   , "c-string"            },
-    { eFormatDecimal        , 'i'   , "decimal"             },
+    { eFormatDecimal        , 'd'   , "decimal"             },
     { eFormatEnum           , 'E'   , "enumeration"         },
     { eFormatHex            , 'x'   , "hex"                 },
     { eFormatFloat          , 'f'   , "float"               },
@@ -62,7 +62,10 @@
     { eFormatVectorOfFloat64, '\0'  , "float64[]"           },
     { eFormatVectorOfUInt128, '\0'  , "uint128_t[]"         },
     { eFormatComplexInteger , 'I'   , "complex integer"     },
-    { eFormatCharArray      , 'a'   , "character array"     }
+    { eFormatCharArray      , 'a'   , "character array"     },
+    { eFormatAddressInfo    , 'A'   , "address"             },
+    { eFormatHexFloat       , 'X'   , "hex float"           },
+    { eFormatInstruction    , 'i'   , "instruction"         }
 };
 
 static uint32_t 
@@ -180,7 +183,7 @@
         return true;
     bool regex = GetRegexSummaryNavigator()->Get(valobj, entry, use_dynamic, reason);
     if (regex && reason)
-        *reason |= lldb::eFormatterChoiceCriterionRegularExpressionSummary;
+        *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionSummary;
     return regex;
 }
 
@@ -228,14 +231,14 @@
     if (pick_synth)
     {
         if (regex_synth && reason)
-            *reason |= lldb::eFormatterChoiceCriterionRegularExpressionFilter;
+            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;
         entry = synth;
         return true;
     }
     else
     {
         if (regex_filter && reason)
-            *reason |= lldb::eFormatterChoiceCriterionRegularExpressionFilter;
+            *reason |= lldb_private::eFormatterChoiceCriterionRegularExpressionFilter;
         entry = filter;
         return true;
     }

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Oct 27 12:55:14 2011
@@ -1048,7 +1048,8 @@
                                                              0,                        // Byte offset into "m_data"
                                                              GetByteSize(),            // Byte size of item in "m_data"
                                                              GetBitfieldBitSize(),     // Bitfield bit size
-                                                             GetBitfieldBitOffset()))  // Bitfield bit offset
+                                                             GetBitfieldBitOffset(),
+                                                             GetExecutionContextScope()))  // Bitfield bit offset
                                 m_value_str.swap(sstr.GetString());
                             else
                             {
@@ -1067,7 +1068,7 @@
                         if (reg_info)
                         {
                             StreamString reg_sstr;
-                            m_data.Dump(&reg_sstr, 0, reg_info->format, reg_info->byte_size, 1, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0);
+                            m_data.Dump(&reg_sstr, 0, reg_info->format, reg_info->byte_size, 1, UINT32_MAX, LLDB_INVALID_ADDRESS, 0, 0, GetExecutionContextScope());
                             m_value_str.swap(reg_sstr.GetString());
                         }
                     }

Modified: lldb/trunk/source/Interpreter/OptionGroupFormat.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/OptionGroupFormat.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/OptionGroupFormat.cpp (original)
+++ lldb/trunk/source/Interpreter/OptionGroupFormat.cpp Thu Oct 27 12:55:14 2011
@@ -37,11 +37,9 @@
 g_option_table[] =
 {
 { LLDB_OPT_SET_1, false, "format"    ,'f', required_argument, NULL, 0, eArgTypeFormat   , "Specify a format to be used for display."},
-{ LLDB_OPT_SET_1|
-  LLDB_OPT_SET_2|
-  LLDB_OPT_SET_3, false, "gdb-format",'G', required_argument, NULL, 0, eArgTypeGDBFormat, "Specify a format using a GDB format specifier string."},
-{ LLDB_OPT_SET_2, false, "size"      ,'s', required_argument, NULL, 0, eArgTypeByteSize , "The size in bytes to use when displaying with the selected format."},
-{ LLDB_OPT_SET_3, false, "count"     ,'c', required_argument, NULL, 0, eArgTypeCount    , "The number of total items to display."},
+{ LLDB_OPT_SET_2, false, "gdb-format",'G', required_argument, NULL, 0, eArgTypeGDBFormat, "Specify a format using a GDB format specifier string."},
+{ LLDB_OPT_SET_3, false, "size"      ,'s', required_argument, NULL, 0, eArgTypeByteSize , "The size in bytes to use when displaying with the selected format."},
+{ LLDB_OPT_SET_4, false, "count"     ,'c', required_argument, NULL, 0, eArgTypeCount    , "The number of total items to display."},
 };
 
 uint32_t

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=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Thu Oct 27 12:55:14 2011
@@ -233,32 +233,35 @@
                         return eAddressClassCode;
 
                     case eSectionTypeContainer:             return eAddressClassUnknown;
-                    case eSectionTypeData:                  return eAddressClassData;
-                    case eSectionTypeDataCString:           return eAddressClassData;
-                    case eSectionTypeDataCStringPointers:   return eAddressClassData;
-                    case eSectionTypeDataSymbolAddress:     return eAddressClassData;
-                    case eSectionTypeData4:                 return eAddressClassData;
-                    case eSectionTypeData8:                 return eAddressClassData;
-                    case eSectionTypeData16:                return eAddressClassData;
-                    case eSectionTypeDataPointers:          return eAddressClassData;
-                    case eSectionTypeZeroFill:              return eAddressClassData;
-                    case eSectionTypeDataObjCMessageRefs:   return eAddressClassData;
-                    case eSectionTypeDataObjCCFStrings:     return eAddressClassData;
-                    case eSectionTypeDebug:                 return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugAbbrev:      return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugAranges:     return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugFrame:       return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugInfo:        return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugLine:        return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugLoc:         return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugMacInfo:     return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugPubNames:    return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugPubTypes:    return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugRanges:      return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugStr:         return eAddressClassDebug;
-                    case eSectionTypeDWARFAppleNames:       return eAddressClassDebug;
-                    case eSectionTypeDWARFAppleTypes:       return eAddressClassDebug;
-                    case eSectionTypeDWARFAppleNamespaces:  return eAddressClassDebug;
+                    case eSectionTypeData:
+                    case eSectionTypeDataCString:
+                    case eSectionTypeDataCStringPointers:
+                    case eSectionTypeDataSymbolAddress:
+                    case eSectionTypeData4:
+                    case eSectionTypeData8:
+                    case eSectionTypeData16:
+                    case eSectionTypeDataPointers:
+                    case eSectionTypeZeroFill:
+                    case eSectionTypeDataObjCMessageRefs:
+                    case eSectionTypeDataObjCCFStrings:
+                        return eAddressClassData;
+                    case eSectionTypeDebug:
+                    case eSectionTypeDWARFDebugAbbrev:
+                    case eSectionTypeDWARFDebugAranges:
+                    case eSectionTypeDWARFDebugFrame:
+                    case eSectionTypeDWARFDebugInfo:
+                    case eSectionTypeDWARFDebugLine:
+                    case eSectionTypeDWARFDebugLoc:
+                    case eSectionTypeDWARFDebugMacInfo:
+                    case eSectionTypeDWARFDebugPubNames:
+                    case eSectionTypeDWARFDebugPubTypes:
+                    case eSectionTypeDWARFDebugRanges:
+                    case eSectionTypeDWARFDebugStr:
+                    case eSectionTypeDWARFAppleNames:
+                    case eSectionTypeDWARFAppleTypes:
+                    case eSectionTypeDWARFAppleNamespaces:
+                    case eSectionTypeDWARFAppleObjC:
+                        return eAddressClassDebug;
                     case eSectionTypeEHFrame:               return eAddressClassRuntime;
                     case eSectionTypeOther:                 return eAddressClassUnknown;
                     }
@@ -512,6 +515,7 @@
                         static ConstString g_sect_name_dwarf_apple_names ("__apple_names");
                         static ConstString g_sect_name_dwarf_apple_types ("__apple_types");
                         static ConstString g_sect_name_dwarf_apple_namespaces ("__apple_namespac");
+                        static ConstString g_sect_name_dwarf_apple_objc ("__apple_objc");
                         static ConstString g_sect_name_eh_frame ("__eh_frame");
                         static ConstString g_sect_name_DATA ("__DATA");
                         static ConstString g_sect_name_TEXT ("__TEXT");
@@ -546,6 +550,8 @@
                             sect_type = eSectionTypeDWARFAppleTypes;
                         else if (section_name == g_sect_name_dwarf_apple_namespaces)
                             sect_type = eSectionTypeDWARFAppleNamespaces;
+                        else if (section_name == g_sect_name_dwarf_apple_objc)
+                            sect_type = eSectionTypeDWARFAppleObjC;
                         else if (section_name == g_sect_name_objc_selrefs)
                             sect_type = eSectionTypeDataCStringPointers;
                         else if (section_name == g_sect_name_objc_msgrefs)

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=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Thu Oct 27 12:55:14 2011
@@ -184,6 +184,7 @@
     m_apple_names_ap (),
     m_apple_types_ap (),
     m_apple_namespaces_ap (),
+    m_apple_objc_ap (),
     m_function_basename_index(),
     m_function_fullname_index(),
     m_function_method_index(),
@@ -287,6 +288,15 @@
             m_apple_namespaces_ap.reset();
     }
 
+    get_apple_objc_data();
+    if (m_data_apple_objc.GetByteSize() > 0)
+    {
+        m_apple_objc_ap.reset (new DWARFMappedHash::MemoryTable (m_data_apple_objc, get_debug_str_data(), ".apple_objc"));
+        if (m_apple_objc_ap->IsValid())
+            m_using_apple_tables = true;
+        else
+            m_apple_objc_ap.reset();
+    }
 }
 
 bool
@@ -492,19 +502,25 @@
 const DataExtractor&
 SymbolFileDWARF::get_apple_names_data()
 {
-    return GetCachedSectionData (flagsGotDebugNamesData, eSectionTypeDWARFAppleNames, m_data_apple_names);
+    return GetCachedSectionData (flagsGotAppleNamesData, eSectionTypeDWARFAppleNames, m_data_apple_names);
 }
 
 const DataExtractor&
 SymbolFileDWARF::get_apple_types_data()
 {
-    return GetCachedSectionData (flagsGotDebugTypesData, eSectionTypeDWARFAppleTypes, m_data_apple_types);
+    return GetCachedSectionData (flagsGotAppleTypesData, eSectionTypeDWARFAppleTypes, m_data_apple_types);
 }
 
 const DataExtractor&
 SymbolFileDWARF::get_apple_namespaces_data()
 {
-    return GetCachedSectionData (flagsGotDebugNamespacesData, eSectionTypeDWARFAppleNamespaces, m_data_apple_namespaces);
+    return GetCachedSectionData (flagsGotAppleNamespacesData, eSectionTypeDWARFAppleNamespaces, m_data_apple_namespaces);
+}
+
+const DataExtractor&
+SymbolFileDWARF::get_apple_objc_data()
+{
+    return GetCachedSectionData (flagsGotAppleObjCData, eSectionTypeDWARFAppleObjC, m_data_apple_objc);
 }
 
 
@@ -1691,9 +1707,22 @@
                 if (!class_str.empty())
                 {
                 
-                    ConstString class_name (class_str.c_str());
                     DIEArray method_die_offsets;
-                    if (m_objc_class_selectors_index.Find (class_name, method_die_offsets))
+                    if (m_using_apple_tables)
+                    {
+                        if (m_apple_objc_ap.get())
+                            m_apple_objc_ap->FindByName(class_str.c_str(), method_die_offsets);
+                    }
+                    else
+                    {
+                        if (!m_indexed)
+                            Index ();
+                        
+                        ConstString class_name (class_str.c_str());
+                        m_objc_class_selectors_index.Find (class_name, method_die_offsets);
+                    }
+
+                    if (!method_die_offsets.empty())
                     {
                         DWARFDebugInfo* debug_info = DebugInfo();
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Thu Oct 27 12:55:14 2011
@@ -170,6 +170,7 @@
     const lldb_private::DataExtractor&      get_apple_names_data ();
     const lldb_private::DataExtractor&      get_apple_types_data ();
     const lldb_private::DataExtractor&      get_apple_namespaces_data ();
+    const lldb_private::DataExtractor&      get_apple_objc_data ();
 
 
     DWARFDebugAbbrev*       DebugAbbrev();
@@ -251,9 +252,10 @@
         flagsGotDebugPubTypesData   = (1 << 8),
         flagsGotDebugRangesData     = (1 << 9),
         flagsGotDebugStrData        = (1 << 10),
-        flagsGotDebugNamesData      = (1 << 11),
-        flagsGotDebugTypesData      = (1 << 12),
-        flagsGotDebugNamespacesData = (1 << 13)
+        flagsGotAppleNamesData      = (1 << 11),
+        flagsGotAppleTypesData      = (1 << 12),
+        flagsGotAppleNamespacesData = (1 << 13),
+        flagsGotAppleObjCData       = (1 << 14)
     };
     
     bool                    NamespaceDeclMatchesThisSymbolFile (const lldb_private::ClangNamespaceDecl *namespace_decl);
@@ -474,6 +476,7 @@
     lldb_private::DataExtractor     m_data_apple_names;
     lldb_private::DataExtractor     m_data_apple_types;
     lldb_private::DataExtractor     m_data_apple_namespaces;
+    lldb_private::DataExtractor     m_data_apple_objc;
 
     // The auto_ptr items below are generated on demand if and when someone accesses
     // them through a non const version of this class.
@@ -483,6 +486,7 @@
     std::auto_ptr<DWARFMappedHash::MemoryTable> m_apple_names_ap;
     std::auto_ptr<DWARFMappedHash::MemoryTable> m_apple_types_ap;
     std::auto_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_ap;
+    std::auto_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_ap;
     NameToDIE                           m_function_basename_index;  // All concrete functions
     NameToDIE                           m_function_fullname_index;  // All concrete functions
     NameToDIE                           m_function_method_index;    // All inlined functions

Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Thu Oct 27 12:55:14 2011
@@ -937,16 +937,14 @@
 
 
 bool
-ClangASTType::DumpTypeValue
-(
-    Stream *s,
-    lldb::Format format,
-    const lldb_private::DataExtractor &data,
-    uint32_t byte_offset,
-    size_t byte_size,
-    uint32_t bitfield_bit_size,
-    uint32_t bitfield_bit_offset
-)
+ClangASTType::DumpTypeValue (Stream *s,
+                             lldb::Format format,
+                             const lldb_private::DataExtractor &data,
+                             uint32_t byte_offset,
+                             size_t byte_size,
+                             uint32_t bitfield_bit_size,
+                             uint32_t bitfield_bit_offset,
+                             ExecutionContextScope *exe_scope)
 {
     return DumpTypeValue (m_ast,
                           m_type,
@@ -956,23 +954,22 @@
                           byte_offset,
                           byte_size,
                           bitfield_bit_size,
-                          bitfield_bit_offset);
+                          bitfield_bit_offset,
+                          exe_scope);
 }
 
 
 bool
-ClangASTType::DumpTypeValue
-(
-    clang::ASTContext *ast_context,
-    clang_type_t clang_type,
-    Stream *s,
-    lldb::Format format,
-    const lldb_private::DataExtractor &data,
-    uint32_t byte_offset,
-    size_t byte_size,
-    uint32_t bitfield_bit_size,
-    uint32_t bitfield_bit_offset
-)
+ClangASTType::DumpTypeValue (clang::ASTContext *ast_context,
+                             clang_type_t clang_type,
+                             Stream *s,
+                             lldb::Format format,
+                             const lldb_private::DataExtractor &data,
+                             uint32_t byte_offset,
+                             size_t byte_size,
+                             uint32_t bitfield_bit_size,
+                             uint32_t bitfield_bit_offset,
+                             ExecutionContextScope *exe_scope)
 {
     clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type));
     if (ClangASTContext::IsAggregateType (clang_type))
@@ -1001,7 +998,8 @@
                                                     byte_offset,            // Offset into "data" where to grab value from
                                                     typedef_byte_size,      // Size of this type in bytes
                                                     bitfield_bit_size,      // Size in bits of a bitfield value, if zero don't treat as a bitfield
-                                                    bitfield_bit_offset);   // Offset in bits of a bitfield value if bitfield_bit_size != 0
+                                                    bitfield_bit_offset,    // Offset in bits of a bitfield value if bitfield_bit_size != 0
+                                                    exe_scope);
             }
             break;
 
@@ -1094,7 +1092,8 @@
                                   UINT32_MAX,
                                   LLDB_INVALID_ADDRESS,
                                   bitfield_bit_size,
-                                  bitfield_bit_offset);
+                                  bitfield_bit_offset,
+                                  exe_scope);
             }
             break;
         }

Modified: lldb/trunk/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ObjectFile.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ObjectFile.cpp (original)
+++ lldb/trunk/source/Symbol/ObjectFile.cpp Thu Oct 27 12:55:14 2011
@@ -198,32 +198,35 @@
                     case eSectionTypeInvalid:               return eAddressClassUnknown;
                     case eSectionTypeCode:                  return eAddressClassCode;
                     case eSectionTypeContainer:             return eAddressClassUnknown;
-                    case eSectionTypeData:                  return eAddressClassData;
-                    case eSectionTypeDataCString:           return eAddressClassData;
-                    case eSectionTypeDataCStringPointers:   return eAddressClassData;
-                    case eSectionTypeDataSymbolAddress:     return eAddressClassData;
-                    case eSectionTypeData4:                 return eAddressClassData;
-                    case eSectionTypeData8:                 return eAddressClassData;
-                    case eSectionTypeData16:                return eAddressClassData;
-                    case eSectionTypeDataPointers:          return eAddressClassData;
-                    case eSectionTypeZeroFill:              return eAddressClassData;
-                    case eSectionTypeDataObjCMessageRefs:   return eAddressClassData;
-                    case eSectionTypeDataObjCCFStrings:     return eAddressClassData;
-                    case eSectionTypeDebug:                 return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugAbbrev:      return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugAranges:     return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugFrame:       return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugInfo:        return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugLine:        return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugLoc:         return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugMacInfo:     return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugPubNames:    return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugPubTypes:    return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugRanges:      return eAddressClassDebug;
-                    case eSectionTypeDWARFDebugStr:         return eAddressClassDebug;
-                    case eSectionTypeDWARFAppleNames:       return eAddressClassDebug;
-                    case eSectionTypeDWARFAppleTypes:       return eAddressClassDebug;
-                    case eSectionTypeDWARFAppleNamespaces:  return eAddressClassDebug;
+                    case eSectionTypeData:
+                    case eSectionTypeDataCString:
+                    case eSectionTypeDataCStringPointers:
+                    case eSectionTypeDataSymbolAddress:
+                    case eSectionTypeData4:
+                    case eSectionTypeData8:
+                    case eSectionTypeData16:
+                    case eSectionTypeDataPointers:
+                    case eSectionTypeZeroFill:
+                    case eSectionTypeDataObjCMessageRefs:
+                    case eSectionTypeDataObjCCFStrings:
+                        return eAddressClassData;
+                    case eSectionTypeDebug:
+                    case eSectionTypeDWARFDebugAbbrev:
+                    case eSectionTypeDWARFDebugAranges:
+                    case eSectionTypeDWARFDebugFrame:
+                    case eSectionTypeDWARFDebugInfo:
+                    case eSectionTypeDWARFDebugLine:
+                    case eSectionTypeDWARFDebugLoc:
+                    case eSectionTypeDWARFDebugMacInfo:
+                    case eSectionTypeDWARFDebugPubNames:
+                    case eSectionTypeDWARFDebugPubTypes:
+                    case eSectionTypeDWARFDebugRanges:
+                    case eSectionTypeDWARFDebugStr:
+                    case eSectionTypeDWARFAppleNames:
+                    case eSectionTypeDWARFAppleTypes:
+                    case eSectionTypeDWARFAppleNamespaces:
+                    case eSectionTypeDWARFAppleObjC:
+                        return eAddressClassDebug;
                     case eSectionTypeEHFrame:               return eAddressClassRuntime;
                     case eSectionTypeOther:                 return eAddressClassUnknown;
                     }

Modified: lldb/trunk/source/lldb.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/lldb.cpp?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/source/lldb.cpp (original)
+++ lldb/trunk/source/lldb.cpp Thu Oct 27 12:55:14 2011
@@ -262,6 +262,7 @@
     case eSectionTypeDWARFAppleNames: return "apple-names";
     case eSectionTypeDWARFAppleTypes: return "apple-types";
     case eSectionTypeDWARFAppleNamespaces: return "apple-namespaces";
+    case eSectionTypeDWARFAppleObjC: return "apple-objc";
     case eSectionTypeEHFrame: return "eh-frame";
     case eSectionTypeOther: return "regular";
     }

Modified: lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py?rev=143114&r1=143113&r2=143114&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (original)
+++ lldb/trunk/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py Thu Oct 27 12:55:14 2011
@@ -175,7 +175,7 @@
         
         # check that we can format a variable in a summary even if a format is defined for its datatype
         self.runCmd("type format add -f hex int")
-        self.runCmd("type summary add --summary-string \"x=${var.x%i}\" Simple")
+        self.runCmd("type summary add --summary-string \"x=${var.x%d}\" Simple")
 
         self.expect("frame variable a_simple_object",
             substrs = ['x=3'])





More information about the lldb-commits mailing list