[Lldb-commits] [lldb] r171849 [2/2] - in /lldb/branches/windows: ./ docs/ examples/summaries/cocoa/ examples/synthetic/ include/lldb/ include/lldb/API/ include/lldb/Breakpoint/ include/lldb/Core/ include/lldb/Expression/ include/lldb/Host/ include/lldb/Interpreter/ include/lldb/Symbol/ include/lldb/Target/ lib/ lldb.xcodeproj/ resources/ scripts/ scripts/Python/ scripts/Python/interface/ source/ source/API/ source/Breakpoint/ source/Commands/ source/Core/ source/Expression/ source/Host/common/ source/Host/linux/ source...

Carlo Kok ck at remobjects.com
Tue Jan 8 04:51:56 PST 2013


Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Tue Jan  8 06:51:53 2013
@@ -126,14 +126,14 @@
     {
         StreamString log_strm;
         const size_t n = m_dies.size();
-        log_strm.Printf("DIEStack[%llu]:\n", (uint64_t)n);
+        log_strm.Printf("DIEStack[%" PRIu64 "]:\n", (uint64_t)n);
         for (size_t i=0; i<n; i++)
         {
             DWARFCompileUnit *cu = m_dies[i].cu;
             const DWARFDebugInfoEntry *die = m_dies[i].die;
             std::string qualified_name;
             die->GetQualifiedName(dwarf, cu, qualified_name);
-            log_strm.Printf ("[%llu] 0x%8.8x: %s name='%s'\n", 
+            log_strm.Printf ("[%" PRIu64 "] 0x%8.8x: %s name='%s'\n",
                              (uint64_t)i,
                              die->GetOffset(), 
                              DW_TAG_value_to_name(die->Tag()), 
@@ -991,6 +991,7 @@
     DWARFDebugLine::Row prev_row;
     SectionSP prev_section_sp;
     SectionSP curr_section_sp;
+    llvm::OwningPtr<LineSequence> curr_sequence_ap;
 };
 
 //----------------------------------------------------------------------
@@ -1137,20 +1138,36 @@
                 // We are not in an object file that contains DWARF for an
                 // N_OSO, this is just a normal DWARF file. The DWARF spec
                 // guarantees that the addresses will be in increasing order
-                // so, since we store line tables in file address order, we
-                // can always just append the line entry without needing to
-                // search for the correct insertion point (we don't need to
-                // use LineEntry::InsertLineEntry()).
-                line_table->AppendLineEntry (info->curr_section_sp,
-                                             curr_line_section_offset,
-                                             state.line,
-                                             state.column,
-                                             state.file,
-                                             state.is_stmt,
-                                             state.basic_block,
-                                             state.prologue_end,
-                                             state.epilogue_begin,
-                                             state.end_sequence);
+                // for a sequence, but the line table for a single compile unit
+                // may contain multiple sequences so we append entries to the
+                // current sequence until we find its end, then we merge the
+                // sequence into the main line table collection.
+
+                // If this is our first time here, we need to create a 
+                // sequence container.
+                if (!info->curr_sequence_ap)
+                {
+                    info->curr_sequence_ap.reset(line_table->CreateLineSequenceContainer());
+                    assert(info->curr_sequence_ap);
+                }
+                line_table->AppendLineEntryToSequence(info->curr_sequence_ap.get(),
+                                                      info->curr_section_sp,
+                                                      curr_line_section_offset,
+                                                      state.line,
+                                                      state.column,
+                                                      state.file,
+                                                      state.is_stmt,
+                                                      state.basic_block,
+                                                      state.prologue_end,
+                                                      state.epilogue_begin,
+                                                      state.end_sequence);
+                if (state.end_sequence)
+                {
+                    // First, put the current sequence into the line table.
+                    line_table->InsertSequence(info->curr_sequence_ap.get());
+                    // Then, empty it to prepare for the next sequence.
+                    info->curr_sequence_ap->Clear();
+                }
             }
         }
 
@@ -1186,7 +1203,8 @@
                         false, 
                         DWARFDebugLine::Row(), 
                         SectionSP(), 
-                        SectionSP()
+                        SectionSP(),
+                        llvm::OwningPtr<LineSequence>()
                     };
                     uint32_t offset = cu_line_offset;
                     DWARFDebugLine::ParseStatementTable(get_debug_line_data(), &offset, ParseDWARFLineTableCallback, &info);
@@ -1550,6 +1568,24 @@
     std::auto_ptr<ClangASTMetadata>        m_metadata_ap;
 };
 
+struct BitfieldInfo
+{
+    uint64_t bit_size;
+    uint64_t bit_offset;
+    
+    BitfieldInfo () :
+        bit_size (LLDB_INVALID_ADDRESS),
+        bit_offset (LLDB_INVALID_ADDRESS)
+    {
+    }
+    
+    bool IsValid ()
+    {
+        return (bit_size != LLDB_INVALID_ADDRESS) &&
+               (bit_offset != LLDB_INVALID_ADDRESS);
+    }
+};
+
 size_t
 SymbolFileDWARF::ParseChildMembers
 (
@@ -1561,7 +1597,6 @@
     std::vector<clang::CXXBaseSpecifier *>& base_classes,
     std::vector<int>& member_accessibilities,
     DWARFDIECollection& member_function_dies,
-    BitfieldMap &bitfield_map,
     DelayedPropertyList& delayed_properties,
     AccessType& default_accessibility,
     bool &is_a_class,
@@ -1575,6 +1610,7 @@
     const DWARFDebugInfoEntry *die;
     const uint8_t *fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize (dwarf_cu->GetAddressByteSize());
     uint32_t member_idx = 0;
+    BitfieldInfo last_field_info;
 
     for (die = parent_die->GetFirstChild(); die != NULL; die = die->GetSibling())
     {
@@ -1756,6 +1792,7 @@
                     if (is_artificial == false)
                     {
                         Type *member_type = ResolveTypeUID(encoding_uid);
+                        
                         clang::FieldDecl *field_decl = NULL;
                         if (tag == DW_TAG_member)
                         {
@@ -1764,138 +1801,175 @@
                                 if (accessibility == eAccessNone)
                                     accessibility = default_accessibility;
                                 member_accessibilities.push_back(accessibility);
+                                
+                                BitfieldInfo this_field_info;
+                        
+                                this_field_info.bit_size = bit_size;
+                                
+                                if (member_byte_offset != UINT32_MAX || bit_size != 0)
+                                {
+                                    /////////////////////////////////////////////////////////////
+                                    // How to locate a field given the DWARF debug information
+                                    //
+                                    // AT_byte_size indicates the size of the word in which the
+                                    // bit offset must be interpreted.
+                                    //
+                                    // AT_data_member_location indicates the byte offset of the
+                                    // word from the base address of the structure.
+                                    //
+                                    // AT_bit_offset indicates how many bits into the word
+                                    // (according to the host endianness) the low-order bit of
+                                    // the field starts.  AT_bit_offset can be negative.
+                                    //
+                                    // AT_bit_size indicates the size of the field in bits.
+                                    /////////////////////////////////////////////////////////////
+                                    
+                                    this_field_info.bit_offset = 0;
+                                    
+                                    this_field_info.bit_offset += (member_byte_offset == UINT32_MAX ? 0 : (member_byte_offset * 8));
+                                    
+                                    if (GetObjectFile()->GetByteOrder() == eByteOrderLittle)
+                                    {
+                                        this_field_info.bit_offset += byte_size * 8;
+                                        this_field_info.bit_offset -= (bit_offset + bit_size);
+                                    }
+                                    else
+                                    {
+                                        this_field_info.bit_offset += bit_offset;
+                                    }
+                                }
 
-                                // Code to detect unnamed bitifields
-                                if (bit_size > 0 && member_byte_offset != UINT32_MAX)
+                                // If the member to be emitted did not start on a character boundary and there is
+                                // empty space between the last field and this one, then we need to emit an
+                                // anonymous member filling up the space up to its start.  There are three cases
+                                // here:
+                                //
+                                // 1 If the previous member ended on a character boundary, then we can emit an
+                                //   anonymous member starting at the most recent character boundary.
+                                //
+                                // 2 If the previous member did not end on a character boundary and the distance
+                                //   from the end of the previous member to the current member is less than a
+                                //   word width, then we can emit an anonymous member starting right after the
+                                //   previous member and right before this member.
+                                //
+                                // 3 If the previous member did not end on a character boundary and the distance
+                                //   from the end of the previous member to the current member is greater than
+                                //   or equal a word width, then we act as in Case 1.
+                                
+                                const uint64_t character_width = 8;
+                                const uint64_t word_width = 32;
+                                
+                                if (this_field_info.IsValid())
                                 {
-                                    // Objective C has invalid DW_AT_bit_offset values so we can't use them to detect
-                                    // unnamed bitfields. Once clang is fixed we will enable unnamed bitfields
-                                    // in ObjC classes (<rdar://problem/12636970>)
+                                    // Objective-C has invalid DW_AT_bit_offset values in older versions
+                                    // of clang, so we have to be careful and only insert unnammed bitfields
+                                    // if we have a new enough clang.
+                                    bool detect_unnamed_bitfields = true;
+                                    
+                                    if (class_language == eLanguageTypeObjC || class_language == eLanguageTypeObjC_plus_plus)
+                                        detect_unnamed_bitfields = dwarf_cu->Supports_unnamed_objc_bitfields ();
                                     
-                                    if (!(class_language == eLanguageTypeObjC || class_language == eLanguageTypeObjC_plus_plus))
+                                    if (detect_unnamed_bitfields)
                                     {
-                                        // We have a bitfield, we need to watch out for
-                                        // unnamed bitfields that we need to insert if
-                                        // there is a gap in the bytes as many compilers
-                                        // doesn't emit DWARF DW_TAG_member tags for
-                                        // unnammed bitfields.
-                                        BitfieldMap::iterator bit_pos = bitfield_map.find(member_byte_offset);
-                                        uint32_t unnamed_bit_size = 0;
-                                        uint32_t unnamed_bit_offset = 0;
-                                        if (bit_pos == bitfield_map.end())
+                                        BitfieldInfo anon_field_info;
+                                        
+                                        if ((this_field_info.bit_offset % character_width) != 0) // not char aligned
                                         {
-                                            // First bitfield in an integral type.
+                                            uint64_t last_field_end = 0;
                                             
-                                            // We might need to insert a leading unnamed bitfield
-                                            if (bit_offset < byte_size * 8)
-                                            {
-                                                unnamed_bit_size = byte_size * 8 - (bit_size + bit_offset);
-                                                unnamed_bit_offset = byte_size * 8 - unnamed_bit_size;
-                                            }
+                                            if (last_field_info.IsValid())
+                                                last_field_end = last_field_info.bit_offset + last_field_info.bit_size;
                                             
-                                            // Now put the current bitfield info into the map
-                                            bitfield_map[member_byte_offset].bit_size = bit_size;
-                                            bitfield_map[member_byte_offset].bit_offset = bit_offset;
-                                        }
-                                        else
-                                        {
-                                            // Subsequent bitfield in an integral type.
-
-                                            // We have a bitfield that isn't the first for this
-                                            // integral type, check to make sure there aren't any
-                                            // gaps.
-                                            assert (bit_pos->second.bit_size > 0);
-                                            if (bit_offset < bit_pos->second.bit_offset)
-                                            {
-                                                unnamed_bit_size = bit_pos->second.bit_offset - (bit_size + bit_offset);
-                                                unnamed_bit_offset = bit_pos->second.bit_offset - unnamed_bit_size;
+                                            if (this_field_info.bit_offset != last_field_end)
+                                            {                                                
+                                                if (((last_field_end % character_width) == 0) ||                    // case 1
+                                                    (this_field_info.bit_offset - last_field_end >= word_width))    // case 3
+                                                {
+                                                    anon_field_info.bit_size = this_field_info.bit_offset % character_width;
+                                                    anon_field_info.bit_offset = this_field_info.bit_offset - anon_field_info.bit_size;
+                                                }
+                                                else                                                                // case 2
+                                                {
+                                                    anon_field_info.bit_size = this_field_info.bit_offset - last_field_end;
+                                                    anon_field_info.bit_offset = last_field_end;
+                                                }
                                             }
-
-                                            // Now put the current bitfield info into the map
-                                            bit_pos->second.bit_size = bit_size;
-                                            bit_pos->second.bit_offset = bit_offset;
                                         }
                                         
-                                        if (unnamed_bit_size > 0)
+                                        if (anon_field_info.IsValid())
                                         {
                                             clang::FieldDecl *unnamed_bitfield_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type,
                                                                                                                                  NULL,
-                                                                                                                                 member_type->GetClangLayoutType(),
+                                                                                                                                 GetClangASTContext().GetBuiltinTypeForEncodingAndBitSize(eEncodingSint, word_width),
                                                                                                                                  accessibility,
-                                                                                                                                 unnamed_bit_size);
-                                            uint64_t total_bit_offset = 0;
-                                            
-                                            total_bit_offset += (member_byte_offset == UINT32_MAX ? 0 : (member_byte_offset * 8));
+                                                                                                                                 anon_field_info.bit_size);
                                             
-                                            if (GetObjectFile()->GetByteOrder() == eByteOrderLittle)
-                                            {
-                                                total_bit_offset += byte_size * 8;
-                                                total_bit_offset -= (unnamed_bit_offset + unnamed_bit_size);
-                                            }
-                                            else
+                                            layout_info.field_offsets.insert(std::make_pair(unnamed_bitfield_decl, anon_field_info.bit_offset));
+                                        }
+                                    }
+                                }
+                                
+                                clang_type_t member_clang_type = member_type->GetClangLayoutType();
+                                
+                                {
+                                    // Older versions of clang emit array[0] and array[1] in the same way (<rdar://problem/12566646>).
+                                    // If the current field is at the end of the structure, then there is definitely no room for extra
+                                    // elements and we override the type to array[0].
+                                    
+                                    clang_type_t member_array_element_type;
+                                    uint64_t member_array_size;
+                                    bool member_array_is_incomplete;
+                                    
+                                    if (GetClangASTContext().IsArrayType(member_clang_type,
+                                                                         &member_array_element_type,
+                                                                         &member_array_size,
+                                                                         &member_array_is_incomplete) &&
+                                        !member_array_is_incomplete)
+                                    {
+                                        uint64_t parent_byte_size = parent_die->GetAttributeValueAsUnsigned(this, dwarf_cu, DW_AT_byte_size, UINT64_MAX);
+                                    
+                                        if (member_byte_offset >= parent_byte_size)
+                                        {
+                                            if (member_array_size != 1)
                                             {
-                                                total_bit_offset += unnamed_bit_size;
+                                                GetObjectFile()->GetModule()->ReportError ("0x%8.8" PRIx64 ": DW_TAG_member '%s' refers to type 0x%8.8" PRIx64 " which extends beyond the bounds of 0x%8.8" PRIx64,
+                                                                                           MakeUserID(die->GetOffset()),
+                                                                                           name,
+                                                                                           encoding_uid,
+                                                                                           MakeUserID(parent_die->GetOffset()));
                                             }
                                             
-                                            layout_info.field_offsets.insert(std::make_pair(unnamed_bitfield_decl, total_bit_offset));
+                                            member_clang_type = GetClangASTContext().CreateArrayType(member_array_element_type, 0);
                                         }
                                     }
                                 }
+                                
                                 field_decl = GetClangASTContext().AddFieldToRecordType (class_clang_type,
                                                                                         name, 
-                                                                                        member_type->GetClangLayoutType(), 
+                                                                                        member_clang_type,
                                                                                         accessibility, 
                                                                                         bit_size);
                                 
                                 GetClangASTContext().SetMetadataAsUserID ((uintptr_t)field_decl, MakeUserID(die->GetOffset()));
+                                
+                                if (this_field_info.IsValid())
+                                {
+                                    layout_info.field_offsets.insert(std::make_pair(field_decl, this_field_info.bit_offset));
+                                    last_field_info = this_field_info;
+                                }
                             }
                             else
                             {
                                 if (name)
-                                    GetObjectFile()->GetModule()->ReportError ("0x%8.8llx: DW_TAG_member '%s' refers to type 0x%8.8llx which was unable to be parsed",
+                                    GetObjectFile()->GetModule()->ReportError ("0x%8.8" PRIx64 ": DW_TAG_member '%s' refers to type 0x%8.8" PRIx64 " which was unable to be parsed",
                                                                                MakeUserID(die->GetOffset()),
                                                                                name,
                                                                                encoding_uid);
                                 else
-                                    GetObjectFile()->GetModule()->ReportError ("0x%8.8llx: DW_TAG_member refers to type 0x%8.8llx which was unable to be parsed",
+                                    GetObjectFile()->GetModule()->ReportError ("0x%8.8" PRIx64 ": DW_TAG_member refers to type 0x%8.8" PRIx64 " which was unable to be parsed",
                                                                                MakeUserID(die->GetOffset()),
                                                                                encoding_uid);
                             }
-
-                            if (member_byte_offset != UINT32_MAX || bit_size != 0)
-                            {
-                                /////////////////////////////////////////////////////////////
-                                // How to locate a field given the DWARF debug information
-                                //
-                                // AT_byte_size indicates the size of the word in which the
-                                // bit offset must be interpreted.
-                                //
-                                // AT_data_member_location indicates the byte offset of the
-                                // word from the base address of the structure.
-                                //
-                                // AT_bit_offset indicates how many bits into the word
-                                // (according to the host endianness) the low-order bit of
-                                // the field starts.  AT_bit_offset can be negative.
-                                //
-                                // AT_bit_size indicates the size of the field in bits.
-                                /////////////////////////////////////////////////////////////
-                                                        
-                                uint64_t total_bit_offset = 0;
-                                
-                                total_bit_offset += (member_byte_offset == UINT32_MAX ? 0 : (member_byte_offset * 8));
-                                
-                                if (GetObjectFile()->GetByteOrder() == eByteOrderLittle)
-                                {  
-                                    total_bit_offset += byte_size * 8;
-                                    total_bit_offset -= (bit_offset + bit_size);
-                                }
-                                else
-                                {
-                                    total_bit_offset += bit_offset;
-                                }
-                                                            
-                                layout_info.field_offsets.insert(std::make_pair(field_decl, total_bit_offset));
-                            }
                         }
                         
                         if (prop_name != NULL)
@@ -2188,7 +2262,7 @@
     if (log)
     {
         GetObjectFile()->GetModule()->LogMessageVerboseBacktrace (log.get(),
-                                                                  "0x%8.8llx: %s '%s' resolving forward declaration...",
+                                                                  "0x%8.8" PRIx64 ": %s '%s' resolving forward declaration...",
                                                                   MakeUserID(die->GetOffset()),
                                                                   DW_TAG_value_to_name(tag),
                                                                   type->GetName().AsCString());
@@ -2247,7 +2321,6 @@
                     DWARFDIECollection member_function_dies;
                                         
                     DelayedPropertyList delayed_properties;
-                    BitfieldMap bitfield_map;
                     ParseChildMembers (sc,
                                        dwarf_cu,
                                        die, 
@@ -2256,7 +2329,6 @@
                                        base_classes, 
                                        member_accessibilities,
                                        member_function_dies,
-                                       bitfield_map,
                                        delayed_properties,
                                        default_accessibility, 
                                        is_a_class,
@@ -2385,7 +2457,7 @@
                     if (log)
                     {
                         GetObjectFile()->GetModule()->LogMessage (log.get(), 
-                                                                  "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %llu, alignment = %llu, field_offsets[%u], base_offsets[%u], vbase_offsets[%u])",
+                                                                  "SymbolFileDWARF::ResolveClangOpaqueTypeDefinition (clang_type = %p) caching layout info for record_decl = %p, bit_size = %" PRIu64 ", alignment = %" PRIu64 ", field_offsets[%u], base_offsets[%u], vbase_offsets[%u])",
                                                                   clang_type,
                                                                   record_decl,
                                                                   layout_info.bit_size,
@@ -2521,7 +2593,7 @@
 SymbolFileDWARF::ResolveSymbolContext (const Address& so_addr, uint32_t resolve_scope, SymbolContext& sc)
 {
     Timer scoped_timer(__PRETTY_FUNCTION__,
-                       "SymbolFileDWARF::ResolveSymbolContext (so_addr = { section = %p, offset = 0x%llx }, resolve_scope = 0x%8.8x)",
+                       "SymbolFileDWARF::ResolveSymbolContext (so_addr = { section = %p, offset = 0x%" PRIx64 " }, resolve_scope = 0x%8.8x)",
                        so_addr.GetSection().get(),
                        so_addr.GetOffset(),
                        resolve_scope);
@@ -2548,27 +2620,7 @@
                     {
                         resolved |= eSymbolContextCompUnit;
 
-                        if (resolve_scope & eSymbolContextLineEntry)
-                        {
-                            LineTable *line_table = sc.comp_unit->GetLineTable();
-                            if (line_table != NULL)
-                            {
-                                if (so_addr.IsLinkedAddress())
-                                {
-                                    Address linked_addr (so_addr);
-                                    linked_addr.ResolveLinkedAddress();
-                                    if (line_table->FindLineEntryByAddress (linked_addr, sc.line_entry))
-                                    {
-                                        resolved |= eSymbolContextLineEntry;
-                                    }
-                                }
-                                else if (line_table->FindLineEntryByAddress (so_addr, sc.line_entry))
-                                {
-                                    resolved |= eSymbolContextLineEntry;
-                                }
-                            }
-                        }
-
+                        bool force_check_line_table = false;
                         if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock))
                         {
                             DWARFDebugInfoEntry *function_die = NULL;
@@ -2596,8 +2648,7 @@
                                 // should only happen when there aren't other functions from
                                 // other compile units in these gaps. This helps keep the size
                                 // of the aranges down.
-                                sc.comp_unit = NULL;
-                                resolved &= ~eSymbolContextCompUnit;
+                                force_check_line_table = true;
                             }
 
                             if (sc.function != NULL)
@@ -2617,6 +2668,39 @@
                                 }
                             }
                         }
+                        
+                        if ((resolve_scope & eSymbolContextLineEntry) || force_check_line_table)
+                        {
+                            LineTable *line_table = sc.comp_unit->GetLineTable();
+                            if (line_table != NULL)
+                            {
+                                if (so_addr.IsLinkedAddress())
+                                {
+                                    Address linked_addr (so_addr);
+                                    linked_addr.ResolveLinkedAddress();
+                                    if (line_table->FindLineEntryByAddress (linked_addr, sc.line_entry))
+                                    {
+                                        resolved |= eSymbolContextLineEntry;
+                                    }
+                                }
+                                else if (line_table->FindLineEntryByAddress (so_addr, sc.line_entry))
+                                {
+                                    resolved |= eSymbolContextLineEntry;
+                                }
+                            }
+                        }
+                        
+                        if (force_check_line_table && !(resolved & eSymbolContextLineEntry))
+                        {
+                            // We might have had a compile unit that had discontiguous
+                            // address ranges where the gaps are symbols that don't have
+                            // any debug info. Discontiguous compile unit address ranges
+                            // should only happen when there aren't other functions from
+                            // other compile units in these gaps. This helps keep the size
+                            // of the aranges down.
+                            sc.comp_unit = NULL;
+                            resolved &= ~eSymbolContextCompUnit;
+                        }
                     }
                     else
                     {
@@ -3256,6 +3340,8 @@
         DWARFFormValue form_value;
         die->GetAttributes(this, dwarf_cu, NULL, attributes);
         uint32_t idx = attributes.FindAttributeIndex(DW_AT_MIPS_linkage_name);
+        if (idx == UINT32_MAX)
+            idx = attributes.FindAttributeIndex(DW_AT_linkage_name);
         if (idx != UINT32_MAX)
         {
             if (attributes.ExtractFormValueAtIndex(this, idx, form_value))
@@ -4200,6 +4286,7 @@
                     uint64_t num_elements = 0;
                     uint64_t lower_bound = 0;
                     uint64_t upper_bound = 0;
+                    bool upper_bound_valid = false;
                     uint32_t i;
                     for (i=0; i<num_child_attributes; ++i)
                     {
@@ -4229,6 +4316,7 @@
                                 break;
 
                             case DW_AT_upper_bound:
+                                upper_bound_valid = true;
                                 upper_bound = form_value.Unsigned();
                                 break;
 
@@ -4249,8 +4337,11 @@
                         }
                     }
 
-                    if (upper_bound > lower_bound)
-                        num_elements = upper_bound - lower_bound + 1;
+                    if (num_elements == 0)
+                    {
+                        if (upper_bound_valid && upper_bound >= lower_bound)
+                            num_elements = upper_bound - lower_bound + 1;
+                    }
 
                     element_orders.push_back (num_elements);
                 }
@@ -4335,7 +4426,7 @@
                 if (namespace_name)
                 {
                     GetObjectFile()->GetModule()->LogMessage (log.get(), 
-                                                              "ASTContext => %p: 0x%8.8llx: DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl *%p (original = %p)", 
+                                                              "ASTContext => %p: 0x%8.8" PRIx64 ": DW_TAG_namespace with DW_AT_name(\"%s\") => clang::NamespaceDecl *%p (original = %p)",
                                                               GetClangASTContext().getASTContext(),
                                                               MakeUserID(die->GetOffset()),
                                                               namespace_name,
@@ -4345,7 +4436,7 @@
                 else
                 {
                     GetObjectFile()->GetModule()->LogMessage (log.get(),
-                                                              "ASTContext => %p: 0x%8.8llx: DW_TAG_namespace (anonymous) => clang::NamespaceDecl *%p (original = %p)", 
+                                                              "ASTContext => %p: 0x%8.8" PRIx64 ": DW_TAG_namespace (anonymous) => clang::NamespaceDecl *%p (original = %p)",
                                                               GetClangASTContext().getASTContext(),
                                                               MakeUserID(die->GetOffset()),
                                                               namespace_decl,
@@ -4619,7 +4710,7 @@
                         Type *resolved_type = ResolveType (type_cu, type_die, false);
                         if (resolved_type && resolved_type != DIE_IS_BEING_PARSED)
                         {
-                            DEBUG_PRINTF ("resolved 0x%8.8llx (cu 0x%8.8llx) from %s to 0x%8.8llx (cu 0x%8.8llx)\n",
+                            DEBUG_PRINTF ("resolved 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ") from %s to 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ")\n",
                                           MakeUserID(die->GetOffset()), 
                                           MakeUserID(dwarf_cu->GetOffset()),
                                           m_obj_file->GetFileSpec().GetFilename().AsCString(),
@@ -4880,7 +4971,7 @@
                         Type *resolved_type = ResolveType (type_cu, type_die, false);
                         if (resolved_type && resolved_type != DIE_IS_BEING_PARSED)
                         {
-                            DEBUG_PRINTF ("resolved 0x%8.8llx (cu 0x%8.8llx) from %s to 0x%8.8llx (cu 0x%8.8llx)\n",
+                            DEBUG_PRINTF ("resolved 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ") from %s to 0x%8.8" PRIx64 " (cu 0x%8.8" PRIx64 ")\n",
                                           MakeUserID(die->GetOffset()), 
                                           MakeUserID(dwarf_cu->GetOffset()),
                                           m_obj_file->GetFileSpec().GetFilename().AsCString(),
@@ -5206,7 +5297,7 @@
             if (src_child_type)
             {
                 if (log)
-                    log->Printf ("uniquing type %p (uid=0x%llx) from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
+                    log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
                 m_die_to_type[dst_die] = src_child_type;
             }
             else
@@ -5228,9 +5319,6 @@
             
             if (dst_die)
             {
-                // Erase this entry from the map
-                const size_t num_removed = dst_name_to_die_artificial.Erase (src_name_artificial);
-                assert (num_removed == 0 || num_removed == 1); // REMOVE THIS
                 // Both classes have the artificial types, link them
                 clang::DeclContext *src_decl_ctx = m_die_to_decl_ctx[src_die];
                 if (src_decl_ctx)
@@ -5249,7 +5337,7 @@
                 if (src_child_type)
                 {
                     if (log)
-                        log->Printf ("uniquing type %p (uid=0x%llx) from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
+                        log->Printf ("uniquing type %p (uid=0x%" PRIx64 ") from 0x%8.8x for 0x%8.8x", src_child_type, src_child_type->GetID(), src_die->GetOffset(), dst_die->GetOffset());
                     m_die_to_type[dst_die] = src_child_type;
                 }
                 else
@@ -5409,7 +5497,7 @@
                         }
                     }
 
-                    DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\") type => 0x%8.8x\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid);
+                    DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\") type => 0x%8.8x\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr, encoding_uid);
 
                     switch (tag)
                     {
@@ -5441,51 +5529,80 @@
                     case DW_TAG_volatile_type:          encoding_data_type = Type::eEncodingIsVolatileUID;          break;
                     }
 
-                    if (clang_type == NULL && (encoding_data_type == Type::eEncodingIsPointerUID || encoding_data_type == Type::eEncodingIsTypedefUID))
+                    if (clang_type == NULL && (encoding_data_type == Type::eEncodingIsPointerUID || encoding_data_type == Type::eEncodingIsTypedefUID) && sc.comp_unit != NULL)
                     {
-                        if (type_name_cstr != NULL && sc.comp_unit != NULL && 
-                            (sc.comp_unit->GetLanguage() == eLanguageTypeObjC || sc.comp_unit->GetLanguage() == eLanguageTypeObjC_plus_plus))
+                        bool translation_unit_is_objc = (sc.comp_unit->GetLanguage() == eLanguageTypeObjC || sc.comp_unit->GetLanguage() == eLanguageTypeObjC_plus_plus);
+                        
+                        if (translation_unit_is_objc)
                         {
-                            static ConstString g_objc_type_name_id("id");
-                            static ConstString g_objc_type_name_Class("Class");
-                            static ConstString g_objc_type_name_selector("SEL");
-                            
-                            if (type_name_const_str == g_objc_type_name_id)
+                            if (type_name_cstr != NULL)
                             {
-                                if (log)
-                                    GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is Objective C 'id' built-in type.", 
-                                                                              die->GetOffset(), 
-                                                                              DW_TAG_value_to_name(die->Tag()), 
-                                                                              die->GetName(this, dwarf_cu));
-                                clang_type = ast.GetBuiltInType_objc_id();
-                                encoding_data_type = Type::eEncodingIsUID;
-                                encoding_uid = LLDB_INVALID_UID;
-                                resolve_state = Type::eResolveStateFull;
+                                static ConstString g_objc_type_name_id("id");
+                                static ConstString g_objc_type_name_Class("Class");
+                                static ConstString g_objc_type_name_selector("SEL");
+                                
+                                if (type_name_const_str == g_objc_type_name_id)
+                                {
+                                    if (log)
+                                        GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is Objective C 'id' built-in type.", 
+                                                                                  die->GetOffset(), 
+                                                                                  DW_TAG_value_to_name(die->Tag()), 
+                                                                                  die->GetName(this, dwarf_cu));
+                                    clang_type = ast.GetBuiltInType_objc_id();
+                                    encoding_data_type = Type::eEncodingIsUID;
+                                    encoding_uid = LLDB_INVALID_UID;
+                                    resolve_state = Type::eResolveStateFull;
 
+                                }
+                                else if (type_name_const_str == g_objc_type_name_Class)
+                                {
+                                    if (log)
+                                        GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is Objective C 'Class' built-in type.", 
+                                                                                  die->GetOffset(), 
+                                                                                  DW_TAG_value_to_name(die->Tag()), 
+                                                                                  die->GetName(this, dwarf_cu));
+                                    clang_type = ast.GetBuiltInType_objc_Class();
+                                    encoding_data_type = Type::eEncodingIsUID;
+                                    encoding_uid = LLDB_INVALID_UID;
+                                    resolve_state = Type::eResolveStateFull;
+                                }
+                                else if (type_name_const_str == g_objc_type_name_selector)
+                                {
+                                    if (log)
+                                        GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is Objective C 'selector' built-in type.", 
+                                                                                  die->GetOffset(), 
+                                                                                  DW_TAG_value_to_name(die->Tag()), 
+                                                                                  die->GetName(this, dwarf_cu));
+                                    clang_type = ast.GetBuiltInType_objc_selector();
+                                    encoding_data_type = Type::eEncodingIsUID;
+                                    encoding_uid = LLDB_INVALID_UID;
+                                    resolve_state = Type::eResolveStateFull;
+                                }
                             }
-                            else if (type_name_const_str == g_objc_type_name_Class)
-                            {
-                                if (log)
-                                    GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is Objective C 'Class' built-in type.", 
-                                                                              die->GetOffset(), 
-                                                                              DW_TAG_value_to_name(die->Tag()), 
-                                                                              die->GetName(this, dwarf_cu));
-                                clang_type = ast.GetBuiltInType_objc_Class();
-                                encoding_data_type = Type::eEncodingIsUID;
-                                encoding_uid = LLDB_INVALID_UID;
-                                resolve_state = Type::eResolveStateFull;
-                            }
-                            else if (type_name_const_str == g_objc_type_name_selector)
+                            else if (encoding_data_type == Type::eEncodingIsPointerUID && encoding_uid != LLDB_INVALID_UID)
                             {
-                                if (log)
-                                    GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is Objective C 'selector' built-in type.", 
-                                                                              die->GetOffset(), 
-                                                                              DW_TAG_value_to_name(die->Tag()), 
-                                                                              die->GetName(this, dwarf_cu));
-                                clang_type = ast.GetBuiltInType_objc_selector();
-                                encoding_data_type = Type::eEncodingIsUID;
-                                encoding_uid = LLDB_INVALID_UID;
-                                resolve_state = Type::eResolveStateFull;
+                                // Clang sometimes erroneously emits id as objc_object*.  In that case we fix up the type to "id".
+                            
+                                DWARFDebugInfoEntry* encoding_die = dwarf_cu->GetDIEPtr(encoding_uid);
+                                
+                                if (encoding_die && encoding_die->Tag() == DW_TAG_structure_type)
+                                {                                    
+                                    if (const char *struct_name = encoding_die->GetAttributeValueAsString(this, dwarf_cu, DW_AT_name, NULL))
+                                    {
+                                        if (!strcmp(struct_name, "objc_object"))
+                                        {
+                                            if (log)
+                                                GetObjectFile()->GetModule()->LogMessage (log.get(), "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' is 'objc_object*', which we overrode to 'id'.",
+                                                                                          die->GetOffset(),
+                                                                                          DW_TAG_value_to_name(die->Tag()),
+                                                                                          die->GetName(this, dwarf_cu));
+                                            clang_type = ast.GetBuiltInType_objc_id();
+                                            encoding_data_type = Type::eEncodingIsUID;
+                                            encoding_uid = LLDB_INVALID_UID;
+                                            resolve_state = Type::eResolveStateFull;
+                                        }
+                                    }
+                                }
                             }
                         }
                     }
@@ -5622,7 +5739,7 @@
                         }
                     }
                     
-                    DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
+                    DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
 
                     int tag_decl_kind = -1;
                     AccessType default_accessibility = eAccessNone;
@@ -5685,7 +5802,7 @@
                                 if (log)
                                 {
                                     GetObjectFile()->GetModule()->LogMessage (log.get(),
-                                                                              "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is an incomplete objc type, complete type is 0x%8.8llx", 
+                                                                              "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is an incomplete objc type, complete type is 0x%8.8" PRIx64,
                                                                               this,
                                                                               die->GetOffset(), 
                                                                               DW_TAG_value_to_name(tag),
@@ -5739,7 +5856,7 @@
                             if (log)
                             {
                                 GetObjectFile()->GetModule()->LogMessage (log.get(),
-                                                                          "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is a forward declaration, complete type is 0x%8.8llx", 
+                                                                          "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is a forward declaration, complete type is 0x%8.8" PRIx64,
                                                                           this,
                                                                           die->GetOffset(), 
                                                                           DW_TAG_value_to_name(tag),
@@ -5946,7 +6063,7 @@
                             }
                         }
 
-                        DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
+                        DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
 
                         clang_type_t enumerator_clang_type = NULL;
                         clang_type = m_forward_decl_die_to_clang_type.lookup (die);
@@ -6033,6 +6150,7 @@
                                     type_name_const_str.SetCString(type_name_cstr);
                                     break;
 
+                                case DW_AT_linkage_name:
                                 case DW_AT_MIPS_linkage_name:   break; // mangled = form_value.AsCString(&get_debug_str_data()); break;
                                 case DW_AT_type:                type_die_offset = form_value.Reference(dwarf_cu); break;
                                 case DW_AT_accessibility:       accessibility = DW_ACCESS_to_AccessType(form_value.Unsigned()); break;
@@ -6105,7 +6223,7 @@
                         }
                     }
                     
-                    DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
+                    DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
 
                     clang_type_t return_clang_type = NULL;
                     Type *func_type = NULL;
@@ -6256,7 +6374,7 @@
                                         }
                                         else
                                         {
-                                            GetObjectFile()->GetModule()->ReportWarning ("0x%8.8llx: DW_AT_specification(0x%8.8x) has no decl\n", 
+                                            GetObjectFile()->GetModule()->ReportWarning ("0x%8.8" PRIx64 ": DW_AT_specification(0x%8.8x) has no decl\n",
                                                                                          MakeUserID(die->GetOffset()), 
                                                                                          specification_die_offset);
                                         }
@@ -6279,7 +6397,7 @@
                                         }
                                         else
                                         {
-                                            GetObjectFile()->GetModule()->ReportWarning ("0x%8.8llx: DW_AT_abstract_origin(0x%8.8x) has no decl\n", 
+                                            GetObjectFile()->GetModule()->ReportWarning ("0x%8.8" PRIx64 ": DW_AT_abstract_origin(0x%8.8x) has no decl\n",
                                                                                          MakeUserID(die->GetOffset()), 
                                                                                          abstract_origin_die_offset);
                                         }
@@ -6308,7 +6426,7 @@
                                                 {
                                                     clang::CXXMethodDecl *cxx_method_decl;
                                                     // REMOVE THE CRASH DESCRIPTION BELOW
-                                                    Host::SetCrashDescriptionWithFormat ("SymbolFileDWARF::ParseType() is adding a method %s to class %s in DIE 0x%8.8llx from %s/%s", 
+                                                    Host::SetCrashDescriptionWithFormat ("SymbolFileDWARF::ParseType() is adding a method %s to class %s in DIE 0x%8.8" PRIx64 " from %s/%s",
                                                                                          type_name_cstr, 
                                                                                          class_type->GetName().GetCString(),
                                                                                          MakeUserID(die->GetOffset()),
@@ -6494,7 +6612,7 @@
                             }
                         }
 
-                        DEBUG_PRINTF ("0x%8.8llx: %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
+                        DEBUG_PRINTF ("0x%8.8" PRIx64 ": %s (\"%s\")\n", MakeUserID(die->GetOffset()), DW_TAG_value_to_name(tag), type_name_cstr);
 
                         Type *element_type = ResolveTypeUID(type_die_offset);
 
@@ -6513,10 +6631,9 @@
                             {
                                 num_elements = *pos;
                                 clang_type = ast.CreateArrayType (array_element_type, 
-                                                                  num_elements, 
-                                                                  num_elements * array_element_bit_stride);
+                                                                  num_elements);
                                 array_element_type = clang_type;
-                                array_element_bit_stride = array_element_bit_stride * num_elements;
+                                array_element_bit_stride = num_elements ? array_element_bit_stride * num_elements : array_element_bit_stride;
                             }
                             ConstString empty_name;
                             type_sp.reset( new Type (MakeUserID(die->GetOffset()), 
@@ -6871,6 +6988,7 @@
                     case DW_AT_decl_line:   decl.SetLine(form_value.Unsigned()); break;
                     case DW_AT_decl_column: decl.SetColumn(form_value.Unsigned()); break;
                     case DW_AT_name:        name = form_value.AsCString(&get_debug_str_data()); break;
+                    case DW_AT_linkage_name:
                     case DW_AT_MIPS_linkage_name: mangled = form_value.AsCString(&get_debug_str_data()); break;
                     case DW_AT_type:        type_uid = form_value.Reference(dwarf_cu); break;
                     case DW_AT_external:    is_external = form_value.Unsigned() != 0; break;
@@ -7212,7 +7330,7 @@
                             }
                             else
                             {
-                                GetObjectFile()->GetModule()->ReportError ("parent 0x%8.8llx %s with no valid compile unit in symbol context for 0x%8.8llx %s.\n",
+                                GetObjectFile()->GetModule()->ReportError ("parent 0x%8.8" PRIx64 " %s with no valid compile unit in symbol context for 0x%8.8" PRIx64 " %s.\n",
                                                                            MakeUserID(sc_parent_die->GetOffset()),
                                                                            DW_TAG_value_to_name (parent_tag),
                                                                            MakeUserID(orig_die->GetOffset()),
@@ -7256,7 +7374,7 @@
                             break;
                             
                         default:
-                             GetObjectFile()->GetModule()->ReportError ("didn't find appropriate parent DIE for variable list for 0x%8.8llx %s.\n",
+                             GetObjectFile()->GetModule()->ReportError ("didn't find appropriate parent DIE for variable list for 0x%8.8" PRIx64 " %s.\n",
                                                                         MakeUserID(orig_die->GetOffset()),
                                                                         DW_TAG_value_to_name (orig_die->Tag()));
                             break;
@@ -7486,7 +7604,7 @@
     
     if (log)
         GetObjectFile()->GetModule()->LogMessage (log.get(), 
-                                                  "SymbolFileDWARF::LayoutRecordType (record_decl = %p, bit_size = %llu, alignment = %llu, field_offsets[%u],base_offsets[%u], vbase_offsets[%u]) success = %i",
+                                                  "SymbolFileDWARF::LayoutRecordType (record_decl = %p, bit_size = %" PRIu64 ", alignment = %" PRIu64 ", field_offsets[%u],base_offsets[%u], vbase_offsets[%u]) success = %i",
                                                   record_decl,
                                                   bit_size,
                                                   alignment,

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h Tue Jan  8 06:51:53 2013
@@ -59,19 +59,12 @@
 class DWARFFormValue;
 class SymbolFileDWARFDebugMap;
 
-struct BitfieldInfo
-{
-    uint32_t bit_size;
-    uint32_t bit_offset;
-};
-
-typedef std::map<int64_t, BitfieldInfo> BitfieldMap;
-
 class SymbolFileDWARF : public lldb_private::SymbolFile, public lldb_private::UserID
 {
 public:
-    friend class SymbolFileDWARFDebugMap;    
+    friend class SymbolFileDWARFDebugMap;
     friend class DebugMapModule;
+    friend class DWARFCompileUnit;
     //------------------------------------------------------------------
     // Static Functions
     //------------------------------------------------------------------
@@ -353,7 +346,6 @@
                                 std::vector<clang::CXXBaseSpecifier *>& base_classes,
                                 std::vector<int>& member_accessibilities,
                                 DWARFDIECollection& member_function_dies,
-                                BitfieldMap &bitfield_map,
                                 DelayedPropertyList& delayed_properties,
                                 lldb::AccessType &default_accessibility,
                                 bool &is_a_class,

Modified: lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp Tue Jan  8 06:51:53 2013
@@ -223,7 +223,7 @@
     }
     
     virtual SymbolVendor*
-    GetSymbolVendor(bool can_create = true)
+    GetSymbolVendor(bool can_create = true, lldb_private::Stream *feedback_strm = NULL)
     {
         // Scope for locker
         if (m_symfile_ap.get() || can_create == false)
@@ -237,7 +237,7 @@
             if (oso_objfile)
             {
                 Mutex::Locker locker (m_mutex);
-                SymbolVendor* symbol_vendor = Module::GetSymbolVendor(can_create);
+                SymbolVendor* symbol_vendor = Module::GetSymbolVendor(can_create, feedback_strm);
                 if (symbol_vendor)
                 {
                     // Set a a pointer to this class to set our OSO DWARF file know
@@ -448,7 +448,7 @@
             else
             {
                 comp_unit_info->symbol_file_supported = false;
-                return false;
+                return NULL;
             }
         }
         // Always create a new module for .o files. Why? Because we

Modified: lldb/branches/windows/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp Tue Jan  8 06:51:53 2013
@@ -381,66 +381,8 @@
                              uint32_t max_matches, 
                              lldb_private::TypeList& types)
 {
-    if (!append)
-        types.Clear();
-        
-    if (!m_objc_class_name_to_index.IsEmpty())
-    {
-        TypeMap::iterator iter = m_objc_class_types.find(name);
-        
-        if (iter != m_objc_class_types.end())
-        {
-            types.Insert(iter->second);
-            return 1;
-        }
-        
-        const Symtab::NameToIndexMap::Entry *match = m_objc_class_name_to_index.FindFirstValueForName(name.GetCString());
-        
-        if (match == NULL)
-            return 0;
-                    
-        const bool isForwardDecl = false;
-        const bool isInternal = true;
-        
-        ClangASTContext &ast = GetClangASTContext();
-        
-        ClangASTMetadata metadata;
-        metadata.SetUserID(0xffaaffaaffaaffaall);
-        lldb::clang_type_t objc_object_type = ast.CreateObjCClass (name.AsCString(), 
-                                                                   ast.GetTranslationUnitDecl(), 
-                                                                   isForwardDecl, 
-                                                                   isInternal,
-                                                                   &metadata);
-        
-        Declaration decl;
-        
-        lldb::TypeSP type(new Type (match->value,
-                                    this,
-                                    name,
-                                    0,      // byte_size - don't change this from 0, we currently use that to identify these "synthetic" ObjC class types.
-                                    NULL,   // SymbolContextScope*
-                                    0,      // encoding_uid
-                                    Type::eEncodingInvalid,
-                                    decl,
-                                    objc_object_type,
-                                    Type::eResolveStateFull));
-        
-        m_objc_class_types[name] = type;
-        
-        types.Insert(type);
-        
-        return 1;
-    }
-
     return 0;
 }
-//
-//uint32_t
-//SymbolFileSymtab::FindTypes(const SymbolContext& sc, const RegularExpression& regex, bool append, uint32_t max_matches, TypeList& types)
-//{
-//  return 0;
-//}
-
 
 //------------------------------------------------------------------
 // PluginInterface protocol

Modified: lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp (original)
+++ lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp Tue Jan  8 06:51:53 2013
@@ -47,7 +47,7 @@
 
 
 static bool
-UUIDsMatch(Module *module, ObjectFile *ofile)
+UUIDsMatch(Module *module, ObjectFile *ofile, lldb_private::Stream *feedback_strm)
 {
     if (module && ofile)
     {
@@ -56,9 +56,12 @@
 
         if (!ofile->GetUUID(&dsym_uuid))
         {
-            Host::SystemLog (Host::eSystemLogWarning, 
-                             "warning: failed to get the uuid for object file: '%s'\n", 
-                             ofile->GetFileSpec().GetFilename().GetCString());
+            if (feedback_strm)
+            {
+                feedback_strm->PutCString("warning: failed to get the uuid for object file: '");
+                ofile->GetFileSpec().Dump(feedback_strm);
+                feedback_strm->PutCString("\n");
+            }
             return false;
         }
 
@@ -66,18 +69,18 @@
             return true;
 
         // Emit some warning messages since the UUIDs do not match!
-        const FileSpec &m_file_spec = module->GetFileSpec();
-        const FileSpec &o_file_spec = ofile->GetFileSpec();
-        StreamString ss_m_path, ss_o_path;
-        m_file_spec.Dump(&ss_m_path);
-        o_file_spec.Dump(&ss_o_path);
-
-        StreamString ss_m_uuid, ss_o_uuid;
-        module->GetUUID().Dump(&ss_m_uuid);
-        dsym_uuid.Dump(&ss_o_uuid);
-        Host::SystemLog (Host::eSystemLogWarning, 
-                         "warning: UUID mismatch detected between module '%s' (%s) and:\n\t'%s' (%s)\n", 
-                         ss_m_path.GetData(), ss_m_uuid.GetData(), ss_o_path.GetData(), ss_o_uuid.GetData());
+        if (feedback_strm)
+        {
+            feedback_strm->PutCString("warning: UUID mismatch detected between modules:\n    ");
+            module->GetUUID().Dump(feedback_strm);
+            feedback_strm->PutChar(' ');
+            module->GetFileSpec().Dump(feedback_strm);
+            feedback_strm->PutCString("\n    ");
+            dsym_uuid.Dump(feedback_strm);
+            feedback_strm->PutChar(' ');
+            ofile->GetFileSpec().Dump(feedback_strm);
+            feedback_strm->EOL();
+        }
     }
     return false;
 }
@@ -152,7 +155,7 @@
 // also allow for finding separate debug information files.
 //----------------------------------------------------------------------
 SymbolVendor*
-SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp)
+SymbolVendorMacOSX::CreateInstance (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
 {
     if (!module_sp)
         return NULL;
@@ -185,24 +188,22 @@
             {
                 // No symbol file was specified in the module, lets try and find
                 // one ourselves.
-                const FileSpec &file_spec = obj_file->GetFileSpec();
-                if (file_spec)
-                {
-                    ModuleSpec module_spec(file_spec, module_sp->GetArchitecture());
-                    module_spec.GetUUID() = module_sp->GetUUID();
-                    dsym_fspec = Symbols::LocateExecutableSymbolFile (module_spec);
-                    if (module_spec.GetSourceMappingList().GetSize())
-                    {
-                        module_sp->GetSourceMappingList().Append (module_spec.GetSourceMappingList (), true);
-                    }
-                }
+                FileSpec file_spec = obj_file->GetFileSpec();
+                if (!file_spec)
+                    file_spec = module_sp->GetFileSpec();
+                
+                ModuleSpec module_spec(file_spec, module_sp->GetArchitecture());
+                module_spec.GetUUID() = module_sp->GetUUID();
+                dsym_fspec = Symbols::LocateExecutableSymbolFile (module_spec);
+                if (module_spec.GetSourceMappingList().GetSize())
+                    module_sp->GetSourceMappingList().Append (module_spec.GetSourceMappingList (), true);
             }
             
             if (dsym_fspec)
             {
                 DataBufferSP dsym_file_data_sp;
                 dsym_objfile_sp = ObjectFile::FindPlugin(module_sp, &dsym_fspec, 0, dsym_fspec.GetByteSize(), dsym_file_data_sp);
-                if (UUIDsMatch(module_sp.get(), dsym_objfile_sp.get()))
+                if (UUIDsMatch(module_sp.get(), dsym_objfile_sp.get(), feedback_strm))
                 {
                     char dsym_path[PATH_MAX];
                     if (module_sp->GetSourceMappingList().IsEmpty() && dsym_fspec.GetPath(dsym_path, sizeof(dsym_path)))

Modified: lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h (original)
+++ lldb/branches/windows/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h Tue Jan  8 06:51:53 2013
@@ -32,7 +32,7 @@
     GetPluginDescriptionStatic();
 
     static lldb_private::SymbolVendor*
-    CreateInstance (const lldb::ModuleSP &module_sp);
+    CreateInstance (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm);
 
     //------------------------------------------------------------------
     // Constructors and Destructors

Modified: lldb/branches/windows/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp (original)
+++ lldb/branches/windows/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp Tue Jan  8 06:51:53 2013
@@ -9,8 +9,6 @@
 
 #include "UnwindAssemblyInstEmulation.h"
 
-#include "llvm-c/EnhancedDisassembly.h"
-
 #include "lldb/Core/Address.h"
 #include "lldb/Core/ArchSpec.h"
 #include "lldb/Core/DataBufferHeap.h"
@@ -271,7 +269,7 @@
         {
             StreamString strm;
             lldb::addr_t base_addr = range.GetBaseAddress().GetLoadAddress(thread.CalculateTarget().get());
-            strm.Printf ("Resulting unwind rows for [0x%llx - 0x%llx):", base_addr, base_addr + range.GetByteSize());
+            strm.Printf ("Resulting unwind rows for [0x%" PRIx64 " - 0x%" PRIx64 "):", base_addr, base_addr + range.GetByteSize());
             unwind_plan.Dump(strm, &thread, base_addr);
             log->PutCString (strm.GetData());
         }
@@ -403,7 +401,7 @@
     if (log && log->GetVerbose ())
     {
         StreamString strm;
-        strm.Printf ("UnwindAssemblyInstEmulation::ReadMemory    (addr = 0x%16.16llx, dst = %p, dst_len = %llu, context = ", 
+        strm.Printf ("UnwindAssemblyInstEmulation::ReadMemory    (addr = 0x%16.16" PRIx64 ", dst = %p, dst_len = %" PRIu64 ", context = ",
                      addr,
                      dst,
                      (uint64_t)dst_len);
@@ -594,7 +592,6 @@
 
     switch (context.type)
     {
-        default:
         case EmulateInstruction::eContextInvalid:
         case EmulateInstruction::eContextReadOpcode:
         case EmulateInstruction::eContextImmediate:

Modified: lldb/branches/windows/source/Symbol/Block.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/Block.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/Block.cpp (original)
+++ lldb/branches/windows/source/Symbol/Block.cpp Tue Jan  8 06:51:53 2013
@@ -89,7 +89,7 @@
     const Block* parent_block = GetParent();
     if (parent_block)
     {
-        s->Printf(", parent = {0x%8.8llx}", parent_block->GetID());
+        s->Printf(", parent = {0x%8.8" PRIx64 "}", parent_block->GetID());
     }
     if (m_inlineInfoSP.get() != NULL)
     {
@@ -194,7 +194,7 @@
     Function *function = CalculateSymbolContextFunction();
     if (function)
         function->DumpSymbolContext(s);
-    s->Printf(", Block{0x%8.8llx}", GetID());
+    s->Printf(", Block{0x%8.8" PRIx64 "}", GetID());
 }
 
 void
@@ -408,7 +408,7 @@
             const Declaration &func_decl = func_type->GetDeclaration();
             if (func_decl.GetLine())
             {
-                log->Printf ("warning: %s/%s:%u block {0x%8.8llx} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8llx} in function {0x%8.8llx} from %s/%s",
+                log->Printf ("warning: %s/%s:%u block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s/%s",
                              func_decl.GetFile().GetDirectory().GetCString(),
                              func_decl.GetFile().GetFilename().GetCString(),
                              func_decl.GetLine(),
@@ -423,7 +423,7 @@
             }
             else
             {
-                log->Printf ("warning: block {0x%8.8llx} has range[%u] [0x%llx - 0x%llx) which is not contained in parent block {0x%8.8llx} in function {0x%8.8llx} from %s/%s",
+                log->Printf ("warning: block {0x%8.8" PRIx64 "} has range[%u] [0x%" PRIx64 " - 0x%" PRIx64 ") which is not contained in parent block {0x%8.8" PRIx64 "} in function {0x%8.8" PRIx64 "} from %s/%s",
                              GetID(),
                              (uint32_t)m_ranges.GetSize(),
                              block_start_addr,

Modified: lldb/branches/windows/source/Symbol/ClangASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/ClangASTContext.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/ClangASTContext.cpp (original)
+++ lldb/branches/windows/source/Symbol/ClangASTContext.cpp Tue Jan  8 06:51:53 2013
@@ -34,6 +34,7 @@
 
 #include "clang/AST/ASTContext.h"
 #include "clang/AST/ASTImporter.h"
+#include "clang/AST/Attr.h"
 #include "clang/AST/CXXInheritance.h"
 #include "clang/AST/DeclObjC.h"
 #include "clang/AST/DeclTemplate.h"
@@ -194,7 +195,6 @@
 {
     switch (access)
     {
-    default:               break;
     case eAccessNone:      return ObjCIvarDecl::None;
     case eAccessPublic:    return ObjCIvarDecl::Public;
     case eAccessPrivate:   return ObjCIvarDecl::Private;
@@ -261,7 +261,7 @@
     Opts.LineComment = Std.hasLineComments();
     Opts.C99 = Std.isC99();
     Opts.CPlusPlus = Std.isCPlusPlus();
-    Opts.CPlusPlus0x = Std.isCPlusPlus0x();
+    Opts.CPlusPlus11 = Std.isCPlusPlus11();
     Opts.Digraphs = Std.hasDigraphs();
     Opts.GNUMode = Std.isGNUMode();
     Opts.GNUInline = !Std.isC99();
@@ -708,8 +708,6 @@
         if (bit_size && !(bit_size & 0x7u))
             return ast->getExtVectorType (ast->UnsignedCharTy, bit_size/8).getAsOpaquePtr();
         break;
-    default:
-        break;
     }
     
     return NULL;
@@ -1280,9 +1278,11 @@
     DeclarationName decl_name (&identifier_info);
 
     clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
-    for (clang::DeclContext::lookup_iterator pos = result.first, end = result.second; pos != end; ++pos) 
+    
+    
+    for (auto decl = result.begin(); decl != result.end(); ++decl) 
     {
-        class_template_decl = dyn_cast<clang::ClassTemplateDecl>(*pos);
+        class_template_decl = dyn_cast<clang::ClassTemplateDecl>(*decl);
         if (class_template_decl)
             return class_template_decl;
     }
@@ -2046,14 +2046,14 @@
     typedef llvm::SmallVector <IndirectFieldDecl *, 1> IndirectFieldVector;
     
     IndirectFieldVector indirect_fields;
-    
-    for (RecordDecl::field_iterator fi = record_decl->field_begin(), fe = record_decl->field_end();
-         fi != fe;
-         ++fi)
+    RecordDecl::field_iterator field_pos;
+    RecordDecl::field_iterator field_end_pos = record_decl->field_end();
+    RecordDecl::field_iterator last_field_pos = field_end_pos;
+    for (field_pos = record_decl->field_begin(); field_pos != field_end_pos; last_field_pos = field_pos++)
     {
-        if (fi->isAnonymousStructOrUnion())
+        if (field_pos->isAnonymousStructOrUnion())
         {
-            QualType field_qual_type = fi->getType();
+            QualType field_qual_type = field_pos->getType();
             
             const RecordType *field_record_type = field_qual_type->getAs<RecordType>();
             
@@ -2072,7 +2072,7 @@
                 if (FieldDecl *nested_field_decl = dyn_cast<FieldDecl>(*di))
                 {
                     NamedDecl **chain = new (*ast) NamedDecl*[2];
-                    chain[0] = *fi;
+                    chain[0] = *field_pos;
                     chain[1] = nested_field_decl;
                     IndirectFieldDecl *indirect_field = IndirectFieldDecl::Create(*ast,
                                                                                   record_decl,
@@ -2082,7 +2082,7 @@
                                                                                   chain,
                                                                                   2);
                     
-                    indirect_field->setAccess(UnifyAccessSpecifiers(fi->getAccess(),
+                    indirect_field->setAccess(UnifyAccessSpecifiers(field_pos->getAccess(),
                                                                     nested_field_decl->getAccess()));
                     
                     indirect_fields.push_back(indirect_field);
@@ -2091,7 +2091,7 @@
                 {
                     int nested_chain_size = nested_indirect_field_decl->getChainingSize();
                     NamedDecl **chain = new (*ast) NamedDecl*[nested_chain_size + 1];
-                    chain[0] = *fi;
+                    chain[0] = *field_pos;
                     
                     int chain_index = 1;
                     for (IndirectFieldDecl::chain_iterator nci = nested_indirect_field_decl->chain_begin(),
@@ -2111,7 +2111,7 @@
                                                                                   chain,
                                                                                   nested_chain_size + 1);
                                         
-                    indirect_field->setAccess(UnifyAccessSpecifiers(fi->getAccess(),
+                    indirect_field->setAccess(UnifyAccessSpecifiers(field_pos->getAccess(),
                                                                     nested_indirect_field_decl->getAccess()));
                     
                     indirect_fields.push_back(indirect_field);
@@ -2120,6 +2120,14 @@
         }
     }
     
+    // Check the last field to see if it has an incomplete array type as its
+    // last member and if it does, the tell the record decl about it
+    if (last_field_pos != field_end_pos)
+    {
+        if (last_field_pos->getType()->isIncompleteArrayType())
+            record_decl->hasFlexibleArrayMember();
+    }
+    
     for (IndirectFieldVector::iterator ifi = indirect_fields.begin(), ife = indirect_fields.end();
          ifi < ife;
          ++ifi)
@@ -2787,6 +2795,10 @@
                 
             case clang::Type::Typedef:                         
                 return ClangASTContext::GetNumTemplateArguments (ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr());
+                
+            case clang::Type::Elaborated:
+                return ClangASTContext::GetNumTemplateArguments (ast, cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());
+
             default:
                 break;
         }
@@ -2860,6 +2872,10 @@
                 
             case clang::Type::Typedef:                         
                 return ClangASTContext::GetTemplateArgument (ast, cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), arg_idx, kind);
+
+            case clang::Type::Elaborated:
+                return ClangASTContext::GetTemplateArgument (ast, cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(), arg_idx, kind);
+                
             default:
                 break;
         }
@@ -3864,17 +3880,19 @@
     if (parent_clang_type == NULL)
         return NULL;
 
-    if (idx < ClangASTContext::GetNumChildren (ast, parent_clang_type, omit_empty_base_classes))
+    QualType parent_qual_type(QualType::getFromOpaquePtr(parent_clang_type));
+    const clang::Type::TypeClass parent_type_class = parent_qual_type->getTypeClass();
+    child_bitfield_bit_size = 0;
+    child_bitfield_bit_offset = 0;
+    child_is_base_class = false;
+
+    const bool idx_is_valid = idx < ClangASTContext::GetNumChildren (ast, parent_clang_type, omit_empty_base_classes);
+    uint32_t bit_offset;
+    switch (parent_type_class)
     {
-        uint32_t bit_offset;
-        child_bitfield_bit_size = 0;
-        child_bitfield_bit_offset = 0;
-        child_is_base_class = false;
-        QualType parent_qual_type(QualType::getFromOpaquePtr(parent_clang_type));
-        const clang::Type::TypeClass parent_type_class = parent_qual_type->getTypeClass();
-        switch (parent_type_class)
+    case clang::Type::Builtin:
+        if (idx_is_valid)
         {
-        case clang::Type::Builtin:
             switch (cast<clang::BuiltinType>(parent_qual_type)->getKind())
             {
             case clang::BuiltinType::ObjCId:
@@ -3886,270 +3904,272 @@
             default:
                 break;
             }
-            break;
+        }
+        break;
 
-        case clang::Type::Record:
-            if (GetCompleteQualType (ast, parent_qual_type))
-            {
-                const RecordType *record_type = cast<RecordType>(parent_qual_type.getTypePtr());
-                const RecordDecl *record_decl = record_type->getDecl();
-                assert(record_decl);
-                const ASTRecordLayout &record_layout = ast->getASTRecordLayout(record_decl);
-                uint32_t child_idx = 0;
+    case clang::Type::Record:
+        if (idx_is_valid && GetCompleteQualType (ast, parent_qual_type))
+        {
+            const RecordType *record_type = cast<RecordType>(parent_qual_type.getTypePtr());
+            const RecordDecl *record_decl = record_type->getDecl();
+            assert(record_decl);
+            const ASTRecordLayout &record_layout = ast->getASTRecordLayout(record_decl);
+            uint32_t child_idx = 0;
 
-                const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
-                if (cxx_record_decl)
+            const CXXRecordDecl *cxx_record_decl = dyn_cast<CXXRecordDecl>(record_decl);
+            if (cxx_record_decl)
+            {
+                // We might have base classes to print out first
+                CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
+                for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
+                     base_class != base_class_end;
+                     ++base_class)
                 {
-                    // We might have base classes to print out first
-                    CXXRecordDecl::base_class_const_iterator base_class, base_class_end;
-                    for (base_class = cxx_record_decl->bases_begin(), base_class_end = cxx_record_decl->bases_end();
-                         base_class != base_class_end;
-                         ++base_class)
+                    const CXXRecordDecl *base_class_decl = NULL;
+
+                    // Skip empty base classes
+                    if (omit_empty_base_classes)
                     {
-                        const CXXRecordDecl *base_class_decl = NULL;
+                        base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
+                        if (RecordHasFields(base_class_decl) == false)
+                            continue;
+                    }
 
-                        // Skip empty base classes
-                        if (omit_empty_base_classes)
-                        {
+                    if (idx == child_idx)
+                    {
+                        if (base_class_decl == NULL)
                             base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
-                            if (RecordHasFields(base_class_decl) == false)
-                                continue;
-                        }
-
-                        if (idx == child_idx)
-                        {
-                            if (base_class_decl == NULL)
-                                base_class_decl = cast<CXXRecordDecl>(base_class->getType()->getAs<RecordType>()->getDecl());
 
 
-                            if (base_class->isVirtual())
-                                bit_offset = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
-                            else
-                                bit_offset = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8;
+                        if (base_class->isVirtual())
+                            bit_offset = record_layout.getVBaseClassOffset(base_class_decl).getQuantity() * 8;
+                        else
+                            bit_offset = record_layout.getBaseClassOffset(base_class_decl).getQuantity() * 8;
 
-                            // Base classes should be a multiple of 8 bits in size
-                            child_byte_offset = bit_offset/8;
-                            
-                            child_name = ClangASTType::GetTypeNameForQualType(ast, base_class->getType());
+                        // Base classes should be a multiple of 8 bits in size
+                        child_byte_offset = bit_offset/8;
+                        
+                        child_name = ClangASTType::GetTypeNameForQualType(ast, base_class->getType());
 
-                            uint64_t clang_type_info_bit_size = ast->getTypeSize(base_class->getType());
+                        uint64_t clang_type_info_bit_size = ast->getTypeSize(base_class->getType());
 
-                            // Base classes bit sizes should be a multiple of 8 bits in size
-                            assert (clang_type_info_bit_size % 8 == 0);
-                            child_byte_size = clang_type_info_bit_size / 8;
-                            child_is_base_class = true;
-                            return base_class->getType().getAsOpaquePtr();
-                        }
-                        // We don't increment the child index in the for loop since we might
-                        // be skipping empty base classes
-                        ++child_idx;
+                        // Base classes bit sizes should be a multiple of 8 bits in size
+                        assert (clang_type_info_bit_size % 8 == 0);
+                        child_byte_size = clang_type_info_bit_size / 8;
+                        child_is_base_class = true;
+                        return base_class->getType().getAsOpaquePtr();
                     }
+                    // We don't increment the child index in the for loop since we might
+                    // be skipping empty base classes
+                    ++child_idx;
                 }
-                // Make sure index is in range...
-                uint32_t field_idx = 0;
-                RecordDecl::field_iterator field, field_end;
-                for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx, ++child_idx)
+            }
+            // Make sure index is in range...
+            uint32_t field_idx = 0;
+            RecordDecl::field_iterator field, field_end;
+            for (field = record_decl->field_begin(), field_end = record_decl->field_end(); field != field_end; ++field, ++field_idx, ++child_idx)
+            {
+                if (idx == child_idx)
                 {
-                    if (idx == child_idx)
-                    {
-                        // Print the member type if requested
-                        // Print the member name and equal sign
-                        child_name.assign(field->getNameAsString().c_str());
+                    // Print the member type if requested
+                    // Print the member name and equal sign
+                    child_name.assign(field->getNameAsString().c_str());
 
-                        // Figure out the type byte size (field_type_info.first) and
-                        // alignment (field_type_info.second) from the AST context.
-                        std::pair<uint64_t, unsigned> field_type_info = ast->getTypeInfo(field->getType());
-                        assert(field_idx < record_layout.getFieldCount());
+                    // Figure out the type byte size (field_type_info.first) and
+                    // alignment (field_type_info.second) from the AST context.
+                    std::pair<uint64_t, unsigned> field_type_info = ast->getTypeInfo(field->getType());
+                    assert(field_idx < record_layout.getFieldCount());
 
-                        child_byte_size = field_type_info.first / 8;
+                    child_byte_size = field_type_info.first / 8;
 
-                        // Figure out the field offset within the current struct/union/class type
-                        bit_offset = record_layout.getFieldOffset (field_idx);
-                        child_byte_offset = bit_offset / 8;
-                        if (ClangASTContext::FieldIsBitfield (ast, *field, child_bitfield_bit_size))
-                            child_bitfield_bit_offset = bit_offset % 8;
+                    // Figure out the field offset within the current struct/union/class type
+                    bit_offset = record_layout.getFieldOffset (field_idx);
+                    child_byte_offset = bit_offset / 8;
+                    if (ClangASTContext::FieldIsBitfield (ast, *field, child_bitfield_bit_size))
+                        child_bitfield_bit_offset = bit_offset % 8;
 
-                        return field->getType().getAsOpaquePtr();
-                    }
+                    return field->getType().getAsOpaquePtr();
                 }
             }
-            break;
+        }
+        break;
 
-        case clang::Type::ObjCObject:
-        case clang::Type::ObjCInterface:
-            if (GetCompleteQualType (ast, parent_qual_type))
+    case clang::Type::ObjCObject:
+    case clang::Type::ObjCInterface:
+        if (idx_is_valid && GetCompleteQualType (ast, parent_qual_type))
+        {
+            const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(parent_qual_type.getTypePtr());
+            assert (objc_class_type);
+            if (objc_class_type)
             {
-                const ObjCObjectType *objc_class_type = dyn_cast<ObjCObjectType>(parent_qual_type.getTypePtr());
-                assert (objc_class_type);
-                if (objc_class_type)
+                uint32_t child_idx = 0;
+                ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
+            
+                if (class_interface_decl)
                 {
-                    uint32_t child_idx = 0;
-                    ObjCInterfaceDecl *class_interface_decl = objc_class_type->getInterface();
-                
-                    if (class_interface_decl)
+            
+                    const ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
+                    ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
+                    if (superclass_interface_decl)
                     {
-                
-                        const ASTRecordLayout &interface_layout = ast->getASTObjCInterfaceLayout(class_interface_decl);
-                        ObjCInterfaceDecl *superclass_interface_decl = class_interface_decl->getSuperClass();
-                        if (superclass_interface_decl)
+                        if (omit_empty_base_classes)
                         {
-                            if (omit_empty_base_classes)
+                            if (ClangASTContext::GetNumChildren(ast, ast->getObjCInterfaceType(superclass_interface_decl).getAsOpaquePtr(), omit_empty_base_classes) > 0)
                             {
-                                if (ClangASTContext::GetNumChildren(ast, ast->getObjCInterfaceType(superclass_interface_decl).getAsOpaquePtr(), omit_empty_base_classes) > 0)
+                                if (idx == 0)
                                 {
-                                    if (idx == 0)
-                                    {
-                                        QualType ivar_qual_type(ast->getObjCInterfaceType(superclass_interface_decl));
-                                        
-
-                                        child_name.assign(superclass_interface_decl->getNameAsString().c_str());
+                                    QualType ivar_qual_type(ast->getObjCInterfaceType(superclass_interface_decl));
+                                    
 
-                                        std::pair<uint64_t, unsigned> ivar_type_info = ast->getTypeInfo(ivar_qual_type.getTypePtr());
+                                    child_name.assign(superclass_interface_decl->getNameAsString().c_str());
 
-                                        child_byte_size = ivar_type_info.first / 8;
-                                        child_byte_offset = 0;
-                                        child_is_base_class = true;
+                                    std::pair<uint64_t, unsigned> ivar_type_info = ast->getTypeInfo(ivar_qual_type.getTypePtr());
 
-                                        return ivar_qual_type.getAsOpaquePtr();
-                                    }
+                                    child_byte_size = ivar_type_info.first / 8;
+                                    child_byte_offset = 0;
+                                    child_is_base_class = true;
 
-                                    ++child_idx;
+                                    return ivar_qual_type.getAsOpaquePtr();
                                 }
-                            }
-                            else
+
                                 ++child_idx;
+                            }
                         }
-    
-                        const uint32_t superclass_idx = child_idx;
+                        else
+                            ++child_idx;
+                    }
+
+                    const uint32_t superclass_idx = child_idx;
 
-                        if (idx < (child_idx + class_interface_decl->ivar_size()))
+                    if (idx < (child_idx + class_interface_decl->ivar_size()))
+                    {
+                        ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
+                        
+                        for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos)
                         {
-                            ObjCInterfaceDecl::ivar_iterator ivar_pos, ivar_end = class_interface_decl->ivar_end();
-                            
-                            for (ivar_pos = class_interface_decl->ivar_begin(); ivar_pos != ivar_end; ++ivar_pos)
+                            if (child_idx == idx)
                             {
-                                if (child_idx == idx)
+                                ObjCIvarDecl* ivar_decl = *ivar_pos;
+                                
+                                QualType ivar_qual_type(ivar_decl->getType());
+
+                                child_name.assign(ivar_decl->getNameAsString().c_str());
+
+                                std::pair<uint64_t, unsigned> ivar_type_info = ast->getTypeInfo(ivar_qual_type.getTypePtr());
+
+                                child_byte_size = ivar_type_info.first / 8;
+
+                                // Figure out the field offset within the current struct/union/class type
+                                // For ObjC objects, we can't trust the bit offset we get from the Clang AST, since
+                                // that doesn't account for the space taken up by unbacked properties, or from 
+                                // the changing size of base classes that are newer than this class.
+                                // So if we have a process around that we can ask about this object, do so.
+                                child_byte_offset = LLDB_INVALID_IVAR_OFFSET;
+                                Process *process = NULL;
+                                if (exe_ctx)
+                                    process = exe_ctx->GetProcessPtr();
+                                if (process)
                                 {
-                                    ObjCIvarDecl* ivar_decl = *ivar_pos;
-                                    
-                                    QualType ivar_qual_type(ivar_decl->getType());
-
-                                    child_name.assign(ivar_decl->getNameAsString().c_str());
-
-                                    std::pair<uint64_t, unsigned> ivar_type_info = ast->getTypeInfo(ivar_qual_type.getTypePtr());
-
-                                    child_byte_size = ivar_type_info.first / 8;
-
-                                    // Figure out the field offset within the current struct/union/class type
-                                    // For ObjC objects, we can't trust the bit offset we get from the Clang AST, since
-                                    // that doesn't account for the space taken up by unbacked properties, or from 
-                                    // the changing size of base classes that are newer than this class.
-                                    // So if we have a process around that we can ask about this object, do so.
-                                    child_byte_offset = LLDB_INVALID_IVAR_OFFSET;
-                                    Process *process = NULL;
-                                    if (exe_ctx)
-                                        process = exe_ctx->GetProcessPtr();
-                                    if (process)
+                                    ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime();
+                                    if (objc_runtime != NULL)
                                     {
-                                        ObjCLanguageRuntime *objc_runtime = process->GetObjCLanguageRuntime();
-                                        if (objc_runtime != NULL)
-                                        {
-                                            ClangASTType parent_ast_type (ast, parent_qual_type.getAsOpaquePtr());
-                                            child_byte_offset = objc_runtime->GetByteOffsetForIvar (parent_ast_type, ivar_decl->getNameAsString().c_str());
-                                        }
+                                        ClangASTType parent_ast_type (ast, parent_qual_type.getAsOpaquePtr());
+                                        child_byte_offset = objc_runtime->GetByteOffsetForIvar (parent_ast_type, ivar_decl->getNameAsString().c_str());
                                     }
-                                    
-                                    // Setting this to UINT32_MAX to make sure we don't compute it twice...
-                                    bit_offset = UINT32_MAX;
-                                    
-                                    if (child_byte_offset == LLDB_INVALID_IVAR_OFFSET)
-                                    {
+                                }
+                                
+                                // Setting this to UINT32_MAX to make sure we don't compute it twice...
+                                bit_offset = UINT32_MAX;
+                                
+                                if (child_byte_offset == LLDB_INVALID_IVAR_OFFSET)
+                                {
+                                    bit_offset = interface_layout.getFieldOffset (child_idx - superclass_idx);
+                                    child_byte_offset = bit_offset / 8;
+                                }
+                                
+                                // Note, the ObjC Ivar Byte offset is just that, it doesn't account for the bit offset
+                                // of a bitfield within its containing object.  So regardless of where we get the byte
+                                // offset from, we still need to get the bit offset for bitfields from the layout.
+                                
+                                if (ClangASTContext::FieldIsBitfield (ast, ivar_decl, child_bitfield_bit_size))
+                                {
+                                    if (bit_offset == UINT32_MAX)
                                         bit_offset = interface_layout.getFieldOffset (child_idx - superclass_idx);
-                                        child_byte_offset = bit_offset / 8;
-                                    }
-                                    
-                                    // Note, the ObjC Ivar Byte offset is just that, it doesn't account for the bit offset
-                                    // of a bitfield within its containing object.  So regardless of where we get the byte
-                                    // offset from, we still need to get the bit offset for bitfields from the layout.
-                                    
-                                    if (ClangASTContext::FieldIsBitfield (ast, ivar_decl, child_bitfield_bit_size))
-                                    {
-                                        if (bit_offset == UINT32_MAX)
-                                            bit_offset = interface_layout.getFieldOffset (child_idx - superclass_idx);
-                                            
-                                        child_bitfield_bit_offset = bit_offset % 8;
-                                    }
-                                    return ivar_qual_type.getAsOpaquePtr();
+                                        
+                                    child_bitfield_bit_offset = bit_offset % 8;
                                 }
-                                ++child_idx;
+                                return ivar_qual_type.getAsOpaquePtr();
                             }
+                            ++child_idx;
                         }
                     }
                 }
             }
-            break;
-            
-        case clang::Type::ObjCObjectPointer:
-            {
-                const ObjCObjectPointerType *pointer_type = cast<ObjCObjectPointerType>(parent_qual_type.getTypePtr());
-                QualType pointee_type = pointer_type->getPointeeType();
+        }
+        break;
+        
+    case clang::Type::ObjCObjectPointer:
+        if (idx_is_valid)
+        {
+            const ObjCObjectPointerType *pointer_type = cast<ObjCObjectPointerType>(parent_qual_type.getTypePtr());
+            QualType pointee_type = pointer_type->getPointeeType();
 
-                if (transparent_pointers && ClangASTContext::IsAggregateType (pointee_type.getAsOpaquePtr()))
+            if (transparent_pointers && ClangASTContext::IsAggregateType (pointee_type.getAsOpaquePtr()))
+            {
+                child_is_deref_of_parent = false;
+                bool tmp_child_is_deref_of_parent = false;
+                return GetChildClangTypeAtIndex (exe_ctx,
+                                                 ast,
+                                                 parent_name,
+                                                 pointer_type->getPointeeType().getAsOpaquePtr(),
+                                                 idx,
+                                                 transparent_pointers,
+                                                 omit_empty_base_classes,
+                                                 ignore_array_bounds,
+                                                 child_name,
+                                                 child_byte_size,
+                                                 child_byte_offset,
+                                                 child_bitfield_bit_size,
+                                                 child_bitfield_bit_offset,
+                                                 child_is_base_class,
+                                                 tmp_child_is_deref_of_parent);
+            }
+            else
+            {
+                child_is_deref_of_parent = true;
+                if (parent_name)
                 {
-                    child_is_deref_of_parent = false;
-                    bool tmp_child_is_deref_of_parent = false;
-                    return GetChildClangTypeAtIndex (exe_ctx,
-                                                     ast,
-                                                     parent_name,
-                                                     pointer_type->getPointeeType().getAsOpaquePtr(),
-                                                     idx,
-                                                     transparent_pointers,
-                                                     omit_empty_base_classes,
-                                                     ignore_array_bounds,
-                                                     child_name,
-                                                     child_byte_size,
-                                                     child_byte_offset,
-                                                     child_bitfield_bit_size,
-                                                     child_bitfield_bit_offset,
-                                                     child_is_base_class,
-                                                     tmp_child_is_deref_of_parent);
+                    child_name.assign(1, '*');
+                    child_name += parent_name;
                 }
-                else
-                {
-                    child_is_deref_of_parent = true;
-                    if (parent_name)
-                    {
-                        child_name.assign(1, '*');
-                        child_name += parent_name;
-                    }
 
-                    // We have a pointer to an simple type
-                    if (idx == 0 && GetCompleteQualType(ast, pointee_type))
-                    {
-                        std::pair<uint64_t, unsigned> clang_type_info = ast->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();
-                    }
+                // We have a pointer to an simple type
+                if (idx == 0 && GetCompleteQualType(ast, pointee_type))
+                {
+                    std::pair<uint64_t, unsigned> clang_type_info = ast->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;
+        }
+        break;
 
         case clang::Type::ConstantArray:
+        case clang::Type::IncompleteArray:
+            if (ignore_array_bounds || idx_is_valid)
             {
-                const ConstantArrayType *array = cast<ConstantArrayType>(parent_qual_type.getTypePtr());
-                const uint64_t element_count = array->getSize().getLimitedValue();
-
-                if (ignore_array_bounds || idx < element_count)
+                const ArrayType *array = cast<ArrayType>(parent_qual_type.getTypePtr());
+                if (array)
                 {
                     if (GetCompleteQualType (ast, array->getElementType()))
                     {
                         std::pair<uint64_t, unsigned> field_type_info = ast->getTypeInfo(array->getElementType());
-
+                        
                         char element_name[64];
                         ::snprintf (element_name, sizeof (element_name), "[%u]", idx);
-
+                        
                         child_name.assign(element_name);
                         assert(field_type_info.first % 8 == 0);
                         child_byte_size = field_type_info.first / 8;
@@ -4159,144 +4179,146 @@
                 }
             }
             break;
+            
 
-        case clang::Type::Pointer:
+    case clang::Type::Pointer:
+        if (idx_is_valid)
+        {
+            const PointerType *pointer_type = cast<PointerType>(parent_qual_type.getTypePtr());
+            QualType pointee_type = pointer_type->getPointeeType();
+            
+            // Don't dereference "void *" pointers
+            if (pointee_type->isVoidType())
+                return NULL;
+
+            if (transparent_pointers && ClangASTContext::IsAggregateType (pointee_type.getAsOpaquePtr()))
+            {
+                child_is_deref_of_parent = false;
+                bool tmp_child_is_deref_of_parent = false;
+                return GetChildClangTypeAtIndex (exe_ctx,
+                                                 ast,
+                                                 parent_name,
+                                                 pointer_type->getPointeeType().getAsOpaquePtr(),
+                                                 idx,
+                                                 transparent_pointers,
+                                                 omit_empty_base_classes,
+                                                 ignore_array_bounds,
+                                                 child_name,
+                                                 child_byte_size,
+                                                 child_byte_offset,
+                                                 child_bitfield_bit_size,
+                                                 child_bitfield_bit_offset,
+                                                 child_is_base_class,
+                                                 tmp_child_is_deref_of_parent);
+            }
+            else
             {
-                const PointerType *pointer_type = cast<PointerType>(parent_qual_type.getTypePtr());
-                QualType pointee_type = pointer_type->getPointeeType();
-                
-                // Don't dereference "void *" pointers
-                if (pointee_type->isVoidType())
-                    return NULL;
+                child_is_deref_of_parent = true;
 
-                if (transparent_pointers && ClangASTContext::IsAggregateType (pointee_type.getAsOpaquePtr()))
+                if (parent_name)
                 {
-                    child_is_deref_of_parent = false;
-                    bool tmp_child_is_deref_of_parent = false;
-                    return GetChildClangTypeAtIndex (exe_ctx,
-                                                     ast,
-                                                     parent_name,
-                                                     pointer_type->getPointeeType().getAsOpaquePtr(),
-                                                     idx,
-                                                     transparent_pointers,
-                                                     omit_empty_base_classes,
-                                                     ignore_array_bounds,
-                                                     child_name,
-                                                     child_byte_size,
-                                                     child_byte_offset,
-                                                     child_bitfield_bit_size,
-                                                     child_bitfield_bit_offset,
-                                                     child_is_base_class,
-                                                     tmp_child_is_deref_of_parent);
+                    child_name.assign(1, '*');
+                    child_name += parent_name;
                 }
-                else
-                {
-                    child_is_deref_of_parent = true;
 
-                    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->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();
-                    }
+                // We have a pointer to an simple type
+                if (idx == 0)
+                {
+                    std::pair<uint64_t, unsigned> clang_type_info = ast->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;
+        }
+        break;
 
-        case clang::Type::LValueReference:
-        case clang::Type::RValueReference:
+    case clang::Type::LValueReference:
+    case clang::Type::RValueReference:
+        if (idx_is_valid)
+        {
+            const 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))
+            {
+                child_is_deref_of_parent = false;
+                bool tmp_child_is_deref_of_parent = false;
+                return GetChildClangTypeAtIndex (exe_ctx,
+                                                 ast,
+                                                 parent_name,
+                                                 pointee_clang_type,
+                                                 idx,
+                                                 transparent_pointers,
+                                                 omit_empty_base_classes,
+                                                 ignore_array_bounds,
+                                                 child_name,
+                                                 child_byte_size,
+                                                 child_byte_offset,
+                                                 child_bitfield_bit_size,
+                                                 child_bitfield_bit_offset,
+                                                 child_is_base_class,
+                                                 tmp_child_is_deref_of_parent);
+            }
+            else
             {
-                const 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))
-                {
-                    child_is_deref_of_parent = false;
-                    bool tmp_child_is_deref_of_parent = false;
-                    return GetChildClangTypeAtIndex (exe_ctx,
-                                                     ast,
-                                                     parent_name,
-                                                     pointee_clang_type,
-                                                     idx,
-                                                     transparent_pointers,
-                                                     omit_empty_base_classes,
-                                                     ignore_array_bounds,
-                                                     child_name,
-                                                     child_byte_size,
-                                                     child_byte_offset,
-                                                     child_bitfield_bit_size,
-                                                     child_bitfield_bit_offset,
-                                                     child_is_base_class,
-                                                     tmp_child_is_deref_of_parent);
-                }
-                else
+                if (parent_name)
                 {
-                    if (parent_name)
-                    {
-                        child_name.assign(1, '&');
-                        child_name += 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->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();
-                    }
+                // We have a pointer to an simple type
+                if (idx == 0)
+                {
+                    std::pair<uint64_t, unsigned> clang_type_info = ast->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;
+        }
+        break;
 
-        case clang::Type::Typedef:
-            return GetChildClangTypeAtIndex (exe_ctx,
-                                             ast,
-                                             parent_name,
-                                             cast<TypedefType>(parent_qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
-                                             idx,
-                                             transparent_pointers,
-                                             omit_empty_base_classes,
-                                             ignore_array_bounds,
-                                             child_name,
-                                             child_byte_size,
-                                             child_byte_offset,
-                                             child_bitfield_bit_size,
-                                             child_bitfield_bit_offset,
-                                             child_is_base_class,
-                                             child_is_deref_of_parent);
-            break;
-    
-        case clang::Type::Elaborated:
-            return GetChildClangTypeAtIndex (exe_ctx,
-                                             ast,
-                                             parent_name,
-                                             cast<ElaboratedType>(parent_qual_type)->getNamedType().getAsOpaquePtr(),
-                                             idx,
-                                             transparent_pointers,
-                                             omit_empty_base_classes,
-                                             ignore_array_bounds,
-                                             child_name,
-                                             child_byte_size,
-                                             child_byte_offset,
-                                             child_bitfield_bit_size,
-                                             child_bitfield_bit_offset,
-                                             child_is_base_class,
-                                             child_is_deref_of_parent); 
+    case clang::Type::Typedef:
+        return GetChildClangTypeAtIndex (exe_ctx,
+                                         ast,
+                                         parent_name,
+                                         cast<TypedefType>(parent_qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
+                                         idx,
+                                         transparent_pointers,
+                                         omit_empty_base_classes,
+                                         ignore_array_bounds,
+                                         child_name,
+                                         child_byte_size,
+                                         child_byte_offset,
+                                         child_bitfield_bit_size,
+                                         child_bitfield_bit_offset,
+                                         child_is_base_class,
+                                         child_is_deref_of_parent);
+        break;
 
-        default:
-            break;
-        }
+    case clang::Type::Elaborated:
+        return GetChildClangTypeAtIndex (exe_ctx,
+                                         ast,
+                                         parent_name,
+                                         cast<ElaboratedType>(parent_qual_type)->getNamedType().getAsOpaquePtr(),
+                                         idx,
+                                         transparent_pointers,
+                                         omit_empty_base_classes,
+                                         ignore_array_bounds,
+                                         child_name,
+                                         child_byte_size,
+                                         child_byte_offset,
+                                         child_bitfield_bit_size,
+                                         child_bitfield_bit_offset,
+                                         child_is_base_class,
+                                         child_is_deref_of_parent); 
+
+    default:
+        break;
     }
     return NULL;
 }
@@ -4553,12 +4575,9 @@
                                     parent_record_decl = cast<RecordDecl>(elem.Base->getType()->getAs<RecordType>()->getDecl());
                                 }
                             }
-                            DeclContext::lookup_iterator named_decl_pos;
-                            for (named_decl_pos = path->Decls.first;
-                                 named_decl_pos != path->Decls.second && parent_record_decl;
-                                 ++named_decl_pos)
+                            for (auto path_decl = path->Decls.begin(); path_decl != path->Decls.end(); ++path_decl)
                             {
-                                child_idx = GetIndexForRecordChild (parent_record_decl, *named_decl_pos, omit_empty_base_classes);
+                                child_idx = GetIndexForRecordChild (parent_record_decl, *path_decl, omit_empty_base_classes);
                                 if (child_idx == UINT32_MAX)
                                 {
                                     child_indexes.clear();
@@ -4741,6 +4760,13 @@
                                                   omit_empty_base_classes,
                                                   child_indexes);
 
+        case clang::Type::Elaborated:
+            return GetIndexOfChildMemberWithName (ast,
+                                                  cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
+                                                  name,
+                                                  omit_empty_base_classes,
+                                                  child_indexes);
+
         default:
             break;
         }
@@ -4948,6 +4974,12 @@
             }
             break;
 
+        case clang::Type::Elaborated:
+            return GetIndexOfChildWithName (ast,
+                                            cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
+                                            name,
+                                            omit_empty_base_classes);
+
         case clang::Type::Typedef:
             return GetIndexOfChildWithName (ast,
                                             cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
@@ -5062,9 +5094,9 @@
         IdentifierInfo &identifier_info = ast->Idents.get(name);
         DeclarationName decl_name (&identifier_info);
         clang::DeclContext::lookup_result result = decl_ctx->lookup(decl_name);
-        for (clang::DeclContext::lookup_iterator pos = result.first, end = result.second; pos != end; ++pos) 
+        for (auto decl = result.begin(); decl != result.end(); ++decl)
         {
-            namespace_decl = dyn_cast<clang::NamespaceDecl>(*pos);
+            namespace_decl = dyn_cast<clang::NamespaceDecl>(*decl);
             if (namespace_decl)
                 return namespace_decl;
         }
@@ -5250,17 +5282,27 @@
 #pragma mark Array Types
 
 clang_type_t
-ClangASTContext::CreateArrayType (clang_type_t element_type, size_t element_count, uint32_t bit_stride)
+ClangASTContext::CreateArrayType (clang_type_t element_type, size_t element_count)
 {
     if (element_type)
     {
         ASTContext *ast = getASTContext();
         assert (ast != NULL);
         llvm::APInt ap_element_count (64, element_count);
-        return ast->getConstantArrayType(QualType::getFromOpaquePtr(element_type),
-                                                 ap_element_count,
-                                                 ArrayType::Normal,
-                                                 0).getAsOpaquePtr(); // ElemQuals
+        if (element_count == 0)
+        {
+            return ast->getIncompleteArrayType(QualType::getFromOpaquePtr(element_type),
+                                               ArrayType::Normal,
+                                               0).getAsOpaquePtr();
+
+        }
+        else
+        {
+            return ast->getConstantArrayType(QualType::getFromOpaquePtr(element_type),
+                                                     ap_element_count,
+                                                     ArrayType::Normal,
+                                                     0).getAsOpaquePtr(); // ElemQuals
+        }
     }
     return NULL;
 }
@@ -5931,7 +5973,7 @@
 bool
 ClangASTContext::IsArrayOfScalarType (lldb::clang_type_t clang_type)
 {
-    clang_type = GetAsArrayType(clang_type);
+    clang_type = GetAsArrayType(clang_type, NULL, NULL, NULL);
     
     if (clang_type == 0)
         return false;
@@ -6151,8 +6193,10 @@
 }
 
 clang_type_t
-ClangASTContext::GetAsArrayType (clang_type_t clang_type, clang_type_t*member_type, uint64_t *size)
+ClangASTContext::GetAsArrayType (clang_type_t clang_type, clang_type_t*member_type, uint64_t *size, bool *is_incomplete)
 {
+    if (is_incomplete)
+        *is_incomplete = false;
     if (!clang_type)
         return 0;
     
@@ -6176,6 +6220,8 @@
             *member_type = cast<IncompleteArrayType>(qual_type)->getElementType().getAsOpaquePtr();
         if (size)
             *size = 0;
+        if (is_incomplete)
+            *is_incomplete = true;
         return clang_type;
 
     case clang::Type::VariableArray:
@@ -6195,12 +6241,14 @@
     case clang::Type::Typedef:
         return ClangASTContext::GetAsArrayType (cast<TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(),
                                                 member_type, 
-                                                size);
+                                                size,
+                                                is_incomplete);
     
     case clang::Type::Elaborated:
         return ClangASTContext::GetAsArrayType (cast<ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
                                                 member_type,
-                                                size);
+                                                size,
+                                                is_incomplete);
     }
     return 0;
 }

Modified: lldb/branches/windows/source/Symbol/ClangASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/ClangASTImporter.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/ClangASTImporter.cpp (original)
+++ lldb/branches/windows/source/Symbol/ClangASTImporter.cpp Tue Jan  8 06:51:53 2013
@@ -10,6 +10,7 @@
 #include "clang/AST/Decl.h"
 #include "clang/AST/DeclCXX.h"
 #include "clang/AST/DeclObjC.h"
+#include "llvm/Support/raw_ostream.h"
 #include "lldb/Core/Log.h"
 #include "lldb/Core/Module.h"
 #include "lldb/Symbol/ClangASTContext.h"
@@ -66,12 +67,12 @@
                     user_id = metadata->GetUserID();
                 
                 if (NamedDecl *named_decl = dyn_cast<NamedDecl>(decl))
-                    log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s '%s', metadata 0x%llx",
+                    log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s '%s', metadata 0x%" PRIx64,
                                 decl->getDeclKindName(),
                                 named_decl->getNameAsString().c_str(),
                                 user_id);
                 else
-                    log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s, metadata 0x%llx",
+                    log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s, metadata 0x%" PRIx64,
                                 decl->getDeclKindName(),
                                 user_id);
             }
@@ -467,7 +468,7 @@
             from_named_decl->printName(name_stream);
             name_stream.flush();
             
-            log->Printf("    [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%llx",
+            log->Printf("    [ClangASTImporter] Imported (%sDecl*)%p, named %s (from (Decl*)%p), metadata 0x%" PRIx64,
                         from->getDeclKindName(),
                         to,
                         name_string.c_str(),
@@ -476,7 +477,7 @@
         }
         else
         {
-            log->Printf("    [ClangASTImporter] Imported (%sDecl*)%p (from (Decl*)%p), metadata 0x%llx",
+            log->Printf("    [ClangASTImporter] Imported (%sDecl*)%p (from (Decl*)%p), metadata 0x%" PRIx64,
                         from->getDeclKindName(),
                         to,
                         from,

Modified: lldb/branches/windows/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/ClangASTType.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/ClangASTType.cpp (original)
+++ lldb/branches/windows/source/Symbol/ClangASTType.cpp Tue Jan  8 06:51:53 2013
@@ -1,4 +1,4 @@
-//===-- ClangASTType.cpp ---------------------------------------------*- C++ -*-===//
+//===-- ClangASTType.cpp ----------------------------------------*- C++ -*-===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Symbol/ClangASTType.h"
 
 #include "clang/AST/ASTConsumer.h"
@@ -35,6 +37,7 @@
 #include "lldb/Core/Scalar.h"
 #include "lldb/Core/Stream.h"
 #include "lldb/Core/StreamString.h"
+#include "lldb/Core/UniqueCStringMap.h"
 #include "lldb/Symbol/ClangASTContext.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Process.h"
@@ -246,7 +249,9 @@
         case clang::Type::Typedef:                  return lldb::eTypeClassTypedef;
         case clang::Type::UnresolvedUsing:          break;
         case clang::Type::Paren:                    break;
-        case clang::Type::Elaborated:               break;
+        case clang::Type::Elaborated:
+            return ClangASTType::GetTypeClass (ast_context, llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());
+
         case clang::Type::Attributed:               break;
         case clang::Type::TemplateTypeParm:         break;
         case clang::Type::SubstTemplateTypeParm:    break;
@@ -451,14 +456,15 @@
     case clang::Type::Record:                   break;
     case clang::Type::Enum:                     return lldb::eEncodingSint;
     case clang::Type::Typedef:
-            return GetEncoding(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), count);
-        break;
+        return GetEncoding(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr(), count);
+
+    case clang::Type::Elaborated:
+        return ClangASTType::GetEncoding (llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(), count);
 
     case clang::Type::DependentSizedArray:
     case clang::Type::DependentSizedExtVector:
     case clang::Type::UnresolvedUsing:
     case clang::Type::Paren:
-    case clang::Type::Elaborated:
     case clang::Type::Attributed:
     case clang::Type::TemplateTypeParm:
     case clang::Type::SubstTemplateTypeParm:
@@ -577,15 +583,15 @@
     case clang::Type::Record:                   break;
     case clang::Type::Enum:                     return lldb::eFormatEnum;
     case clang::Type::Typedef:
-            return ClangASTType::GetFormat(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr());
-
+        return ClangASTType::GetFormat(llvm::cast<clang::TypedefType>(qual_type)->getDecl()->getUnderlyingType().getAsOpaquePtr());
     case clang::Type::Auto:
-            return ClangASTType::GetFormat(llvm::cast<clang::AutoType>(qual_type)->desugar().getAsOpaquePtr());
+        return ClangASTType::GetFormat(llvm::cast<clang::AutoType>(qual_type)->desugar().getAsOpaquePtr());
+    case clang::Type::Elaborated:
+        return ClangASTType::GetFormat(llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr());
     case clang::Type::DependentSizedArray:
     case clang::Type::DependentSizedExtVector:
     case clang::Type::UnresolvedUsing:
     case clang::Type::Paren:
-    case clang::Type::Elaborated:
     case clang::Type::Attributed:
     case clang::Type::TemplateTypeParm:
     case clang::Type::SubstTemplateTypeParm:
@@ -812,7 +818,7 @@
             }
             // If we have gotten here we didn't get find the enumerator in the
             // enum decl, so just print the integer.
-            s->Printf("%lli", enum_value);
+            s->Printf("%" PRIi64, enum_value);
         }
         return;
 
@@ -910,6 +916,29 @@
         }
         break;
 
+    case clang::Type::Elaborated:
+        {
+            clang::QualType elaborated_qual_type = llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType();
+            lldb::Format elaborated_format = ClangASTType::GetFormat(elaborated_qual_type.getAsOpaquePtr());
+            std::pair<uint64_t, unsigned> elaborated_type_info = ast_context->getTypeInfo(elaborated_qual_type);
+            uint64_t elaborated_byte_size = elaborated_type_info.first / 8;
+
+            return DumpValue (ast_context,        // The clang AST context for this type
+                              elaborated_qual_type.getAsOpaquePtr(),    // The clang type we want to dump
+                              exe_ctx,
+                              s,                  // Stream to dump to
+                              elaborated_format,  // The format with which to display the element
+                              data,               // Data buffer containing all bytes for this type
+                              data_byte_offset,   // Offset into "data" where to grab value from
+                              elaborated_byte_size,  // Size of this type in bytes
+                              bitfield_bit_size,  // Bitfield bit size
+                              bitfield_bit_offset,// Bitfield bit offset
+                              show_types,         // Boolean indicating if we should show the variable types
+                              show_summary,       // Boolean indicating if we should show a summary for the current type
+                              verbose,            // Verbose output?
+                              depth);             // Scope depth for any types that have children
+        }
+        break;
     default:
         // We are down the a scalar type that we just need to display.
         data.Dump(s, data_byte_offset, format, data_byte_size, 1, UINT32_MAX, LLDB_INVALID_ADDRESS, bitfield_bit_size, bitfield_bit_offset);
@@ -1011,7 +1040,7 @@
                 // If we have gotten here we didn't get find the enumerator in the
                 // enum decl, so just print the integer.
                 
-                s->Printf("%lli", enum_value);
+                s->Printf("%" PRIi64, enum_value);
                 return true;
             }
             // format was not enum, just fall through and dump the value as requested....
@@ -1174,7 +1203,13 @@
     if (ClangASTContext::GetCompleteType (ast_context, clang_type))
     {
         clang::QualType qual_type(clang::QualType::getFromOpaquePtr(clang_type));
-        return ast_context->getTypeSize (qual_type);
+        const uint32_t bit_size = ast_context->getTypeSize (qual_type);
+        if (bit_size == 0)
+        {
+            if (qual_type->isIncompleteArrayType())
+                return ast_context->getTypeSize (qual_type->getArrayElementTypeNoTypeQual()->getCanonicalTypeUnqualified());
+        }
+        return bit_size;
     }
     return 0;
 }
@@ -1273,7 +1308,6 @@
                     if (class_interface_decl)
                     {
                         clang::PrintingPolicy policy = ast_context->getPrintingPolicy();
-                        policy.DumpSourceManager = &ast_context->getSourceManager();
 
 
                         class_interface_decl->print(llvm_ostrm, policy, s->GetIndentLevel());
@@ -1298,6 +1332,12 @@
             }
             break;
 
+        case clang::Type::Elaborated:
+            DumpTypeDescription (ast_context,
+                                 llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType().getAsOpaquePtr(),
+                                 s);
+            return;
+
         case clang::Type::Record:
             if (ClangASTContext::GetCompleteType (ast_context, clang_type))
             {
@@ -1788,3 +1828,200 @@
 {
     return lhs.GetASTContext() != rhs.GetASTContext() || lhs.GetOpaqueQualType() != rhs.GetOpaqueQualType();
 }
+
+lldb::BasicType
+ClangASTType::GetBasicTypeEnumeration (const ConstString &name)
+{
+    if (name)
+    {
+        typedef UniqueCStringMap<lldb::BasicType> TypeNameToBasicTypeMap;
+        static TypeNameToBasicTypeMap g_type_map;
+#if _WIN32
+        static volatile unsigned int g_once_flag = 0; 
+        if (InterlockedExchange(&g_once_flag, 1) == 0) {
+#else 
+        static std::once_flag g_once_flag;
+        std::call_once(g_once_flag, [](){
+#endif
+            // "void"
+            g_type_map.Append(ConstString("void").GetCString(), eBasicTypeVoid);
+            
+            // "char"
+            g_type_map.Append(ConstString("char").GetCString(), eBasicTypeChar);
+            g_type_map.Append(ConstString("signed char").GetCString(), eBasicTypeSignedChar);
+            g_type_map.Append(ConstString("unsigned char").GetCString(), eBasicTypeUnsignedChar);
+            g_type_map.Append(ConstString("wchar_t").GetCString(), eBasicTypeWChar);
+            g_type_map.Append(ConstString("signed wchar_t").GetCString(), eBasicTypeSignedWChar);
+            g_type_map.Append(ConstString("unsigned wchar_t").GetCString(), eBasicTypeUnsignedWChar);
+            // "short"
+            g_type_map.Append(ConstString("short").GetCString(), eBasicTypeShort);
+            g_type_map.Append(ConstString("short int").GetCString(), eBasicTypeShort);
+            g_type_map.Append(ConstString("unsigned short").GetCString(), eBasicTypeUnsignedShort);
+            g_type_map.Append(ConstString("unsigned short int").GetCString(), eBasicTypeUnsignedShort);
+            
+            // "int"
+            g_type_map.Append(ConstString("int").GetCString(), eBasicTypeInt);
+            g_type_map.Append(ConstString("signed int").GetCString(), eBasicTypeInt);
+            g_type_map.Append(ConstString("unsigned int").GetCString(), eBasicTypeUnsignedInt);
+            g_type_map.Append(ConstString("unsigned").GetCString(), eBasicTypeUnsignedInt);
+            
+            // "long"
+            g_type_map.Append(ConstString("long").GetCString(), eBasicTypeLong);
+            g_type_map.Append(ConstString("long int").GetCString(), eBasicTypeLong);
+            g_type_map.Append(ConstString("unsigned long").GetCString(), eBasicTypeUnsignedLong);
+            g_type_map.Append(ConstString("unsigned long int").GetCString(), eBasicTypeUnsignedLong);
+            
+            // "long long"
+            g_type_map.Append(ConstString("long long").GetCString(), eBasicTypeLongLong);
+            g_type_map.Append(ConstString("long long int").GetCString(), eBasicTypeLongLong);
+            g_type_map.Append(ConstString("unsigned long long").GetCString(), eBasicTypeUnsignedLongLong);
+            g_type_map.Append(ConstString("unsigned long long int").GetCString(), eBasicTypeUnsignedLongLong);
+
+            // "int128"
+            g_type_map.Append(ConstString("__int128_t").GetCString(), eBasicTypeInt128);
+            g_type_map.Append(ConstString("__uint128_t").GetCString(), eBasicTypeUnsignedInt128);
+            
+            // Miscelaneous
+            g_type_map.Append(ConstString("bool").GetCString(), eBasicTypeBool);
+            g_type_map.Append(ConstString("float").GetCString(), eBasicTypeFloat);
+            g_type_map.Append(ConstString("double").GetCString(), eBasicTypeDouble);
+            g_type_map.Append(ConstString("long double").GetCString(), eBasicTypeLongDouble);
+            g_type_map.Append(ConstString("id").GetCString(), eBasicTypeObjCID);
+            g_type_map.Append(ConstString("SEL").GetCString(), eBasicTypeObjCSel);
+            g_type_map.Append(ConstString("nullptr").GetCString(), eBasicTypeNullPtr);
+            g_type_map.Sort();
+#if _WIN32
+        };
+#else
+        });
+#endif
+
+        return g_type_map.Find(name.GetCString(), eBasicTypeInvalid);
+    }
+    return eBasicTypeInvalid;
+}
+
+ClangASTType
+ClangASTType::GetBasicType (clang::ASTContext *ast, const ConstString &name)
+{
+    if (ast)
+    {
+        lldb::BasicType basic_type = ClangASTType::GetBasicTypeEnumeration (name);
+        return ClangASTType::GetBasicType (ast, basic_type);
+    }
+    return ClangASTType();
+}
+
+ClangASTType
+ClangASTType::GetBasicType (clang::ASTContext *ast, lldb::BasicType type)
+{
+    if (ast)
+    {
+        clang_type_t clang_type = NULL;
+        
+        switch (type)
+        {
+            case eBasicTypeInvalid:
+            case eBasicTypeOther:
+                break;
+            case eBasicTypeVoid:
+                clang_type = ast->VoidTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeChar:
+                clang_type = ast->CharTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeSignedChar:
+                clang_type = ast->SignedCharTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedChar:
+                clang_type = ast->UnsignedCharTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeWChar:
+                clang_type = ast->getWCharType().getAsOpaquePtr();
+                break;
+            case eBasicTypeSignedWChar:
+                clang_type = ast->getSignedWCharType().getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedWChar:
+                clang_type = ast->getUnsignedWCharType().getAsOpaquePtr();
+                break;
+            case eBasicTypeChar16:
+                clang_type = ast->Char16Ty.getAsOpaquePtr();
+                break;
+            case eBasicTypeChar32:
+                clang_type = ast->Char32Ty.getAsOpaquePtr();
+                break;
+            case eBasicTypeShort:
+                clang_type = ast->ShortTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedShort:
+                clang_type = ast->UnsignedShortTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeInt:
+                clang_type = ast->IntTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedInt:
+                clang_type = ast->UnsignedIntTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeLong:
+                clang_type = ast->LongTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedLong:
+                clang_type = ast->UnsignedLongTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeLongLong:
+                clang_type = ast->LongLongTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedLongLong:
+                clang_type = ast->UnsignedLongLongTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeInt128:
+                clang_type = ast->Int128Ty.getAsOpaquePtr();
+                break;
+            case eBasicTypeUnsignedInt128:
+                clang_type = ast->UnsignedInt128Ty.getAsOpaquePtr();
+                break;
+            case eBasicTypeBool:
+                clang_type = ast->BoolTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeHalf:
+                clang_type = ast->HalfTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeFloat:
+                clang_type = ast->FloatTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeDouble:
+                clang_type = ast->DoubleTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeLongDouble:
+                clang_type = ast->LongDoubleTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeFloatComplex:
+                clang_type = ast->FloatComplexTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeDoubleComplex:
+                clang_type = ast->DoubleComplexTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeLongDoubleComplex:
+                clang_type = ast->LongDoubleComplexTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeObjCID:
+                clang_type = ast->ObjCBuiltinIdTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeObjCClass:
+                clang_type = ast->ObjCBuiltinClassTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeObjCSel:
+                clang_type = ast->ObjCBuiltinSelTy.getAsOpaquePtr();
+                break;
+            case eBasicTypeNullPtr:
+                clang_type = ast->NullPtrTy.getAsOpaquePtr();
+                break;
+        }
+        
+        if (clang_type)
+            return ClangASTType (ast, clang_type);
+    }
+    return ClangASTType();
+}
+

Modified: lldb/branches/windows/source/Symbol/CompileUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/CompileUnit.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/CompileUnit.cpp (original)
+++ lldb/branches/windows/source/Symbol/CompileUnit.cpp Tue Jan  8 06:51:53 2013
@@ -78,7 +78,7 @@
 CompileUnit::DumpSymbolContext(Stream *s)
 {
     GetModule()->DumpSymbolContext(s);
-    s->Printf(", CompileUnit{0x%8.8llx}", GetID());
+    s->Printf(", CompileUnit{0x%8.8" PRIx64 "}", GetID());
 }
 
 

Modified: lldb/branches/windows/source/Symbol/Function.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/Function.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/Function.cpp (original)
+++ lldb/branches/windows/source/Symbol/Function.cpp Tue Jan  8 06:51:53 2013
@@ -370,7 +370,7 @@
     }
     else if (m_type_uid != LLDB_INVALID_UID)
     {
-        s->Printf(", type_uid = 0x%8.8llx", m_type_uid);
+        s->Printf(", type_uid = 0x%8.8" PRIx64, m_type_uid);
     }
 
     s->EOL();
@@ -426,7 +426,7 @@
 Function::DumpSymbolContext(Stream *s)
 {
     m_comp_unit->DumpSymbolContext(s);
-    s->Printf(", Function{0x%8.8llx}", GetID());
+    s->Printf(", Function{0x%8.8" PRIx64 "}", GetID());
 }
 
 size_t

Modified: lldb/branches/windows/source/Symbol/LineTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/LineTable.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/LineTable.cpp (original)
+++ lldb/branches/windows/source/Symbol/LineTable.cpp Tue Jan  8 06:51:53 2013
@@ -34,34 +34,6 @@
 {
 }
 
-//void
-//LineTable::AddLineEntry(const LineEntry& entry)
-//{
-//  // Do a binary search for the correct entry and insert it
-//  m_line_entries.insert(std::upper_bound(m_line_entries.begin(), m_line_entries.end(), entry), entry);
-//}
-
-void
-LineTable::AppendLineEntry
-(
-    const lldb::SectionSP& section_sp,
-    lldb::addr_t section_offset,
-    uint32_t line,
-    uint16_t column,
-    uint16_t file_idx,
-    bool is_start_of_statement,
-    bool is_start_of_basic_block,
-    bool is_prologue_end,
-    bool is_epilogue_begin,
-    bool is_terminal_entry
-)
-{
-    uint32_t sect_idx = m_section_list.AddUniqueSection (section_sp);
-    Entry entry(sect_idx, section_offset, line, column, file_idx, is_start_of_statement, is_start_of_basic_block, is_prologue_end, is_epilogue_begin, is_terminal_entry);
-    m_entries.push_back (entry);
-}
-
-
 void
 LineTable::InsertLineEntry
 (
@@ -106,6 +78,80 @@
 //  Dump (&s, Address::DumpStyleFileAddress);
 }
 
+LineSequence::LineSequence()
+{
+}
+
+void
+LineTable::LineSequenceImpl::Clear()
+{ 
+    m_seq_entries.clear();
+}
+
+LineSequence* LineTable::CreateLineSequenceContainer ()
+{
+    return new LineTable::LineSequenceImpl();
+}
+
+void
+LineTable::AppendLineEntryToSequence
+(
+    LineSequence* sequence,
+    const SectionSP& section_sp,
+    lldb::addr_t section_offset,
+    uint32_t line,
+    uint16_t column,
+    uint16_t file_idx,
+    bool is_start_of_statement,
+    bool is_start_of_basic_block,
+    bool is_prologue_end,
+    bool is_epilogue_begin,
+    bool is_terminal_entry
+)
+{
+    assert(sequence != NULL);
+    LineSequenceImpl* seq = reinterpret_cast<LineSequenceImpl*>(sequence);
+    uint32_t sect_idx = m_section_list.AddUniqueSection (section_sp);
+    Entry entry(sect_idx, section_offset, line, column, file_idx, is_start_of_statement, is_start_of_basic_block, is_prologue_end, is_epilogue_begin, is_terminal_entry);
+    seq->m_seq_entries.push_back (entry);
+}
+
+void
+LineTable::InsertSequence (LineSequence* sequence)
+{
+    assert(sequence != NULL);
+    LineSequenceImpl* seq = reinterpret_cast<LineSequenceImpl*>(sequence);
+    if (seq->m_seq_entries.empty())
+        return;
+    Entry& entry = seq->m_seq_entries.front();
+
+    // If the first entry address in this sequence is greater than or equal to
+    // the address of the last item in our entry collection, just append.
+    if (m_entries.empty() || !Entry::EntryAddressLessThan(entry, m_entries.back()))
+    {
+        m_entries.insert(m_entries.end(),
+                         seq->m_seq_entries.begin(),
+                         seq->m_seq_entries.end());
+        return;
+    }
+
+    // Otherwise, find where this belongs in the collection
+    entry_collection::iterator begin_pos = m_entries.begin();
+    entry_collection::iterator end_pos = m_entries.end();
+    LineTable::Entry::LessThanBinaryPredicate less_than_bp(this);
+    entry_collection::iterator pos = upper_bound(begin_pos, end_pos, entry, less_than_bp);
+#ifdef LLDB_CONFIGURATION_DEBUG
+    // If we aren't inserting at the beginning, the previous entry should
+    // terminate a sequence.
+    if (pos != begin_pos)
+    {
+        entry_collection::iterator prev_pos = pos - 1;
+        assert(prev_pos->is_terminal_entry);
+    }
+#endif
+    m_entries.insert(pos, seq->m_seq_entries.begin(), seq->m_seq_entries.end());
+}
+
 //----------------------------------------------------------------------
 LineTable::Entry::LessThanBinaryPredicate::LessThanBinaryPredicate(LineTable *line_table) :
     m_line_table (line_table)
@@ -448,5 +494,42 @@
     }
 }
 
+size_t
+LineTable::GetContiguousFileAddressRanges (FileAddressRanges &file_ranges, bool append)
+{
+    if (!append)
+        file_ranges.Clear();
+    const size_t initial_count = file_ranges.GetSize();
+    
+    const size_t count = m_entries.size();
+    LineEntry line_entry;
+    std::vector<addr_t> section_base_file_addrs (m_section_list.GetSize(), LLDB_INVALID_ADDRESS);
+    FileAddressRanges::Entry range (LLDB_INVALID_ADDRESS, 0);
+    for (size_t idx = 0; idx < count; ++idx)
+    {
+        const Entry& entry = m_entries[idx];
+
+        if (entry.is_terminal_entry)
+        {
+            if (range.GetRangeBase() != LLDB_INVALID_ADDRESS)
+            {
+                if (section_base_file_addrs[entry.sect_idx] == LLDB_INVALID_ADDRESS)
+                    section_base_file_addrs[entry.sect_idx] = m_section_list.GetSectionAtIndex (entry.sect_idx)->GetFileAddress();
+                range.SetRangeEnd(section_base_file_addrs[entry.sect_idx] + entry.sect_offset);
+                file_ranges.Append(range);
+                range.Clear(LLDB_INVALID_ADDRESS);
+            }
+        }
+        else if (range.GetRangeBase() == LLDB_INVALID_ADDRESS)
+        {
+            if (section_base_file_addrs[entry.sect_idx] == LLDB_INVALID_ADDRESS)
+                section_base_file_addrs[entry.sect_idx] = m_section_list.GetSectionAtIndex (entry.sect_idx)->GetFileAddress();
+            range.SetRangeBase(section_base_file_addrs[entry.sect_idx] + entry.sect_offset);
+        }
+    }
+    return file_ranges.GetSize() - initial_count;
+}
+
+
 
 

Modified: lldb/branches/windows/source/Symbol/ObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/ObjectFile.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/ObjectFile.cpp (original)
+++ lldb/branches/windows/source/Symbol/ObjectFile.cpp Tue Jan  8 06:51:53 2013
@@ -34,7 +34,7 @@
     if (module_sp)
     {
         Timer scoped_timer (__PRETTY_FUNCTION__,
-                            "ObjectFile::FindPlugin (module = %s/%s, file = %p, file_offset = 0x%8.8llx, file_size = 0x%8.8llx)",
+                            "ObjectFile::FindPlugin (module = %s/%s, file = %p, file_offset = 0x%8.8" PRIx64 ", file_size = 0x%8.8" PRIx64 ")",
                             module_sp->GetFileSpec().GetDirectory().AsCString(),
                             module_sp->GetFileSpec().GetFilename().AsCString(),
                             file, (uint64_t) file_offset, (uint64_t) file_size);
@@ -114,7 +114,7 @@
     if (module_sp)
     {
         Timer scoped_timer (__PRETTY_FUNCTION__,
-                            "ObjectFile::FindPlugin (module = %s/%s, process = %p, header_addr = 0x%llx)",
+                            "ObjectFile::FindPlugin (module = %s/%s, process = %p, header_addr = 0x%" PRIx64 ")",
                             module_sp->GetFileSpec().GetDirectory().AsCString(),
                             module_sp->GetFileSpec().GetFilename().AsCString(),
                             process_sp.get(), header_addr);
@@ -162,7 +162,7 @@
     {
         if (m_file)
         {
-            log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = %s/%s, offset = 0x%8.8llx, size = %llu\n",
+            log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = %s/%s, offset = 0x%8.8" PRIx64 ", size = %" PRIu64 "\n",
                          this,
                          module_sp->GetFileSpec().GetDirectory().AsCString(),
                          module_sp->GetFileSpec().GetFilename().AsCString(),
@@ -173,7 +173,7 @@
         }
         else
         {
-            log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = <NULL>, offset = 0x%8.8llx, size = %llu\n",
+            log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, file = <NULL>, offset = 0x%8.8" PRIx64 ", size = %" PRIu64 "\n",
                          this,
                          module_sp->GetFileSpec().GetDirectory().AsCString(),
                          module_sp->GetFileSpec().GetFilename().AsCString(),
@@ -204,7 +204,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
     if (log)
     {
-        log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, process = %p, header_addr = 0x%llx\n",
+        log->Printf ("%p ObjectFile::ObjectFile () module = %s/%s, process = %p, header_addr = 0x%" PRIx64 "\n",
                      this,
                      module_sp->GetFileSpec().GetDirectory().AsCString(),
                      module_sp->GetFileSpec().GetFilename().AsCString(),
@@ -218,29 +218,7 @@
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
     if (log)
-    {
-        ModuleSP module_sp (GetModule());
-        if (m_file)
-        {
-            log->Printf ("%p ObjectFile::~ObjectFile () module = %s/%s, file = %s/%s, offset = 0x%8.8llx, size = %llu\n",
-                         this,
-                         module_sp->GetFileSpec().GetDirectory().AsCString(),
-                         module_sp->GetFileSpec().GetFilename().AsCString(),
-                         m_file.GetDirectory().AsCString(),
-                         m_file.GetFilename().AsCString(),
-                         m_offset,
-                         m_length);
-        }
-        else
-        {
-            log->Printf ("%p ObjectFile::~ObjectFile () module = %s/%s, file = <NULL>, offset = 0x%8.8llx, size = %llu\n",
-                         this,
-                         module_sp->GetFileSpec().GetDirectory().AsCString(),
-                         module_sp->GetFileSpec().GetFilename().AsCString(),
-                         m_offset,
-                         m_length);
-        }
-    }
+        log->Printf ("%p ObjectFile::~ObjectFile ()\n", this);
 }
 
 bool 
@@ -400,6 +378,19 @@
                 section_dst_len = section_bytes_left;
             return CopyData (section->GetFileOffset() + section_offset, section_dst_len, dst);
         }
+        else
+        {
+            if (section->GetType() == eSectionTypeZeroFill)
+            {
+                const uint64_t section_size = section->GetByteSize();
+                const uint64_t section_bytes_left = section_size - section_offset;
+                uint64_t section_dst_len = dst_len;
+                if (section_dst_len > section_bytes_left)
+                    section_dst_len = section_bytes_left;
+                memset(dst, 0, section_dst_len);
+                return section_dst_len;
+            }
+        }
     }
     return 0;
 }

Modified: lldb/branches/windows/source/Symbol/Symbol.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/Symbol.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/Symbol.cpp (original)
+++ lldb/branches/windows/source/Symbol/Symbol.cpp Tue Jan  8 06:51:53 2013
@@ -33,6 +33,7 @@
     m_size_is_sibling (false),
     m_size_is_synthesized (false),
     m_calculated_size (false),
+    m_demangled_is_synthesized (false),
     m_type (eSymbolTypeInvalid),
     m_flags (),
     m_addr_range ()
@@ -65,6 +66,7 @@
     m_size_is_sibling (false),
     m_size_is_synthesized (false),
     m_calculated_size (size > 0),
+    m_demangled_is_synthesized (false),
     m_type (type),
     m_flags (flags),
     m_addr_range (section_sp, offset, size)
@@ -95,6 +97,7 @@
     m_size_is_sibling (false),
     m_size_is_synthesized (false),
     m_calculated_size (range.GetByteSize() > 0),
+    m_demangled_is_synthesized (false),
     m_type (type),
     m_flags (flags),
     m_addr_range (range)
@@ -113,6 +116,7 @@
     m_size_is_sibling (rhs.m_size_is_sibling),
     m_size_is_synthesized (false),
     m_calculated_size (rhs.m_calculated_size),
+    m_demangled_is_synthesized (rhs.m_demangled_is_synthesized),
     m_type (rhs.m_type),
     m_flags (rhs.m_flags),
     m_addr_range (rhs.m_addr_range)
@@ -135,6 +139,7 @@
         m_size_is_sibling = rhs.m_size_is_sibling;
         m_size_is_synthesized = rhs.m_size_is_sibling;
         m_calculated_size = rhs.m_calculated_size;
+        m_demangled_is_synthesized = rhs.m_demangled_is_synthesized;
         m_type = rhs.m_type;
         m_flags = rhs.m_flags;
         m_addr_range = rhs.m_addr_range;
@@ -155,6 +160,7 @@
     m_size_is_sibling = false;
     m_size_is_synthesized = false;
     m_calculated_size = false;
+    m_demangled_is_synthesized = false;
     m_type = eSymbolTypeInvalid;
     m_flags = 0;
     m_addr_range.Clear();
@@ -200,14 +206,14 @@
             }
         }
         else
-            s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset());
+            s->Printf (", value = 0x%16.16" PRIx64, m_addr_range.GetBaseAddress().GetOffset());
     }
     else
     {
         if (m_size_is_sibling)                
-            s->Printf (", sibling = %5llu", m_addr_range.GetBaseAddress().GetOffset());
+            s->Printf (", sibling = %5" PRIu64, m_addr_range.GetBaseAddress().GetOffset());
         else
-            s->Printf (", value = 0x%16.16llx", m_addr_range.GetBaseAddress().GetOffset());
+            s->Printf (", value = 0x%16.16" PRIx64, m_addr_range.GetBaseAddress().GetOffset());
     }
     if (m_mangled.GetDemangledName())
         s->Printf(", name=\"%s\"", m_mangled.GetDemangledName().AsCString());
@@ -245,7 +251,7 @@
 
         const char *format = m_size_is_sibling ?
                             " Sibling -> [%5llu] 0x%8.8x %s\n":
-                            " 0x%16.16llx 0x%8.8x %s\n";
+                            " 0x%16.16" PRIx64 " 0x%8.8x %s\n";
         s->Printf(  format,
                     GetByteSize(),
                     m_flags,
@@ -254,8 +260,8 @@
     else
     {
         const char *format = m_size_is_sibling ?
-                            "0x%16.16llx                    Sibling -> [%5llu] 0x%8.8x %s\n":
-                            "0x%16.16llx                    0x%16.16llx 0x%8.8x %s\n";
+                            "0x%16.16" PRIx64 "                    Sibling -> [%5llu] 0x%8.8x %s\n":
+                            "0x%16.16" PRIx64 "                    0x%16.16" PRIx64 " 0x%8.8x %s\n";
         s->Printf(  format,
                     m_addr_range.GetBaseAddress().GetOffset(),
                     GetByteSize(),

Modified: lldb/branches/windows/source/Symbol/SymbolContext.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/SymbolContext.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/SymbolContext.cpp (original)
+++ lldb/branches/windows/source/Symbol/SymbolContext.cpp Tue Jan  8 06:51:53 2013
@@ -157,7 +157,7 @@
             if (function_offset)
             {
                 dumped_something = true;
-                s->Printf(" + %llu", function_offset);                
+                s->Printf(" + %" PRIu64, function_offset);
             }
         }
 
@@ -174,7 +174,7 @@
                 const addr_t inlined_function_offset = addr.GetOffset() - block_range.GetBaseAddress().GetOffset();
                 if (inlined_function_offset)
                 {
-                    s->Printf(" + %llu", inlined_function_offset);                
+                    s->Printf(" + %" PRIu64, inlined_function_offset);
                 }
             }
             const Declaration &call_site = inlined_block_info->GetCallSite();
@@ -217,7 +217,7 @@
             if (symbol_offset)
             {
                 dumped_something = true;
-                s->Printf(" + %llu", symbol_offset);                
+                s->Printf(" + %" PRIu64, symbol_offset);
             }
         }
     }
@@ -496,7 +496,7 @@
 
                 if (log)
                 {
-                    log->Printf ("warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx", 
+                    log->Printf ("warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64,
                                  curr_inlined_block->GetID(), curr_frame_pc.GetFileAddress());
                 }
 #ifdef LLDB_CONFIGURATION_DEBUG
@@ -516,7 +516,7 @@
                     if (objfile)
                     {
                         Host::SystemLog (Host::eSystemLogWarning, 
-                                         "warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx in %s/%s\n", 
+                                         "warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64 " in %s/%s\n",
                                          curr_inlined_block->GetID(), 
                                          curr_frame_pc.GetFileAddress(),
                                          objfile->GetFileSpec().GetDirectory().GetCString(),
@@ -525,7 +525,7 @@
                     else
                     {
                         Host::SystemLog (Host::eSystemLogWarning, 
-                                         "warning: inlined block 0x%8.8llx doesn't have a range that contains file address 0x%llx\n", 
+                                         "warning: inlined block 0x%8.8" PRIx64 " doesn't have a range that contains file address 0x%" PRIx64 "\n",
                                          curr_inlined_block->GetID(), 
                                          curr_frame_pc.GetFileAddress());
                     }

Modified: lldb/branches/windows/source/Symbol/SymbolVendor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/SymbolVendor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/SymbolVendor.cpp (original)
+++ lldb/branches/windows/source/Symbol/SymbolVendor.cpp Tue Jan  8 06:51:53 2013
@@ -32,7 +32,7 @@
 // also allow for finding separate debug information files.
 //----------------------------------------------------------------------
 SymbolVendor*
-SymbolVendor::FindPlugin (const lldb::ModuleSP &module_sp)
+SymbolVendor::FindPlugin (const lldb::ModuleSP &module_sp, lldb_private::Stream *feedback_strm)
 {
     std::auto_ptr<SymbolVendor> instance_ap;
     //----------------------------------------------------------------------
@@ -41,7 +41,7 @@
     SymbolVendorCreateInstance create_callback;
     for (uint32_t idx = 0; (create_callback = PluginManager::GetSymbolVendorCreateCallbackAtIndex(idx)) != NULL; ++idx)
     {
-        instance_ap.reset(create_callback(module_sp));
+        instance_ap.reset(create_callback(module_sp, feedback_strm));
 
         if (instance_ap.get())
         {

Modified: lldb/branches/windows/source/Symbol/Symtab.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/Symtab.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/Symtab.cpp (original)
+++ lldb/branches/windows/source/Symbol/Symtab.cpp Tue Jan  8 06:51:53 2013
@@ -13,6 +13,7 @@
 #include "lldb/Core/RegularExpression.h"
 #include "lldb/Core/Timer.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/Symtab.h"
 #include "lldb/Target/ObjCLanguageRuntime.h"
 
@@ -309,20 +310,25 @@
                 
             // If the demangled name turns out to be an ObjC name, and
             // is a category name, add the version without categories to the index too.
+            ConstString objc_selector_name;
             ConstString objc_base_name;
             if (ObjCLanguageRuntime::ParseMethodName (entry.cstring,
                                                       NULL,
-                                                      NULL,
+                                                      &objc_selector_name,
                                                       &objc_base_name,
                                                       NULL))
             {
                 entry.cstring = objc_base_name.GetCString();
                 m_name_to_index.Append (entry);
+                entry.cstring = objc_selector_name.GetCString();
+                m_selector_to_index.Append (entry);
             }
                                                         
         }
         m_name_to_index.Sort();
         m_name_to_index.SizeToFit();
+        m_selector_to_index.Sort();
+        m_selector_to_index.SizeToFit();
     }
 }
 
@@ -973,3 +979,64 @@
     return FindSymbolContainingFileAddress (file_addr, &m_addr_indexes[0], m_addr_indexes.size());
 }
 
+void
+Symtab::SymbolIndicesToSymbolContextList (std::vector<uint32_t> &symbol_indexes, SymbolContextList &sc_list)
+{
+    // No need to protect this call using m_mutex all other method calls are
+    // already thread safe.
+    
+    size_t num_indices = symbol_indexes.size();
+    if (num_indices > 0)
+    {
+        SymbolContext sc;
+        sc.module_sp = m_objfile->GetModule();
+        for (size_t i = 0; i < num_indices; i++)
+        {
+            sc.symbol = SymbolAtIndex (symbol_indexes[i]);
+            if (sc.symbol)
+                sc_list.Append (sc);
+        }
+    }
+}
+
+
+size_t
+Symtab::FindFunctionSymbols (const ConstString &name,
+                             uint32_t name_type_mask,
+                             SymbolContextList& sc_list)
+{
+    size_t count = 0;
+    std::vector<uint32_t> symbol_indexes;
+    if (name_type_mask & (eFunctionNameTypeBase | eFunctionNameTypeFull | eFunctionNameTypeAuto))
+    {
+        FindAllSymbolsWithNameAndType (name, eSymbolTypeCode, symbol_indexes);
+    }
+    
+    if (name_type_mask & eFunctionNameTypeSelector)
+    {
+        if (!m_name_indexes_computed)
+            InitNameIndexes();
+
+        if (!m_selector_to_index.IsEmpty())
+        {
+            const UniqueCStringMap<uint32_t>::Entry *match;
+            for (match = m_selector_to_index.FindFirstValueForName(name.AsCString());
+                 match != NULL;
+                 match = m_selector_to_index.FindNextValueForName(match))
+            {
+                symbol_indexes.push_back(match->value);
+            }
+        }
+    }
+
+    if (!symbol_indexes.empty())
+    {
+        std::sort(symbol_indexes.begin(), symbol_indexes.end());
+        symbol_indexes.erase(std::unique(symbol_indexes.begin(), symbol_indexes.end()), symbol_indexes.end());
+        count = symbol_indexes.size();
+        SymbolIndicesToSymbolContextList (symbol_indexes, sc_list);
+    }
+
+    return count;
+}
+

Modified: lldb/branches/windows/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/Type.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/Type.cpp (original)
+++ lldb/branches/windows/source/Symbol/Type.cpp Tue Jan  8 06:51:53 2013
@@ -150,7 +150,7 @@
     }
     else if (m_encoding_uid != LLDB_INVALID_UID)
     {
-        s->Printf(", type_uid = 0x%8.8llx", m_encoding_uid);
+        s->Printf(", type_uid = 0x%8.8" PRIx64, m_encoding_uid);
         switch (m_encoding_uid_type)
         {
         case eEncodingInvalid: break;
@@ -257,7 +257,7 @@
         {
             s->PutChar('(');
             if (verbose)
-                s->Printf("Type{0x%8.8llx} ", GetID());
+                s->Printf("Type{0x%8.8" PRIx64 "} ", GetID());
             DumpTypeName (s);
             s->PutCString(") ");
         }

Modified: lldb/branches/windows/source/Symbol/UnwindPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/UnwindPlan.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/UnwindPlan.cpp (original)
+++ lldb/branches/windows/source/Symbol/UnwindPlan.cpp Tue Jan  8 06:51:53 2013
@@ -164,9 +164,9 @@
     const RegisterInfo *reg_info = unwind_plan->GetRegisterInfo (thread, GetCFARegister());
 
     if (base_addr != LLDB_INVALID_ADDRESS)
-        s.Printf ("0x%16.16llx: CFA=", base_addr + GetOffset());
+        s.Printf ("0x%16.16" PRIx64 ": CFA=", base_addr + GetOffset());
     else
-        s.Printf ("0x%8.8llx: CFA=", GetOffset());
+        s.Printf ("0x%8.8" PRIx64 ": CFA=", GetOffset());
             
     if (reg_info)
         s.Printf ("%s", reg_info->name);

Modified: lldb/branches/windows/source/Symbol/UnwindTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/UnwindTable.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/UnwindTable.cpp (original)
+++ lldb/branches/windows/source/Symbol/UnwindTable.cpp Tue Jan  8 06:51:53 2013
@@ -140,7 +140,7 @@
     const_iterator end = m_unwinds.end();
     for (const_iterator pos = begin; pos != end; ++pos)
     {
-        s.Printf ("[%u] 0x%16.16llx\n", (unsigned)std::distance (begin, pos), pos->first);
+        s.Printf ("[%u] 0x%16.16" PRIx64 "\n", (unsigned)std::distance (begin, pos), pos->first);
     }
     s.EOL();
 }

Modified: lldb/branches/windows/source/Symbol/VariableList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Symbol/VariableList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Symbol/VariableList.cpp (original)
+++ lldb/branches/windows/source/Symbol/VariableList.cpp Tue Jan  8 06:51:53 2013
@@ -67,7 +67,7 @@
 }
 
 VariableSP
-VariableList::GetVariableAtIndex(uint32_t idx)
+VariableList::GetVariableAtIndex(uint32_t idx) const
 {
     VariableSP var_sp;
     if (idx < m_variables.size())

Modified: lldb/branches/windows/source/Target/Memory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Memory.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Memory.cpp (original)
+++ lldb/branches/windows/source/Target/Memory.cpp Tue Jan  8 06:51:53 2013
@@ -326,7 +326,7 @@
     }
     LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
     if (log)
-        log->Printf ("AllocatedBlock::ReserveBlock (size = %u (0x%x)) => 0x%16.16llx", size, size, (uint64_t)addr);
+        log->Printf ("AllocatedBlock::ReserveBlock (size = %u (0x%x)) => 0x%16.16" PRIx64, size, size, (uint64_t)addr);
     return addr;
 }
 
@@ -343,7 +343,7 @@
     }
     LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
     if (log)
-        log->Printf ("AllocatedBlock::FreeBlock (addr = 0x%16.16llx) => %i", (uint64_t)addr, success);
+        log->Printf ("AllocatedBlock::FreeBlock (addr = 0x%16.16" PRIx64 ") => %i", (uint64_t)addr, success);
     return success;
 }
 
@@ -390,7 +390,7 @@
     LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
     {
-        log->Printf ("Process::DoAllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16llx", 
+        log->Printf ("Process::DoAllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16" PRIx64,
                      page_byte_size, 
                      GetPermissionsAsCString(permissions), 
                      (uint64_t)addr);
@@ -428,7 +428,7 @@
     }
     LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf ("AllocatedMemoryCache::AllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16llx", byte_size, GetPermissionsAsCString(permissions), (uint64_t)addr);
+        log->Printf ("AllocatedMemoryCache::AllocateMemory (byte_size = 0x%8.8zx, permissions = %s) => 0x%16.16" PRIx64, byte_size, GetPermissionsAsCString(permissions), (uint64_t)addr);
     return addr;
 }
 
@@ -449,7 +449,7 @@
     }
     LogSP log (GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf("AllocatedMemoryCache::DeallocateMemory (addr = 0x%16.16llx) => %i", (uint64_t)addr, success);
+        log->Printf("AllocatedMemoryCache::DeallocateMemory (addr = 0x%16.16" PRIx64 ") => %i", (uint64_t)addr, success);
     return success;
 }
 

Modified: lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp (original)
+++ lldb/branches/windows/source/Target/ObjCLanguageRuntime.cpp Tue Jan  8 06:51:53 2013
@@ -43,7 +43,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
     if (log)
     {
-        log->Printf ("Caching: class 0x%llx selector 0x%llx implementation 0x%llx.", class_addr, selector, impl_addr);
+        log->Printf ("Caching: class 0x%" PRIx64 " selector 0x%" PRIx64 " implementation 0x%" PRIx64 ".", class_addr, selector, impl_addr);
     }
     m_impl_cache.insert (std::pair<ClassAndSel,lldb::addr_t> (ClassAndSel(class_addr, selector), impl_addr));
 }
@@ -105,9 +105,7 @@
                                                          types);
         
         if (num_types)
-        {
-            TypeSP incomplete_type_sp;
-            
+        {            
             uint32_t i;
             for (i = 0; i < num_types; ++i)
             {
@@ -120,8 +118,6 @@
                         m_complete_class_cache[name] = type_sp;
                         return type_sp;
                     }
-                    else if (!incomplete_type_sp)
-                        incomplete_type_sp = type_sp;
                 }
             }
         }

Modified: lldb/branches/windows/source/Target/Platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Platform.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Platform.cpp (original)
+++ lldb/branches/windows/source/Target/Platform.cpp Tue Jan  8 06:51:53 2013
@@ -688,7 +688,7 @@
         ArchSpec platform_arch;
         for (uint32_t arch_idx=0; GetSupportedArchitectureAtIndex (arch_idx, platform_arch); ++arch_idx)
         {
-            if (arch == platform_arch)
+            if (arch.IsCompatibleMatch(platform_arch))
             {
                 if (compatible_arch_ptr)
                     *compatible_arch_ptr = platform_arch;

Modified: lldb/branches/windows/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Process.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Process.cpp (original)
+++ lldb/branches/windows/source/Target/Process.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Target/Process.h"
 
 #include "lldb/lldb-private-log.h"
@@ -93,8 +95,9 @@
 g_properties[] =
 {
     { "disable-memory-cache" , OptionValue::eTypeBoolean, false, DISABLE_MEM_CACHE_DEFAULT, NULL, NULL, "Disable reading and caching of memory in fixed-size units." },
-    { "extra-startup-command", OptionValue::eTypeArray  , false, OptionValue::eTypeString, NULL, NULL, "A list containing extra commands understood by the particular process plugin used." },
-    { "python-os-plugin-path", OptionValue::eTypeFileSpec, false, 0, NULL, NULL, "A path to a python OS plug-in module file that contains a OperatingSystemPlugIn class." },
+    { "extra-startup-command", OptionValue::eTypeArray  , false, OptionValue::eTypeString, NULL, NULL, "A list containing extra commands understood by the particular process plugin used.  "
+                                                                                                       "For instance, to turn on debugserver logging set this to \"QSetLogging:bitmask=LOG_DEFAULT;\"" },
+    { "python-os-plugin-path", OptionValue::eTypeFileSpec, false, true, NULL, NULL, "A path to a python OS plug-in module file that contains a OperatingSystemPlugIn class." },
     {  NULL                  , OptionValue::eTypeInvalid, false, 0, NULL, NULL, NULL  }
 };
 
@@ -166,10 +169,10 @@
 {
     const char *cstr;
     if (m_pid != LLDB_INVALID_PROCESS_ID)       
-        s.Printf ("    pid = %llu\n", m_pid);
+        s.Printf ("    pid = %" PRIu64 "\n", m_pid);
 
     if (m_parent_pid != LLDB_INVALID_PROCESS_ID)
-        s.Printf (" parent = %llu\n", m_parent_pid);
+        s.Printf (" parent = %" PRIu64 "\n", m_parent_pid);
 
     if (m_executable)
     {
@@ -256,7 +259,7 @@
     if (m_pid != LLDB_INVALID_PROCESS_ID)
     {
         const char *cstr;
-        s.Printf ("%-6llu %-6llu ", m_pid, m_parent_pid);
+        s.Printf ("%-6" PRIu64 " %-6" PRIu64 " ", m_pid, m_parent_pid);
 
     
         if (verbose)
@@ -671,10 +674,6 @@
                                    file_actions, info->m_fd, info->m_path.c_str(), oflag, mode);
             }
             break;
-        
-        default:
-            error.SetErrorStringWithFormat ("invalid file action: %i", info->m_action);
-            break;
     }
     return error.Success();
 }
@@ -684,7 +683,7 @@
 ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
 {
     Error error;
-    char short_option = (char) m_getopt_table[option_idx].val;
+    const int short_option = m_getopt_table[option_idx].val;
     
     switch (short_option)
     {
@@ -836,7 +835,7 @@
         return false;
     
     if (m_match_info.GetArchitecture().IsValid() && 
-        m_match_info.GetArchitecture() != proc_info.GetArchitecture())
+        !m_match_info.GetArchitecture().IsCompatibleMatch(proc_info.GetArchitecture()))
         return false;
     return true;
 }
@@ -1409,7 +1408,7 @@
 {
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf ("Process::SetProcessExitStatus (baton=%p, pid=%llu, exited=%i, signal=%i, exit_status=%i)\n", 
+        log->Printf ("Process::SetProcessExitStatus (baton=%p, pid=%" PRIu64 ", exited=%i, signal=%i, exit_status=%i)\n",
                      callback_baton,
                      pid,
                      exited,
@@ -1710,7 +1709,7 @@
                         frame_sp->CalculateExecutionContext (exe_ctx);
                         bool unwind_on_error = true;
                         StreamString expr;
-                        expr.Printf("dlclose ((void *)0x%llx)", image_addr);
+                        expr.Printf("dlclose ((void *)0x%" PRIx64 ")", image_addr);
                         const char *prefix = "extern \"C\" int dlclose(void* handle);\n";
                         lldb::ValueObjectSP result_valobj_sp;
                         ClangUserExpression::Evaluate (exe_ctx,
@@ -1864,7 +1863,7 @@
     }
     else
     {
-        error.SetErrorStringWithFormat("invalid breakpoint site ID: %llu", break_id);
+        error.SetErrorStringWithFormat("invalid breakpoint site ID: %" PRIu64, break_id);
     }
 
     return error;
@@ -1882,7 +1881,7 @@
     }
     else
     {
-        error.SetErrorStringWithFormat("invalid breakpoint site ID: %llu", break_id);
+        error.SetErrorStringWithFormat("invalid breakpoint site ID: %" PRIu64, break_id);
     }
     return error;
 }
@@ -1986,11 +1985,11 @@
     LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_BREAKPOINTS));
     const addr_t bp_addr = bp_site->GetLoadAddress();
     if (log)
-        log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%llx", bp_site->GetID(), (uint64_t)bp_addr);
+        log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64, bp_site->GetID(), (uint64_t)bp_addr);
     if (bp_site->IsEnabled())
     {
         if (log)
-            log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- already enabled", bp_site->GetID(), (uint64_t)bp_addr);
+            log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- already enabled", bp_site->GetID(), (uint64_t)bp_addr);
         return error;
     }
 
@@ -2005,7 +2004,7 @@
 
     if (bp_opcode_size == 0)
     {
-        error.SetErrorStringWithFormat ("Process::GetSoftwareBreakpointTrapOpcode() returned zero, unable to get breakpoint trap for address 0x%llx", bp_addr);
+        error.SetErrorStringWithFormat ("Process::GetSoftwareBreakpointTrapOpcode() returned zero, unable to get breakpoint trap for address 0x%" PRIx64, bp_addr);
     }
     else
     {
@@ -2031,7 +2030,7 @@
                         bp_site->SetEnabled(true);
                         bp_site->SetType (BreakpointSite::eSoftware);
                         if (log)
-                            log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- SUCCESS",
+                            log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- SUCCESS",
                                          bp_site->GetID(),
                                          (uint64_t)bp_addr);
                     }
@@ -2048,7 +2047,7 @@
             error.SetErrorString("Unable to read memory at breakpoint address.");
     }
     if (log && error.Fail())
-        log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- FAILED: %s",
+        log->Printf ("Process::EnableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- FAILED: %s",
                      bp_site->GetID(),
                      (uint64_t)bp_addr,
                      error.AsCString());
@@ -2064,7 +2063,7 @@
     addr_t bp_addr = bp_site->GetLoadAddress();
     lldb::user_id_t breakID = bp_site->GetID();
     if (log)
-        log->Printf ("Process::DisableBreakpoint (breakID = %llu) addr = 0x%llx", breakID, (uint64_t)bp_addr);
+        log->Printf ("Process::DisableBreakpoint (breakID = %" PRIu64 ") addr = 0x%" PRIx64, breakID, (uint64_t)bp_addr);
 
     if (bp_site->IsHardware())
     {
@@ -2118,7 +2117,7 @@
                             // SUCCESS
                             bp_site->SetEnabled(false);
                             if (log)
-                                log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- SUCCESS", bp_site->GetID(), (uint64_t)bp_addr);
+                                log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- SUCCESS", bp_site->GetID(), (uint64_t)bp_addr);
                             return error;
                         }
                         else
@@ -2138,12 +2137,12 @@
     else
     {
         if (log)
-            log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- already disabled", bp_site->GetID(), (uint64_t)bp_addr);
+            log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- already disabled", bp_site->GetID(), (uint64_t)bp_addr);
         return error;
     }
 
     if (log)
-        log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%llx -- FAILED: %s",
+        log->Printf ("Process::DisableSoftwareBreakpoint (site_id = %d) addr = 0x%" PRIx64 " -- FAILED: %s",
                      bp_site->GetID(),
                      (uint64_t)bp_addr,
                      error.AsCString());
@@ -2493,7 +2492,7 @@
     addr_t allocated_addr = DoAllocateMemory (size, permissions, error);
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf("Process::AllocateMemory(size=%4zu, permissions=%s) => 0x%16.16llx (m_stop_id = %u m_memory_id = %u)", 
+        log->Printf("Process::AllocateMemory(size=%4zu, permissions=%s) => 0x%16.16" PRIx64 " (m_stop_id = %u m_memory_id = %u)",
                     size, 
                     GetPermissionsAsCString (permissions),
                     (uint64_t)allocated_addr,
@@ -2538,14 +2537,14 @@
 #if defined (USE_ALLOCATE_MEMORY_CACHE)
     if (!m_allocated_memory_cache.DeallocateMemory(ptr))
     {
-        error.SetErrorStringWithFormat ("deallocation of memory at 0x%llx failed.", (uint64_t)ptr);
+        error.SetErrorStringWithFormat ("deallocation of memory at 0x%" PRIx64 " failed.", (uint64_t)ptr);
     }
 #else
     error = DoDeallocateMemory (ptr);
     
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf("Process::DeallocateMemory(addr=0x%16.16llx) => err = %s (m_stop_id = %u, m_memory_id = %u)", 
+        log->Printf("Process::DeallocateMemory(addr=0x%16.16" PRIx64 ") => err = %s (m_stop_id = %u, m_memory_id = %u)",
                     ptr, 
                     error.AsCString("SUCCESS"),
                     m_mod_id.GetStopID(),
@@ -2584,7 +2583,7 @@
 }
 
 Error
-Process::EnableWatchpoint (Watchpoint *watchpoint)
+Process::EnableWatchpoint (Watchpoint *watchpoint, bool notify)
 {
     Error error;
     error.SetErrorString("watchpoints are not supported");
@@ -2592,7 +2591,7 @@
 }
 
 Error
-Process::DisableWatchpoint (Watchpoint *watchpoint)
+Process::DisableWatchpoint (Watchpoint *watchpoint, bool notify)
 {
     Error error;
     error.SetErrorString("watchpoints are not supported");
@@ -2976,7 +2975,7 @@
             ProcessInstanceInfo process_info;
             platform_sp->GetProcessInfo (GetID(), process_info);
             const ArchSpec &process_arch = process_info.GetArchitecture();
-            if (process_arch.IsValid() && m_target.GetArchitecture() != process_arch)
+            if (process_arch.IsValid() && !m_target.GetArchitecture().IsExactMatch(process_arch))
                 m_target.SetArchitecture (process_arch);
         }
     }
@@ -3371,7 +3370,6 @@
                     // This is a transition from stop to run.
                     switch (m_thread_list.ShouldReportRun (event_ptr))
                     {
-                        default:
                         case eVoteYes:
                         case eVoteNoOpinion:
                             return_value = true;
@@ -3454,9 +3452,9 @@
     // events make it to clients (into the DCProcess event queue).
     char thread_name[1024];
     if (already_running)
-        snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state-override(pid=%llu)>", GetID());
+        snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state-override(pid=%" PRIu64 ")>", GetID());
     else
-        snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state(pid=%llu)>", GetID());
+        snprintf(thread_name, sizeof(thread_name), "<lldb.process.internal-state(pid=%" PRIu64 ")>", GetID());
         
     // Create the private state thread, and start it running.
     m_private_state_thread = Host::ThreadCreate (thread_name, Process::PrivateStateThread, this, NULL);
@@ -3605,7 +3603,7 @@
     {
         if (log)
         {
-            log->Printf ("Process::%s (pid = %llu) broadcasting new state %s (old state %s) to %s", 
+            log->Printf ("Process::%s (pid = %" PRIu64 ") broadcasting new state %s (old state %s) to %s",
                          __FUNCTION__, 
                          GetID(), 
                          StateAsCString(new_state), 
@@ -3624,7 +3622,7 @@
     {
         if (log)
         {
-            log->Printf ("Process::%s (pid = %llu) suppressing state %s (old state %s): should_broadcast == false", 
+            log->Printf ("Process::%s (pid = %" PRIu64 ") suppressing state %s (old state %s): should_broadcast == false",
                          __FUNCTION__, 
                          GetID(), 
                          StateAsCString(new_state), 
@@ -3654,7 +3652,7 @@
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
     if (log)
-        log->Printf ("Process::%s (arg = %p, pid = %llu) thread starting...", __FUNCTION__, this, GetID());
+        log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") thread starting...", __FUNCTION__, this, GetID());
 
     bool exit_now = false;
     while (!exit_now)
@@ -3668,7 +3666,7 @@
         if (event_sp->BroadcasterIs(&m_private_state_control_broadcaster))
         {
             if (log)
-                log->Printf ("Process::%s (arg = %p, pid = %llu) got a control event: %d", __FUNCTION__, this, GetID(), event_sp->GetType());
+                log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") got a control event: %d", __FUNCTION__, this, GetID(), event_sp->GetType());
 
             switch (event_sp->GetType())
             {
@@ -3693,13 +3691,13 @@
             if (m_public_state.GetValue() == eStateAttaching)
             {
                 if (log)
-                    log->Printf ("Process::%s (arg = %p, pid = %llu) woke up with an interrupt while attaching - forwarding interrupt.", __FUNCTION__, this, GetID());
+                    log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") woke up with an interrupt while attaching - forwarding interrupt.", __FUNCTION__, this, GetID());
                 BroadcastEvent (eBroadcastBitInterrupt, NULL);
             }
             else
             {
                 if (log)
-                    log->Printf ("Process::%s (arg = %p, pid = %llu) woke up with an interrupt - Halting.", __FUNCTION__, this, GetID());
+                    log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") woke up with an interrupt - Halting.", __FUNCTION__, this, GetID());
                 Halt();
             }
             continue;
@@ -3717,7 +3715,7 @@
             internal_state == eStateDetached )
         {
             if (log)
-                log->Printf ("Process::%s (arg = %p, pid = %llu) about to exit with internal state %s...", __FUNCTION__, this, GetID(), StateAsCString(internal_state));
+                log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") about to exit with internal state %s...", __FUNCTION__, this, GetID(), StateAsCString(internal_state));
 
             break;
         }
@@ -3725,7 +3723,7 @@
 
     // Verify log is still enabled before attempting to write to it...
     if (log)
-        log->Printf ("Process::%s (arg = %p, pid = %llu) thread exiting...", __FUNCTION__, this, GetID());
+        log->Printf ("Process::%s (arg = %p, pid = %" PRIu64 ") thread exiting...", __FUNCTION__, this, GetID());
 
     m_private_state_control_wait.SetValue (true, eBroadcastAlways);
     m_private_state_thread = LLDB_INVALID_HOST_THREAD;
@@ -3807,7 +3805,11 @@
         for (idx = 0; idx < num_threads; ++idx)
             thread_index_array[idx] = curr_thread_list.GetThreadAtIndex(idx)->GetIndexID();
         
-        bool still_should_stop = true;
+        // Use this to track whether we should continue from here.  We will only continue the target running if
+        // no thread says we should stop.  Of course if some thread's PerformAction actually sets the target running,
+        // then it doesn't matter what the other threads say...
+        
+        bool still_should_stop = false;
         
         for (idx = 0; idx < num_threads; ++idx)
         {
@@ -3848,10 +3850,10 @@
                     SetRestarted (true);
                     break;
                 }
-                else if (!stop_info_sp->ShouldStop(event_ptr))
-                {
-                    still_should_stop = false;
-                }
+                
+                bool this_thread_wants_to_stop = stop_info_sp->ShouldStop(event_ptr);
+                if (still_should_stop == false)
+                    still_should_stop = this_thread_wants_to_stop;
             }
         }
 
@@ -3883,7 +3885,7 @@
 Process::ProcessEventData::Dump (Stream *s) const
 {
     if (m_process_sp)
-        s->Printf(" process = %p (pid = %llu), ", m_process_sp.get(), m_process_sp->GetID());
+        s->Printf(" process = %p (pid = %" PRIu64 "), ", m_process_sp.get(), m_process_sp->GetID());
 
     s->Printf("state = %s", StateAsCString(GetState()));
 }
@@ -4021,7 +4023,7 @@
 Process::BroadcastAsyncProfileData(const char *s, size_t len)
 {
     Mutex::Locker locker (m_profile_data_comm_mutex);
-    m_profile_data.append (s, len);
+    m_profile_data.push_back(s);
     BroadcastEventIfUnique (eBroadcastBitProfileData, new ProcessEventData (shared_from_this(), GetState()));
 }
 
@@ -4029,22 +4031,25 @@
 Process::GetAsyncProfileData (char *buf, size_t buf_size, Error &error)
 {
     Mutex::Locker locker(m_profile_data_comm_mutex);
-    size_t bytes_available = m_profile_data.size();
+    if (m_profile_data.empty())
+        return 0;
+
+    size_t bytes_available = m_profile_data.front().size();
     if (bytes_available > 0)
     {
         LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
         if (log)
-            log->Printf ("Process::GetProfileData (buf = %p, size = %llu)", buf, (uint64_t)buf_size);
+            log->Printf ("Process::GetProfileData (buf = %p, size = %" PRIu64 ")", buf, (uint64_t)buf_size);
         if (bytes_available > buf_size)
         {
-            memcpy(buf, m_profile_data.c_str(), buf_size);
-            m_profile_data.erase(0, buf_size);
+            memcpy(buf, m_profile_data.front().data(), buf_size);
+            m_profile_data.front().erase(0, buf_size);
             bytes_available = buf_size;
         }
         else
         {
-            memcpy(buf, m_profile_data.c_str(), bytes_available);
-            m_profile_data.clear();
+            memcpy(buf, m_profile_data.front().data(), bytes_available);
+            m_profile_data.erase(m_profile_data.begin());
         }
     }
     return bytes_available;
@@ -4064,7 +4069,7 @@
     {
         LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
         if (log)
-            log->Printf ("Process::GetSTDOUT (buf = %p, size = %llu)", buf, (uint64_t)buf_size);
+            log->Printf ("Process::GetSTDOUT (buf = %p, size = %" PRIu64 ")", buf, (uint64_t)buf_size);
         if (bytes_available > buf_size)
         {
             memcpy(buf, m_stdout_data.c_str(), buf_size);
@@ -4090,7 +4095,7 @@
     {
         LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
         if (log)
-            log->Printf ("Process::GetSTDERR (buf = %p, size = %llu)", buf, (uint64_t)buf_size);
+            log->Printf ("Process::GetSTDERR (buf = %p, size = %" PRIu64 ")", buf, (uint64_t)buf_size);
         if (bytes_available > buf_size)
         {
             memcpy(buf, m_stderr_data.c_str(), buf_size);
@@ -4372,7 +4377,7 @@
         {
             StreamString s;
             thread_plan_sp->GetDescription(&s, lldb::eDescriptionLevelVerbose);
-            log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4llx to run thread plan \"%s\".",  
+            log->Printf ("Process::RunThreadPlan(): Resuming thread %u - 0x%4.4" PRIx64 " to run thread plan \"%s\".",
                          thread->GetIndexID(), 
                          thread->GetID(), 
                          s.GetData());
@@ -4390,6 +4395,9 @@
         const uint64_t default_one_thread_timeout_usec = 250000;
         uint64_t computed_timeout = 0;
         
+        // This while loop must exit out the bottom, there's cleanup that we need to do when we are done.
+        // So don't call return anywhere within it.
+        
         while (1)
         {
             // We usually want to resume the process if we get to the top of the loop.
@@ -4623,7 +4631,7 @@
                     if (run_others)
                     {
                         if (first_timeout)
-                            log->Printf ("Process::RunThreadPlan(): Running function with timeout: %lld timed out, "
+                            log->Printf ("Process::RunThreadPlan(): Running function with timeout: %" PRId64 " timed out, "
                                          "trying  for %d usec with all threads enabled.",
                                          computed_timeout, timeout_usec);
                         else
@@ -4797,6 +4805,12 @@
 
         }
         
+        // Restore the thread state if we are going to discard the plan execution.
+        
+        if (return_value == eExecutionCompleted || discard_on_error)
+        {
+            thread_plan_sp->RestoreThreadState();
+        }
         
         // Now do some processing on the results of the run:
         if (return_value == eExecutionInterrupted)
@@ -4864,11 +4878,11 @@
                                 continue;
                             }
                             
-                            ts.Printf("<0x%4.4llx ", thread->GetID());
+                            ts.Printf("<0x%4.4" PRIx64 " ", thread->GetID());
                             RegisterContext *register_context = thread->GetRegisterContext().get();
                             
                             if (register_context)
-                                ts.Printf("[ip 0x%llx] ", register_context->GetPC());
+                                ts.Printf("[ip 0x%" PRIx64 "] ", register_context->GetPC());
                             else
                                 ts.Printf("[ip unknown] ");
                             
@@ -5016,7 +5030,7 @@
         {
             int exit_status = GetExitStatus();
             const char *exit_description = GetExitDescription();
-            strm.Printf ("Process %llu exited with status = %i (0x%8.8x) %s\n",
+            strm.Printf ("Process %" PRIu64 " exited with status = %i (0x%8.8x) %s\n",
                           GetID(),
                           exit_status,
                           exit_status,
@@ -5027,12 +5041,12 @@
             if (state == eStateConnected)
                 strm.Printf ("Connected to remote target.\n");
             else
-                strm.Printf ("Process %llu %s\n", GetID(), StateAsCString (state));
+                strm.Printf ("Process %" PRIu64 " %s\n", GetID(), StateAsCString (state));
         }
     }
     else
     {
-        strm.Printf ("Process %llu is running.\n", GetID());
+        strm.Printf ("Process %" PRIu64 " is running.\n", GetID());
     }
 }
 
@@ -5111,3 +5125,22 @@
 {
     m_thread_list.Flush();
 }
+
+void
+Process::DidExec ()
+{
+    Target &target = GetTarget();
+    target.CleanupProcess ();
+    ModuleList unloaded_modules (target.GetImages());
+    target.ModulesDidUnload (unloaded_modules);
+    target.GetSectionLoadList().Clear();
+    m_dynamic_checkers_ap.reset();
+    m_abi_sp.reset();
+    m_os_ap.reset();
+    m_dyld_ap.reset();    
+    m_image_tokens.clear();
+    m_allocated_memory_cache.Clear();
+    m_language_runtimes.clear();
+    DoDidExec();
+    CompleteAttach ();
+}

Modified: lldb/branches/windows/source/Target/SectionLoadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/SectionLoadList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/SectionLoadList.cpp (original)
+++ lldb/branches/windows/source/Target/SectionLoadList.cpp Tue Jan  8 06:51:53 2013
@@ -64,7 +64,7 @@
     if (log)
     {
         const FileSpec &module_file_spec (section->GetModule()->GetFileSpec());
-        log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
+        log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16" PRIx64 ")",
                      __FUNCTION__,
                      section.get(),
                      module_file_spec.GetDirectory().AsCString(),
@@ -112,7 +112,7 @@
                 ModuleSP curr_module_sp (ats_pos->second->GetModule());
                 if (curr_module_sp)
                 {
-                    module_sp->ReportWarning ("address 0x%16.16llx maps to more than one section: %s.%s and %s.%s",
+                    module_sp->ReportWarning ("address 0x%16.16" PRIx64 " maps to more than one section: %s.%s and %s.%s",
                                               load_addr, 
                                               module_sp->GetFileSpec().GetFilename().GetCString(), 
                                               section->GetName().GetCString(),
@@ -174,7 +174,7 @@
     if (log)
     {
         const FileSpec &module_file_spec (section_sp->GetModule()->GetFileSpec());
-        log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16llx)",
+        log->Printf ("SectionLoadList::%s (section = %p (%s%s%s.%s), load_addr = 0x%16.16" PRIx64 ")",
                      __FUNCTION__,
                      section_sp.get(),
                      module_file_spec.GetDirectory().AsCString(),
@@ -254,7 +254,7 @@
     addr_to_sect_collection::const_iterator pos, end;
     for (pos = m_addr_to_sect.begin(), end = m_addr_to_sect.end(); pos != end; ++pos)
     {
-        s.Printf("addr = 0x%16.16llx, section = %p: ", pos->first, pos->second.get());
+        s.Printf("addr = 0x%16.16" PRIx64 ", section = %p: ", pos->first, pos->second.get());
         pos->second->Dump (&s, target, 0);
     }
 }

Modified: lldb/branches/windows/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/StackFrame.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/StackFrame.cpp (original)
+++ lldb/branches/windows/source/Target/StackFrame.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Target/StackFrame.h"
 
 // C Includes
@@ -317,6 +319,17 @@
     // Copy our internal symbol context into "sc".
     if ((m_flags.Get() & resolve_scope) != resolve_scope)
     {
+        uint32_t resolved = 0;
+
+        // If the target was requested add that:
+        if (!m_sc.target_sp)
+        {
+            m_sc.target_sp = CalculateTarget();
+            if (m_sc.target_sp)
+                resolved |= eSymbolContextTarget;
+        }
+        
+
         // 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
         // contain the module to which it belongs
@@ -336,7 +349,6 @@
         }
 
 
-        uint32_t resolved = 0;
         if (m_sc.module_sp)
         {
             // We have something in our stack frame symbol context, lets check
@@ -420,9 +432,18 @@
                     m_sc.block = sc.block;
                 if ((resolved & eSymbolContextSymbol)    && m_sc.symbol == NULL)  
                     m_sc.symbol = sc.symbol;
-                if ((resolved & eSymbolContextLineEntry) && !m_sc.line_entry.IsValid()) 
+                if ((resolved & eSymbolContextLineEntry) && !m_sc.line_entry.IsValid())
+                {
                     m_sc.line_entry = sc.line_entry;
-
+                    if (m_sc.target_sp)
+                    {
+                        // Be sure to apply and file remappings to our file and line
+                        // entries when handing out a line entry
+                        FileSpec new_file_spec;
+                        if (m_sc.target_sp->GetSourcePathMap().FindFile (m_sc.line_entry.file, new_file_spec))
+                            m_sc.line_entry.file = new_file_spec;
+                    }
+                }
             }
         }
         else
@@ -430,17 +451,8 @@
             // If we don't have a module, then we can't have the compile unit,
             // function, block, line entry or symbol, so we can safely call
             // ResolveSymbolContextForAddress with our symbol context member m_sc.
-            TargetSP target_sp (CalculateTarget());
-            if (target_sp)
-                resolved |= target_sp->GetImages().ResolveSymbolContextForAddress (lookup_addr, resolve_scope, m_sc);
-        }
-
-        // If the target was requested add that:
-        if (!m_sc.target_sp)
-        {
-            m_sc.target_sp = CalculateTarget();
             if (m_sc.target_sp)
-                resolved |= eSymbolContextTarget;
+                resolved |= m_sc.target_sp->GetImages().ResolveSymbolContextForAddress (lookup_addr, resolve_scope, m_sc);
         }
 
         // Update our internal flags so we remember what we have tried to locate so
@@ -780,6 +792,7 @@
                                     deref = false;
                                 }
                                 
+                                bool is_incomplete_array = false;
                                 if (valobj_sp->IsPointerType ())
                                 {
                                     bool is_objc_pointer = true;
@@ -843,11 +856,14 @@
                                         }
                                     }
                                 }
-                                else if (ClangASTContext::IsArrayType (valobj_sp->GetClangType(), NULL, NULL))
+                                else if (ClangASTContext::IsArrayType (valobj_sp->GetClangType(), NULL, NULL, &is_incomplete_array))
                                 {
                                     // Pass false to dynamic_value here so we can tell the difference between
                                     // no dynamic value and no member of this type...
                                     child_valobj_sp = valobj_sp->GetChildAtIndex (child_index, true);
+                                    if (!child_valobj_sp && (is_incomplete_array || no_synth_child == false))
+                                        child_valobj_sp = valobj_sp->GetSyntheticArrayMember (child_index, true);
+
                                     if (!child_valobj_sp)
                                     {
                                         valobj_sp->GetExpressionPath (var_expr_path_strm, false);
@@ -1288,7 +1304,7 @@
         strm->Printf("frame #%u: ", m_frame_index);
     ExecutionContext exe_ctx (shared_from_this());
     Target *target = exe_ctx.GetTargetPtr();
-    strm->Printf("0x%0*llx ", 
+    strm->Printf("0x%0*" PRIx64 " ",
                  target ? (target->GetArchitecture().GetAddressByteSize() * 2) : 16,
                  GetFrameCodeAddress().GetLoadAddress(target));
     GetSymbolContext(eSymbolContextEverything);

Modified: lldb/branches/windows/source/Target/StackFrameList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/StackFrameList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/StackFrameList.cpp (original)
+++ lldb/branches/windows/source/Target/StackFrameList.cpp Tue Jan  8 06:51:53 2013
@@ -147,6 +147,7 @@
                             {
                             case eStopReasonWatchpoint:
                             case eStopReasonException:
+                            case eStopReasonExec:
                             case eStopReasonSignal:
                                 // In all these cases we want to stop in the deepest most frame.
                                 m_current_inlined_pc = curr_pc;
@@ -205,7 +206,7 @@
                                     m_current_inlined_depth = num_inlined_functions + 1;
                                     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
                                     if (log && log->GetVerbose())
-                                        log->Printf ("ResetCurrentInlinedDepth: setting inlined depth: %d 0x%llx.\n", m_current_inlined_depth, curr_pc);
+                                        log->Printf ("ResetCurrentInlinedDepth: setting inlined depth: %d 0x%" PRIx64 ".\n", m_current_inlined_depth, curr_pc);
                                     
                                 }
                                 break;
@@ -370,7 +371,7 @@
             
             //curr_frames->m_current_inlined_depth = prev_frames->m_current_inlined_depth;
             //curr_frames->m_current_inlined_pc = prev_frames->m_current_inlined_pc;
-            //printf ("GetFramesUpTo: Copying current inlined depth: %d 0x%llx.\n", curr_frames->m_current_inlined_depth, curr_frames->m_current_inlined_pc);
+            //printf ("GetFramesUpTo: Copying current inlined depth: %d 0x%" PRIx64 ".\n", curr_frames->m_current_inlined_depth, curr_frames->m_current_inlined_pc);
 
 #if defined (DEBUG_STACK_FRAMES)
             s.PutCString("\nprev_frames:\n");

Modified: lldb/branches/windows/source/Target/StackID.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/StackID.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/StackID.cpp (original)
+++ lldb/branches/windows/source/Target/StackID.cpp Tue Jan  8 06:51:53 2013
@@ -24,14 +24,14 @@
 void
 StackID::Dump (Stream *s)
 {
-    s->Printf("StackID (pc = 0x%16.16llx, cfa = 0x%16.16llx, symbol_scope = %p", (uint64_t)m_pc, (uint64_t)m_cfa, m_symbol_scope);
+    s->Printf("StackID (pc = 0x%16.16" PRIx64 ", cfa = 0x%16.16" PRIx64 ", symbol_scope = %p", (uint64_t)m_pc, (uint64_t)m_cfa, m_symbol_scope);
     if (m_symbol_scope)
     {
         SymbolContext sc;
     
         m_symbol_scope->CalculateSymbolContext (&sc);
         if (sc.block)
-            s->Printf(" (Block {0x%8.8llx})", sc.block->GetID());
+            s->Printf(" (Block {0x%8.8" PRIx64 "})", sc.block->GetID());
         else if (sc.symbol)
             s->Printf(" (Symbol{0x%8.8x})", sc.symbol->GetID());
     }

Modified: lldb/branches/windows/source/Target/StopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/StopInfo.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/StopInfo.cpp (original)
+++ lldb/branches/windows/source/Target/StopInfo.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Target/StopInfo.h"
 
 // C Includes
@@ -165,7 +167,7 @@
                 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
                 if (log)
-                    log->Printf ("Process::%s could not find breakpoint site id: %lld...", __FUNCTION__, m_value);
+                    log->Printf ("Process::%s could not find breakpoint site id: %" PRId64 "...", __FUNCTION__, m_value);
 
                 m_should_stop = true;
             }
@@ -219,9 +221,9 @@
                         strm.Printf ("breakpoint %d which has been deleted.", m_break_id);
                 }
                 else if (m_address == LLDB_INVALID_ADDRESS)
-                    strm.Printf("breakpoint site %lli which has been deleted - unknown address", m_value);
+                    strm.Printf("breakpoint site %" PRIi64 " which has been deleted - unknown address", m_value);
                 else
-                    strm.Printf("breakpoint site %lli which has been deleted - was at 0x%llx", m_value, m_address);
+                    strm.Printf("breakpoint site %" PRIi64 " which has been deleted - was at 0x%" PRIx64, m_value, m_address);
                 
                 m_description.swap (strm.GetString());
             }
@@ -397,7 +399,7 @@
             LogSP log_process(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
             if (log_process)
-                log_process->Printf ("Process::%s could not find breakpoint site id: %lld...", __FUNCTION__, m_value);
+                log_process->Printf ("Process::%s could not find breakpoint site id: %" PRId64 "...", __FUNCTION__, m_value);
         }
         if (log)
             log->Printf ("Process::%s returning from action with m_should_stop: %d.", __FUNCTION__, m_should_stop);
@@ -433,8 +435,9 @@
         {
             if (process && watchpoint)
             {
+                const bool notify = false;
                 watchpoint->TurnOnEphemeralMode();
-                process->DisableWatchpoint(watchpoint);
+                process->DisableWatchpoint(watchpoint, notify);
             }
         }
         ~WatchpointSentry()
@@ -442,7 +445,10 @@
             if (process && watchpoint)
             {
                 if (!watchpoint->IsDisabledDuringEphemeralMode())
-                    process->EnableWatchpoint(watchpoint);
+                {
+                    const bool notify = false;
+                    process->EnableWatchpoint(watchpoint, notify);
+                }
                 watchpoint->TurnOffEphemeralMode();
             }
         }
@@ -475,7 +481,7 @@
         if (m_description.empty())
         {
             StreamString strm;
-            strm.Printf("watchpoint %lli", m_value);
+            strm.Printf("watchpoint %" PRIi64, m_value);
             m_description.swap (strm.GetString());
         }
         return m_description.c_str();
@@ -509,7 +515,7 @@
             LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
             if (log)
-                log->Printf ("Process::%s could not find watchpoint location id: %lld...",
+                log->Printf ("Process::%s could not find watchpoint location id: %" PRId64 "...",
                              __FUNCTION__, GetValue());
 
             m_should_stop = true;
@@ -666,7 +672,7 @@
             LogSP log_process(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_PROCESS));
 
             if (log_process)
-                log_process->Printf ("Process::%s could not find watchpoint id: %lld...", __FUNCTION__, m_value);
+                log_process->Printf ("Process::%s could not find watchpoint id: %" PRId64 "...", __FUNCTION__, m_value);
         }
         if (log)
             log->Printf ("Process::%s returning from action with m_should_stop: %d.", __FUNCTION__, m_should_stop);
@@ -737,7 +743,7 @@
             if (signal_name)
                 strm.Printf("signal %s", signal_name);
             else
-                strm.Printf("signal %lli", m_value);
+                strm.Printf("signal %" PRIi64, m_value);
             m_description.swap (strm.GetString());
         }
         return m_description.c_str();
@@ -862,6 +868,49 @@
     ThreadPlanSP m_plan_sp;
     ValueObjectSP m_return_valobj_sp;
 };
+    
+class StopInfoExec : public StopInfo
+{
+public:
+    
+    StopInfoExec (Thread &thread) :
+        StopInfo (thread, LLDB_INVALID_UID),
+        m_performed_action (false)
+    {
+    }
+    
+    virtual
+    ~StopInfoExec ()
+    {
+    }
+    
+    virtual StopReason
+    GetStopReason () const
+    {
+        return eStopReasonExec;
+    }
+    
+    virtual const char *
+    GetDescription ()
+    {
+        return "exec";
+    }
+protected:
+protected:
+    
+    virtual void
+    PerformAction (Event *event_ptr)
+    {
+        // Only perform the action once
+        if (m_performed_action)
+            return;
+        m_performed_action = true;
+        m_thread.GetProcess()->DidExec();
+    }
+    
+    bool m_performed_action;
+};
+
 } // namespace lldb_private
 
 StopInfoSP
@@ -906,6 +955,12 @@
     return StopInfoSP (new StopInfoException (thread, description));
 }
 
+StopInfoSP
+StopInfo::CreateStopReasonWithExec (Thread &thread)
+{
+    return StopInfoSP (new StopInfoExec (thread));
+}
+
 ValueObjectSP
 StopInfo::GetReturnValueObject(StopInfoSP &stop_info_sp)
 {

Modified: lldb/branches/windows/source/Target/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Target.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Target.cpp (original)
+++ lldb/branches/windows/source/Target/Target.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Target/Target.h"
 
 // C Includes
@@ -64,7 +66,20 @@
     m_platform_sp (platform_sp),
     m_mutex (Mutex::eMutexTypeRecursive), 
     m_arch (target_arch),
+#ifndef LLDB_DISABLE_PYTHON
     m_images (this),
+#else
+    // FIXME: The module added notification needed for python scripting support 
+    // causes a problem with in-memory-only Modules at startup if we have
+    // a breakpoint (the ObjectFile is parsed before we've set the Section load
+    // addresses leading to an invalid __LINKEDIT section addr on Mac OS X and
+    // all the problems that will happen from that).  
+    // As a temporary solution for iOS debugging (where all the modules are in-memory-only), 
+    // disable this notification system there. The problem could still happen on 
+    // an x86 system but it is much less common. 
+    // <rdar://problem/12831670> describes the failure mode for on-iOS debugging.
+    m_images (NULL),
+#endif
     m_section_load_list (),
     m_breakpoint_list (false),
     m_internal_breakpoint_list (true),
@@ -86,12 +101,17 @@
     SetEventName (eBroadcastBitBreakpointChanged, "breakpoint-changed");
     SetEventName (eBroadcastBitModulesLoaded, "modules-loaded");
     SetEventName (eBroadcastBitModulesUnloaded, "modules-unloaded");
+    SetEventName (eBroadcastBitWatchpointChanged, "watchpoint-changed");
     
     CheckInWithManager();
 
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
     if (log)
         log->Printf ("%p Target::Target()", this);
+    if (m_arch.IsValid())
+    {
+        LogIfAnyCategoriesSet(LIBLLDB_LOG_TARGET, "Target::Target created with architecture %s (%s)", m_arch.GetArchitectureName(), m_arch.GetTriple().getTriple().c_str());
+    }
 }
 
 //----------------------------------------------------------------------
@@ -130,6 +150,21 @@
 }
 
 void
+Target::CleanupProcess ()
+{
+    // Do any cleanup of the target we need to do between process instances.
+    // NB It is better to do this before destroying the process in case the
+    // clean up needs some help from the process.
+    m_breakpoint_list.ClearAllBreakpointSites();
+    m_internal_breakpoint_list.ClearAllBreakpointSites();
+    // Disable watchpoints just on the debugger side.
+    Mutex::Locker locker;
+    this->GetWatchpointList().GetListMutex(locker);
+    DisableAllWatchpoints(false);
+    ClearAllWatchpointHitCounts();
+}
+
+void
 Target::DeleteCurrentProcess ()
 {
     if (m_process_sp.get())
@@ -140,16 +175,8 @@
         
         m_process_sp->Finalize();
 
-        // Do any cleanup of the target we need to do between process instances.
-        // NB It is better to do this before destroying the process in case the
-        // clean up needs some help from the process.
-        m_breakpoint_list.ClearAllBreakpointSites();
-        m_internal_breakpoint_list.ClearAllBreakpointSites();
-        // Disable watchpoints just on the debugger side.
-        Mutex::Locker locker;
-        this->GetWatchpointList().GetListMutex(locker);
-        DisableAllWatchpoints(false);
-        ClearAllWatchpointHitCounts();
+        CleanupProcess ();
+
         m_process_sp.reset();
     }
 }
@@ -527,7 +554,7 @@
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_WATCHPOINTS));
     if (log)
-        log->Printf("Target::%s (addr = 0x%8.8llx size = %llu type = %u)\n",
+        log->Printf("Target::%s (addr = 0x%8.8" PRIx64 " size = %" PRIu64 " type = %u)\n",
                     __FUNCTION__, addr, (uint64_t)size, kind);
 
     WatchpointSP wp_sp;
@@ -541,7 +568,7 @@
         if (size == 0)
             error.SetErrorString("cannot set a watchpoint with watch_size of 0");
         else
-            error.SetErrorStringWithFormat("invalid watch address: %llu", addr);
+            error.SetErrorStringWithFormat("invalid watch address: %" PRIu64, addr);
         return wp_sp;
     }
 
@@ -549,6 +576,7 @@
     // of watchpoints limited by the hardware which the inferior is running on.
 
     // Grab the list mutex while doing operations.
+    const bool notify = false;   // Don't notify about all the state changes we do on creating the watchpoint.
     Mutex::Locker locker;
     this->GetWatchpointList().GetListMutex(locker);
     WatchpointSP matched_sp = m_watchpoint_list.FindByAddress(addr);
@@ -561,36 +589,33 @@
         // Return the existing watchpoint if both size and type match.
         if (size == old_size && kind == old_type) {
             wp_sp = matched_sp;
-            wp_sp->SetEnabled(false);
+            wp_sp->SetEnabled(false, notify);
         } else {
             // Nil the matched watchpoint; we will be creating a new one.
-            m_process_sp->DisableWatchpoint(matched_sp.get());
-            m_watchpoint_list.Remove(matched_sp->GetID());
+            m_process_sp->DisableWatchpoint(matched_sp.get(), notify);
+            m_watchpoint_list.Remove(matched_sp->GetID(), true);
         }
     }
 
-    if (!wp_sp) {
-        Watchpoint *new_wp = new Watchpoint(*this, addr, size, type);
-        if (!new_wp) {
-            printf("Watchpoint ctor failed, out of memory?\n");
-            return wp_sp;
-        }
-        new_wp->SetWatchpointType(kind);
-        wp_sp.reset(new_wp);
-        m_watchpoint_list.Add(wp_sp);
+    if (!wp_sp) 
+    {
+        wp_sp.reset(new Watchpoint(*this, addr, size, type));
+        wp_sp->SetWatchpointType(kind, notify);
+        m_watchpoint_list.Add (wp_sp, true);
     }
 
-    error = m_process_sp->EnableWatchpoint(wp_sp.get());
+    error = m_process_sp->EnableWatchpoint(wp_sp.get(), notify);
     if (log)
-            log->Printf("Target::%s (creation of watchpoint %s with id = %u)\n",
-                        __FUNCTION__,
-                        error.Success() ? "succeeded" : "failed",
-                        wp_sp->GetID());
+        log->Printf("Target::%s (creation of watchpoint %s with id = %u)\n",
+                    __FUNCTION__,
+                    error.Success() ? "succeeded" : "failed",
+                    wp_sp->GetID());
 
-    if (error.Fail()) {
+    if (error.Fail()) 
+    {
         // Enabling the watchpoint on the device side failed.
         // Remove the said watchpoint from the list maintained by the target instance.
-        m_watchpoint_list.Remove(wp_sp->GetID());
+        m_watchpoint_list.Remove (wp_sp->GetID(), true);
         // See if we could provide more helpful error message.
         if (!CheckIfWatchpointsExhausted(this, error))
         {
@@ -726,7 +751,7 @@
         log->Printf ("Target::%s\n", __FUNCTION__);
 
     if (!end_to_end) {
-        m_watchpoint_list.RemoveAll();
+        m_watchpoint_list.RemoveAll(true);
         return true;
     }
 
@@ -746,7 +771,7 @@
         if (rc.Fail())
             return false;
     }
-    m_watchpoint_list.RemoveAll ();
+    m_watchpoint_list.RemoveAll (true);
     return true; // Success!
 }
 
@@ -916,7 +941,7 @@
 
     if (DisableWatchpointByID (watch_id))
     {
-        m_watchpoint_list.Remove(watch_id);
+        m_watchpoint_list.Remove(watch_id, true);
         return true;
     }
     return false;
@@ -969,6 +994,7 @@
 void
 Target::SetExecutableModule (ModuleSP& executable_sp, bool get_dependent_files)
 {
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TARGET));
     m_images.Clear();
     m_scratch_ast_context_ap.reset();
     m_scratch_ast_source_ap.reset();
@@ -985,8 +1011,12 @@
 
         // If we haven't set an architecture yet, reset our architecture based on what we found in the executable module.
         if (!m_arch.IsValid())
+        {
             m_arch = executable_sp->GetArchitecture();
-        
+            if (log)
+              log->Printf ("Target::SetExecutableModule setting architecture to %s (%s) based on executable file", m_arch.GetArchitectureName(), m_arch.GetTriple().getTriple().c_str());
+        }
+
         FileSpecList dependent_files;
         ObjectFile *executable_objfile = executable_sp->GetObjectFile();
 
@@ -1019,18 +1049,23 @@
 bool
 Target::SetArchitecture (const ArchSpec &arch_spec)
 {
-    if (m_arch == arch_spec || !m_arch.IsValid())
+    LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TARGET));
+    if (m_arch.IsCompatibleMatch(arch_spec) || !m_arch.IsValid())
     {
         // If we haven't got a valid arch spec, or the architectures are
         // compatible, so just update the architecture. Architectures can be
         // equal, yet the triple OS and vendor might change, so we need to do
         // the assignment here just in case.
         m_arch = arch_spec;
+        if (log)
+            log->Printf ("Target::SetArchitecture setting architecture to %s (%s)", arch_spec.GetArchitectureName(), arch_spec.GetTriple().getTriple().c_str());
         return true;
     }
     else
     {
         // If we have an executable file, try to reset the executable to the desired architecture
+        if (log)
+          log->Printf ("Target::SetArchitecture changing architecture to %s (%s)", arch_spec.GetArchitectureName(), arch_spec.GetTriple().getTriple().c_str());
         m_arch = arch_spec;
         ModuleSP executable_sp = GetExecutableModule ();
         m_images.Clear();
@@ -1041,6 +1076,8 @@
         
         if (executable_sp)
         {
+            if (log)
+              log->Printf("Target::SetArchitecture Trying to select executable file architecture %s (%s)", arch_spec.GetArchitectureName(), arch_spec.GetTriple().getTriple().c_str());
             ModuleSpec module_spec (executable_sp->GetFileSpec(), arch_spec);
             Error error = ModuleList::GetSharedModule (module_spec, 
                                                        executable_sp, 
@@ -1244,12 +1281,12 @@
         {
             ModuleSP addr_module_sp (resolved_addr.GetModule());
             if (addr_module_sp && addr_module_sp->GetFileSpec())
-                error.SetErrorStringWithFormat("%s[0x%llx] can't be resolved, %s in not currently loaded", 
+                error.SetErrorStringWithFormat("%s[0x%" PRIx64 "] can't be resolved, %s in not currently loaded",
                                                addr_module_sp->GetFileSpec().GetFilename().AsCString(), 
                                                resolved_addr.GetFileAddress(),
                                                addr_module_sp->GetFileSpec().GetFilename().AsCString());
             else
-                error.SetErrorStringWithFormat("0x%llx can't be resolved", resolved_addr.GetFileAddress());
+                error.SetErrorStringWithFormat("0x%" PRIx64 " can't be resolved", resolved_addr.GetFileAddress());
         }
         else
         {
@@ -1259,9 +1296,9 @@
                 if (error.Success())
                 {
                     if (bytes_read == 0)
-                        error.SetErrorStringWithFormat("read memory from 0x%llx failed", load_addr);
+                        error.SetErrorStringWithFormat("read memory from 0x%" PRIx64 " failed", load_addr);
                     else
-                        error.SetErrorStringWithFormat("only %llu of %llu bytes were read from memory at 0x%llx", (uint64_t)bytes_read, (uint64_t)dst_len, load_addr);
+                        error.SetErrorStringWithFormat("only %" PRIu64 " of %" PRIu64 " bytes were read from memory at 0x%" PRIx64, (uint64_t)bytes_read, (uint64_t)dst_len, load_addr);
                 }
             }
             if (bytes_read)
@@ -1460,38 +1497,63 @@
         // module in the list already, and if there was, let's remove it.
         if (module_sp)
         {
-            // GetSharedModule is not guaranteed to find the old shared module, for instance
-            // in the common case where you pass in the UUID, it is only going to find the one
-            // module matching the UUID.  In fact, it has no good way to know what the "old module"
-            // relevant to this target is, since there might be many copies of a module with this file spec
-            // in various running debug sessions, but only one of them will belong to this target.
-            // So let's remove the UUID from the module list, and look in the target's module list.
-            // Only do this if there is SOMETHING else in the module spec...
-            if (!old_module_sp)
+            ObjectFile *objfile = module_sp->GetObjectFile();
+            if (objfile)
             {
-                if (module_spec.GetUUID().IsValid() && !module_spec.GetFileSpec().GetFilename().IsEmpty() && !module_spec.GetFileSpec().GetDirectory().IsEmpty())
+                switch (objfile->GetType())
                 {
-                    ModuleSpec module_spec_copy(module_spec.GetFileSpec());
-                    module_spec_copy.GetUUID().Clear();
-                    
-                    ModuleList found_modules;
-                    size_t num_found = m_images.FindModules (module_spec_copy, found_modules);
-                    if (num_found == 1)
+                    case ObjectFile::eTypeCoreFile:      /// A core file that has a checkpoint of a program's execution state
+                    case ObjectFile::eTypeExecutable:    /// A normal executable
+                    case ObjectFile::eTypeDynamicLinker: /// The platform's dynamic linker executable
+                    case ObjectFile::eTypeObjectFile:    /// An intermediate object file
+                    case ObjectFile::eTypeSharedLibrary: /// A shared library that can be used during execution
+                        break;
+                    case ObjectFile::eTypeDebugInfo:     /// An object file that contains only debug information
+                        if (error_ptr)
+                            error_ptr->SetErrorString("debug info files aren't valid target modules, please specify an executable");
+                        return ModuleSP();
+                    case ObjectFile::eTypeStubLibrary:   /// A library that can be linked against but not used for execution
+                        if (error_ptr)
+                            error_ptr->SetErrorString("stub libraries aren't valid target modules, please specify an executable");
+                        return ModuleSP();
+                    default:
+                        if (error_ptr)
+                            error_ptr->SetErrorString("unsupported file type, please specify an executable");
+                        return ModuleSP();
+                }
+                // GetSharedModule is not guaranteed to find the old shared module, for instance
+                // in the common case where you pass in the UUID, it is only going to find the one
+                // module matching the UUID.  In fact, it has no good way to know what the "old module"
+                // relevant to this target is, since there might be many copies of a module with this file spec
+                // in various running debug sessions, but only one of them will belong to this target.
+                // So let's remove the UUID from the module list, and look in the target's module list.
+                // Only do this if there is SOMETHING else in the module spec...
+                if (!old_module_sp)
+                {
+                    if (module_spec.GetUUID().IsValid() && !module_spec.GetFileSpec().GetFilename().IsEmpty() && !module_spec.GetFileSpec().GetDirectory().IsEmpty())
                     {
-                        old_module_sp = found_modules.GetModuleAtIndex(0);
+                        ModuleSpec module_spec_copy(module_spec.GetFileSpec());
+                        module_spec_copy.GetUUID().Clear();
+                        
+                        ModuleList found_modules;
+                        size_t num_found = m_images.FindModules (module_spec_copy, found_modules);
+                        if (num_found == 1)
+                        {
+                            old_module_sp = found_modules.GetModuleAtIndex(0);
+                        }
                     }
                 }
+                
+                if (old_module_sp && m_images.GetIndexForModule (old_module_sp.get()) != LLDB_INVALID_INDEX32)
+                {
+                    m_images.ReplaceModule(old_module_sp, module_sp);
+                    Module *old_module_ptr = old_module_sp.get();
+                    old_module_sp.reset();
+                    ModuleList::RemoveSharedModuleIfOrphaned (old_module_ptr);
+                }
+                else
+                    m_images.Append(module_sp);
             }
-            
-            if (old_module_sp && m_images.GetIndexForModule (old_module_sp.get()) != LLDB_INVALID_INDEX32)
-            {
-                m_images.ReplaceModule(old_module_sp, module_sp);
-                Module *old_module_ptr = old_module_sp.get();
-                old_module_sp.reset();
-                ModuleList::RemoveSharedModuleIfOrphaned (old_module_ptr);
-            }
-            else
-                m_images.Append(module_sp);
         }
     }
     if (error_ptr)
@@ -1617,7 +1679,10 @@
 {
     TargetPropertiesSP properties_sp(Target::GetGlobalProperties());
     if (properties_sp)
+    {
+        LogIfAnyCategoriesSet(LIBLLDB_LOG_TARGET, "Target::SetDefaultArchitecture setting target's default architecture to  %s (%s)", arch.GetArchitectureName(), arch.GetTriple().getTriple().c_str());
         return properties_sp->SetDefaultArchitecture(arch);
+    }
 }
 
 Target *
@@ -2015,9 +2080,9 @@
                                        cur_hook_sp->GetCommands().GetStringAtIndex(0) :
                                        NULL);
                     if (cmd)
-                        result.AppendMessageWithFormat("\n- Hook %llu (%s)\n", cur_hook_sp->GetID(), cmd);
+                        result.AppendMessageWithFormat("\n- Hook %" PRIu64 " (%s)\n", cur_hook_sp->GetID(), cmd);
                     else
-                        result.AppendMessageWithFormat("\n- Hook %llu\n", cur_hook_sp->GetID());
+                        result.AppendMessageWithFormat("\n- Hook %" PRIu64 "\n", cur_hook_sp->GetID());
                     any_thread_matched = true;
                 }
                 
@@ -2042,7 +2107,7 @@
                 if ((result.GetStatus() == eReturnStatusSuccessContinuingNoResult) || 
                     (result.GetStatus() == eReturnStatusSuccessContinuingResult))
                 {
-                    result.AppendMessageWithFormat ("Aborting stop hooks, hook %llu set the program running.", cur_hook_sp->GetID());
+                    result.AppendMessageWithFormat ("Aborting stop hooks, hook %" PRIu64 " set the program running.", cur_hook_sp->GetID());
                     keep_going = false;
                 }
             }
@@ -2100,7 +2165,7 @@
 
     s->SetIndentLevel(indent_level + 2);
 
-    s->Printf ("Hook: %llu\n", GetID());
+    s->Printf ("Hook: %" PRIu64 "\n", GetID());
     if (m_active)
         s->Indent ("State: enabled\n");
     else

Modified: lldb/branches/windows/source/Target/TargetList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/TargetList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/TargetList.cpp (original)
+++ lldb/branches/windows/source/Target/TargetList.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 // C++ Includes
 // Other libraries and framework includes
@@ -303,7 +305,7 @@
             {
                 if (exe_arch_ptr)
                 {
-                    if (*exe_arch_ptr != exe_module->GetArchitecture())
+                    if (!exe_arch_ptr->IsCompatibleMatch(exe_module->GetArchitecture()))
                         continue;
                 }
                 target_sp = *pos;

Modified: lldb/branches/windows/source/Target/Thread.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/Thread.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/Thread.cpp (original)
+++ lldb/branches/windows/source/Target/Thread.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/lldb-private-log.h"
 #include "lldb/Breakpoint/BreakpointLocation.h"
 #include "lldb/Core/Debugger.h"
@@ -260,7 +262,7 @@
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
     if (log)
-        log->Printf ("%p Thread::Thread(tid = 0x%4.4llx)", this, GetID());
+        log->Printf ("%p Thread::Thread(tid = 0x%4.4" PRIx64 ")", this, GetID());
 
     CheckInWithManager();
     QueueFundamentalPlan(true);
@@ -271,7 +273,7 @@
 {
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT));
     if (log)
-        log->Printf ("%p Thread::~Thread(tid = 0x%4.4llx)", this, GetID());
+        log->Printf ("%p Thread::~Thread(tid = 0x%4.4" PRIx64 ")", this, GetID());
     /// If you hit this assert, it means your derived class forgot to call DoDestroy in its destructor.
     assert (m_destroy_called);
 }
@@ -396,9 +398,15 @@
 }
 
 bool
-Thread::RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state)
+Thread::RestoreRegisterStateFromCheckpoint (ThreadStateCheckpoint &saved_state)
 {
     RestoreSaveFrameZero(saved_state.register_backup);
+    return true;
+}
+
+bool
+Thread::RestoreThreadStateFromCheckpoint (ThreadStateCheckpoint &saved_state)
+{
     if (saved_state.stop_info_sp)
         saved_state.stop_info_sp->MakeStopInfoValid();
     SetStopInfo(saved_state.stop_info_sp);
@@ -538,10 +546,10 @@
     if (GetResumeState () == eStateSuspended)
     {
         if (log)
-            log->Printf ("Thread::%s for tid = 0x%4.4llx, should_stop = 0 (ignore since thread was suspended)", 
+            log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 ", should_stop = 0 (ignore since thread was suspended)",
                          __FUNCTION__, 
                          GetID ());
-//            log->Printf ("Thread::%s for tid = 0x%4.4llx, pc = 0x%16.16llx, should_stop = 0 (ignore since thread was suspended)", 
+//            log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 ", pc = 0x%16.16" PRIx64 ", should_stop = 0 (ignore since thread was suspended)",
 //                         __FUNCTION__, 
 //                         GetID (), 
 //                         GetRegisterContext()->GetPC());
@@ -551,10 +559,10 @@
     if (GetTemporaryResumeState () == eStateSuspended)
     {
         if (log)
-            log->Printf ("Thread::%s for tid = 0x%4.4llx, should_stop = 0 (ignore since thread was suspended)", 
+            log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 ", should_stop = 0 (ignore since thread was suspended)",
                          __FUNCTION__, 
                          GetID ());
-//            log->Printf ("Thread::%s for tid = 0x%4.4llx, pc = 0x%16.16llx, should_stop = 0 (ignore since thread was suspended)", 
+//            log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 ", pc = 0x%16.16" PRIx64 ", should_stop = 0 (ignore since thread was suspended)",
 //                         __FUNCTION__, 
 //                         GetID (), 
 //                         GetRegisterContext()->GetPC());
@@ -564,7 +572,7 @@
     if (ThreadStoppedForAReason() == false)
     {
         if (log)
-            log->Printf ("Thread::%s for tid = 0x%4.4llx, pc = 0x%16.16llx, should_stop = 0 (ignore since no stop reason)", 
+            log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 ", pc = 0x%16.16" PRIx64 ", should_stop = 0 (ignore since no stop reason)",
                          __FUNCTION__, 
                          GetID (), 
                          GetRegisterContext()->GetPC());
@@ -573,7 +581,7 @@
     
     if (log)
     {
-        log->Printf ("Thread::%s for tid = 0x%4.4llx, pc = 0x%16.16llx", 
+        log->Printf ("Thread::%s for tid = 0x%4.4" PRIx64 ", pc = 0x%16.16" PRIx64,
                      __FUNCTION__, 
                      GetID (), 
                      GetRegisterContext()->GetPC());
@@ -770,21 +778,21 @@
     if (thread_state == eStateSuspended || thread_state == eStateInvalid)
     {
         if (log)
-            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote %i (state was suspended or invalid)\n", GetID(), eVoteNoOpinion);
+            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4" PRIx64 ": returning vote %i (state was suspended or invalid)\n", GetID(), eVoteNoOpinion);
         return eVoteNoOpinion;
     }
 
     if (temp_thread_state == eStateSuspended || temp_thread_state == eStateInvalid)
     {
         if (log)
-            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote %i (temporary state was suspended or invalid)\n", GetID(), eVoteNoOpinion);
+            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4" PRIx64 ": returning vote %i (temporary state was suspended or invalid)\n", GetID(), eVoteNoOpinion);
         return eVoteNoOpinion;
     }
 
     if (!ThreadStoppedForAReason())
     {
         if (log)
-            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote %i (thread didn't stop for a reason.)\n", GetID(), eVoteNoOpinion);
+            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4" PRIx64 ": returning vote %i (thread didn't stop for a reason.)\n", GetID(), eVoteNoOpinion);
         return eVoteNoOpinion;
     }
 
@@ -792,13 +800,13 @@
     {
         // Don't use GetCompletedPlan here, since that suppresses private plans.
         if (log)
-            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote  for complete stack's back plan\n", GetID());
+            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4" PRIx64 ": returning vote  for complete stack's back plan\n", GetID());
         return m_completed_plan_stack.back()->ShouldReportStop (event_ptr);
     }
     else
     {
         if (log)
-            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4llx: returning vote  for current plan\n", GetID());
+            log->Printf ("Thread::ShouldReportStop() tid = 0x%4.4" PRIx64 ": returning vote  for current plan\n", GetID());
         return GetCurrentPlan()->ShouldReportStop (event_ptr);
     }
 }
@@ -819,7 +827,7 @@
     {
         // Don't use GetCompletedPlan here, since that suppresses private plans.
         if (log)
-            log->Printf ("Current Plan for thread %d (0x%4.4llx): %s being asked whether we should report run.", 
+            log->Printf ("Current Plan for thread %d (0x%4.4" PRIx64 "): %s being asked whether we should report run.",
                          GetIndexID(), 
                          GetID(),
                          m_completed_plan_stack.back()->GetName());
@@ -829,7 +837,7 @@
     else
     {
         if (log)
-            log->Printf ("Current Plan for thread %d (0x%4.4llx): %s being asked whether we should report run.", 
+            log->Printf ("Current Plan for thread %d (0x%4.4" PRIx64 "): %s being asked whether we should report run.",
                          GetIndexID(), 
                          GetID(),
                          GetCurrentPlan()->GetName());
@@ -864,7 +872,7 @@
         {
             StreamString s;
             thread_plan_sp->GetDescription (&s, lldb::eDescriptionLevelFull);
-            log->Printf("Pushing plan: \"%s\", tid = 0x%4.4llx.",
+            log->Printf("Pushing plan: \"%s\", tid = 0x%4.4" PRIx64 ".",
                         s.GetData(),
                         thread_plan_sp->GetThread().GetID());
         }
@@ -883,7 +891,7 @@
         ThreadPlanSP &plan = m_plan_stack.back();
         if (log)
         {
-            log->Printf("Popping plan: \"%s\", tid = 0x%4.4llx.", plan->GetName(), plan->GetThread().GetID());
+            log->Printf("Popping plan: \"%s\", tid = 0x%4.4" PRIx64 ".", plan->GetName(), plan->GetThread().GetID());
         }
         m_completed_plan_stack.push_back (plan);
         plan->WillPop();
@@ -1048,7 +1056,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
     if (log)
     {
-        log->Printf("Discarding thread plans for thread tid = 0x%4.4llx, up to %p", GetID(), up_to_plan_ptr);
+        log->Printf("Discarding thread plans for thread tid = 0x%4.4" PRIx64 ", up to %p", GetID(), up_to_plan_ptr);
     }
 
     int stack_size = m_plan_stack.size();
@@ -1089,7 +1097,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
     if (log)
     {
-        log->Printf("Discarding thread plans for thread (tid = 0x%4.4llx, force %d)", GetID(), force);
+        log->Printf("Discarding thread plans for thread (tid = 0x%4.4" PRIx64 ", force %d)", GetID(), force);
     }
 
     if (force)
@@ -1180,28 +1188,41 @@
 }
 
 ThreadPlan *
-Thread::QueueThreadPlanForStepRange 
+Thread::QueueThreadPlanForStepOverRange
 (
     bool abort_other_plans, 
-    StepType type, 
     const AddressRange &range, 
-    const SymbolContext &addr_context, 
+    const SymbolContext &addr_context,
+    lldb::RunMode stop_other_threads
+)
+{
+    ThreadPlanSP thread_plan_sp;
+    thread_plan_sp.reset (new ThreadPlanStepOverRange (*this, range, addr_context, stop_other_threads));
+
+    QueueThreadPlan (thread_plan_sp, abort_other_plans);
+    return thread_plan_sp.get();
+}
+
+ThreadPlan *
+Thread::QueueThreadPlanForStepInRange
+(
+    bool abort_other_plans, 
+    const AddressRange &range, 
+    const SymbolContext &addr_context,
+    const char *step_in_target,
     lldb::RunMode stop_other_threads,
     bool avoid_code_without_debug_info
 )
 {
     ThreadPlanSP thread_plan_sp;
-    if (type == eStepTypeInto)
-    {
-        ThreadPlanStepInRange *plan = new ThreadPlanStepInRange (*this, range, addr_context, stop_other_threads);
-        if (avoid_code_without_debug_info)
-            plan->GetFlags().Set (ThreadPlanShouldStopHere::eAvoidNoDebug);
-        else
-            plan->GetFlags().Clear (ThreadPlanShouldStopHere::eAvoidNoDebug);
-        thread_plan_sp.reset (plan);
-    }
+    ThreadPlanStepInRange *plan = new ThreadPlanStepInRange (*this, range, addr_context, stop_other_threads);
+    if (avoid_code_without_debug_info)
+        plan->GetFlags().Set (ThreadPlanShouldStopHere::eAvoidNoDebug);
     else
-        thread_plan_sp.reset (new ThreadPlanStepOverRange (*this, range, addr_context, stop_other_threads));
+        plan->GetFlags().Clear (ThreadPlanShouldStopHere::eAvoidNoDebug);
+    if (step_in_target)
+        plan->SetStepInTarget(step_in_target);
+    thread_plan_sp.reset (plan);
 
     QueueThreadPlan (thread_plan_sp, abort_other_plans);
     return thread_plan_sp.get();
@@ -1305,7 +1326,7 @@
     uint32_t stack_size = m_plan_stack.size();
     int i;
     s->Indent();
-    s->Printf ("Plan Stack for thread #%u: tid = 0x%4.4llx, stack_size = %d\n", GetIndexID(), GetID(), stack_size);
+    s->Printf ("Plan Stack for thread #%u: tid = 0x%4.4" PRIx64 ", stack_size = %d\n", GetIndexID(), GetID(), stack_size);
     for (i = stack_size - 1; i >= 0; i--)
     {
         s->IndentMore();
@@ -1431,7 +1452,7 @@
     
     if (!frame_sp)
     {
-        return_error.SetErrorStringWithFormat("Could not find frame with index %d in thread 0x%llx.", frame_idx, GetID());
+        return_error.SetErrorStringWithFormat("Could not find frame with index %d in thread 0x%" PRIx64 ".", frame_idx, GetID());
     }
     
     return ReturnFromFrame(frame_sp, return_value_sp, broadcast);
@@ -1561,14 +1582,16 @@
 {
     switch (reason)
     {
-    case eStopReasonInvalid:      return "invalid";
-    case eStopReasonNone:         return "none";
-    case eStopReasonTrace:        return "trace";
-    case eStopReasonBreakpoint:   return "breakpoint";
-    case eStopReasonWatchpoint:   return "watchpoint";
-    case eStopReasonSignal:       return "signal";
-    case eStopReasonException:    return "exception";
-    case eStopReasonPlanComplete: return "plan complete";
+    case eStopReasonInvalid:       return "invalid";
+    case eStopReasonNone:          return "none";
+    case eStopReasonTrace:         return "trace";
+    case eStopReasonBreakpoint:    return "breakpoint";
+    case eStopReasonWatchpoint:    return "watchpoint";
+    case eStopReasonSignal:        return "signal";
+    case eStopReasonException:     return "exception";
+    case eStopReasonExec:          return "exec";
+    case eStopReasonPlanComplete:  return "plan complete";
+    case eStopReasonThreadExiting: return "thread exiting";
     }
 
 

Modified: lldb/branches/windows/source/Target/ThreadList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadList.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadList.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadList.cpp Tue Jan  8 06:51:53 2013
@@ -202,7 +202,7 @@
     if (log)
     {
         log->PutCString("");
-        log->Printf ("ThreadList::%s: %llu threads", __FUNCTION__, (uint64_t)m_threads.size());
+        log->Printf ("ThreadList::%s: %" PRIu64 " threads", __FUNCTION__, (uint64_t)m_threads.size());
     }
 
     for (pos = threads_copy.begin(); pos != end; ++pos)
@@ -241,7 +241,7 @@
     LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
 
     if (log)
-        log->Printf ("ThreadList::%s %llu threads", __FUNCTION__, (uint64_t)m_threads.size());
+        log->Printf ("ThreadList::%s %" PRIu64 " threads", __FUNCTION__, (uint64_t)m_threads.size());
 
     // Run through the threads and ask whether we should report this event.
     // For stopping, a YES vote wins over everything.  A NO vote wins over NO opinion.
@@ -266,7 +266,7 @@
             else
             {
                 if (log)
-                    log->Printf ("ThreadList::%s thread 0x%4.4llx: voted %s, but lost out because result was %s", 
+                    log->Printf ("ThreadList::%s thread 0x%4.4" PRIx64 ": voted %s, but lost out because result was %s",
                                  __FUNCTION__,
                                  thread_sp->GetID (), 
                                  GetVoteAsCString (vote),
@@ -309,7 +309,7 @@
                     break;
                 case eVoteNo:
                     if (log)
-                        log->Printf ("ThreadList::ShouldReportRun() thread %d (0x%4.4llx) says don't report.", 
+                        log->Printf ("ThreadList::ShouldReportRun() thread %d (0x%4.4" PRIx64 ") says don't report.",
                                      (*pos)->GetIndexID(), 
                                      (*pos)->GetID());
                     result = eVoteNo;
@@ -555,7 +555,7 @@
 }
 
 bool
-ThreadList::SetSelectedThreadByID (lldb::tid_t tid)
+ThreadList::SetSelectedThreadByID (lldb::tid_t tid, bool notify)
 {
     Mutex::Locker locker(m_threads_mutex);
     ThreadSP selected_thread_sp(FindThreadByID(tid));
@@ -567,11 +567,14 @@
     else
         m_selected_tid = LLDB_INVALID_THREAD_ID;
 
+    if (notify)
+        NotifySelectedThreadChanged(m_selected_tid);
+    
     return m_selected_tid != LLDB_INVALID_THREAD_ID;
 }
 
 bool
-ThreadList::SetSelectedThreadByIndexID (uint32_t index_id)
+ThreadList::SetSelectedThreadByIndexID (uint32_t index_id, bool notify)
 {
     Mutex::Locker locker(m_threads_mutex);
     ThreadSP selected_thread_sp (FindThreadByIndexID(index_id));
@@ -583,10 +586,22 @@
     else
         m_selected_tid = LLDB_INVALID_THREAD_ID;
 
+    if (notify)
+        NotifySelectedThreadChanged(m_selected_tid);
+    
     return m_selected_tid != LLDB_INVALID_THREAD_ID;
 }
 
 void
+ThreadList::NotifySelectedThreadChanged (lldb::tid_t tid)
+{
+    ThreadSP selected_thread_sp (FindThreadByID(tid));
+    if (selected_thread_sp->EventTypeHasListeners(Thread::eBroadcastBitThreadSelected))
+        selected_thread_sp->BroadcastEvent(Thread::eBroadcastBitThreadSelected,
+                                           new Thread::ThreadEventData(selected_thread_sp));
+}
+
+void
 ThreadList::Update (ThreadList &rhs)
 {
     if (this != &rhs)

Modified: lldb/branches/windows/source/Target/ThreadPlan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlan.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlan.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlan.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Target/ThreadPlan.h"
 
 // C Includes
@@ -139,7 +141,7 @@
             addr_t pc = reg_ctx->GetPC();
             addr_t sp = reg_ctx->GetSP();
             addr_t fp = reg_ctx->GetFP();
-            log->Printf("%s Thread #%u: tid = 0x%4.4llx, pc = 0x%8.8llx, sp = 0x%8.8llx, fp = 0x%8.8llx, "
+            log->Printf("%s Thread #%u: tid = 0x%4.4" PRIx64 ", pc = 0x%8.8" PRIx64 ", sp = 0x%8.8" PRIx64 ", fp = 0x%8.8" PRIx64 ", "
                         "plan = '%s', state = %s, stop others = %d", 
                         __FUNCTION__,
                         m_thread.GetIndexID(), 

Modified: lldb/branches/windows/source/Target/ThreadPlanBase.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanBase.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanBase.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanBase.cpp Tue Jan  8 06:51:53 2013
@@ -107,7 +107,7 @@
                 // at this point.  Don't force the discard, however, so Master plans can stay
                 // in place if they want to.
                 if (log)
-                    log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4llx (breakpoint hit.)", m_thread.GetID());
+                    log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64 " (breakpoint hit.)", m_thread.GetID());
                 m_thread.DiscardThreadPlans(false);
                 return true;
             }
@@ -135,15 +135,24 @@
             // If we crashed, discard thread plans and stop.  Don't force the discard, however,
             // since on rerun the target may clean up this exception and continue normally from there.
                 if (log)
-                    log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4llx (exception.)", m_thread.GetID());
+                    log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64 " (exception.)", m_thread.GetID());
             m_thread.DiscardThreadPlans(false);
             return true;
 
+        case eStopReasonExec:
+            // If we crashed, discard thread plans and stop.  Don't force the discard, however,
+            // since on rerun the target may clean up this exception and continue normally from there.
+            if (log)
+                log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64 " (exec.)", m_thread.GetID());
+            m_thread.DiscardThreadPlans(false);
+            return true;
+
+        case eStopReasonThreadExiting:
         case eStopReasonSignal:
             if (stop_info_sp->ShouldStop(event_ptr))
             {
                 if (log)
-                    log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4llx (signal.)", m_thread.GetID());
+                    log->Printf("Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64 " (signal.)", m_thread.GetID());
                 m_thread.DiscardThreadPlans(false);
                 return true;
             }

Modified: lldb/branches/windows/source/Target/ThreadPlanCallFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanCallFunction.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanCallFunction.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanCallFunction.cpp Tue Jan  8 06:51:53 2013
@@ -44,6 +44,7 @@
 {
     SetIsMasterPlan (true);
     SetOkayToDiscard (false);
+    SetPrivate (true);
 
     ProcessSP process_sp (thread.GetProcess());
     if (!process_sp)
@@ -68,7 +69,7 @@
     if (!error.Success())
     {
         if (log)
-            log->Printf ("ThreadPlanCallFunction(%p): Trying to put the stack in unreadable memory at: 0x%llx.", this, m_function_sp);
+            log->Printf ("ThreadPlanCallFunction(%p): Trying to put the stack in unreadable memory at: 0x%" PRIx64 ".", this, m_function_sp);
         return false;
     }
     
@@ -112,9 +113,6 @@
             log->Printf ("ThreadPlanCallFunction(%p): Setting up ThreadPlanCallFunction, failed to checkpoint thread state.", this);
         return false;
     }
-    // Now set the thread state to "no reason" so we don't run with whatever signal was outstanding...
-    thread.SetStopInfoToNothing();
-    
     function_load_addr = m_function_addr.GetLoadAddress (target_sp.get());
     
     return true;
@@ -196,10 +194,11 @@
     m_valid (false),
     m_stop_other_threads (stop_other_threads),
     m_function_addr (function),
-    m_function_sp(0),
+    m_function_sp (0),
     m_return_type (return_type),
     m_takedown_done (false),
-    m_stop_address (LLDB_INVALID_ADDRESS)
+    m_stop_address (LLDB_INVALID_ADDRESS),
+    m_discard_on_error (discard_on_error)
 {
     lldb::addr_t start_load_addr;
     ABI *abi;
@@ -285,11 +284,11 @@
             }
         }
         if (log)
-            log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called for thread 0x%4.4llx, m_valid: %d complete: %d.\n", this, m_thread.GetID(), m_valid, IsPlanComplete());
+            log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n", this, m_thread.GetID(), m_valid, IsPlanComplete());
         m_takedown_done = true;
         m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
         m_real_stop_info_sp = GetPrivateStopReason();
-        m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state);
+        m_thread.RestoreRegisterStateFromCheckpoint(m_stored_thread_state);
         SetPlanComplete(success);
         ClearBreakpoints();
         if (log && log->GetVerbose())
@@ -299,7 +298,7 @@
     else
     {
         if (log)
-            log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called as no-op for thread 0x%4.4llx, m_valid: %d complete: %d.\n", this, m_thread.GetID(), m_valid, IsPlanComplete());
+            log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called as no-op for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n", this, m_thread.GetID(), m_valid, IsPlanComplete());
     }
 }
 
@@ -319,7 +318,7 @@
     else
     {
         TargetSP target_sp (m_thread.CalculateTarget());
-        s->Printf("Thread plan to call 0x%llx", m_function_addr.GetLoadAddress(target_sp.get()));
+        s->Printf("Thread plan to call 0x%" PRIx64, m_function_addr.GetLoadAddress(target_sp.get()));
     }
 }
 
@@ -460,6 +459,11 @@
 {
 //#define SINGLE_STEP_EXPRESSIONS
     
+    // Now set the thread state to "no reason" so we don't run with whatever signal was outstanding...
+    // Wait till the plan is pushed so we aren't changing the stop info till we're about to run.
+    
+    GetThread().SetStopInfoToNothing();
+    
 #ifndef SINGLE_STEP_EXPRESSIONS
     m_subplan_sp.reset(new ThreadPlanRunToAddress(m_thread, m_start_addr, m_stop_other_threads));
     
@@ -533,3 +537,10 @@
     
     return false;
 }
+
+bool
+ThreadPlanCallFunction::RestoreThreadState()
+{
+    return GetThread().RestoreThreadStateFromCheckpoint(m_stored_thread_state);
+}
+

Modified: lldb/branches/windows/source/Target/ThreadPlanShouldStopHere.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanShouldStopHere.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanShouldStopHere.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanShouldStopHere.cpp Tue Jan  8 06:51:53 2013
@@ -60,11 +60,11 @@
             {
                 StreamString s;
                 return_plan->GetDescription (&s, lldb::eDescriptionLevelFull);
-                log->Printf ("ShouldStopHere callback found a step out plan from 0x%llx: %s.", current_addr, s.GetData()); 
+                log->Printf ("ShouldStopHere callback found a step out plan from 0x%" PRIx64 ": %s.", current_addr, s.GetData());
             }
             else
             {
-                log->Printf ("ShouldStopHere callback didn't find a step out plan from: 0x%llx.", current_addr);
+                log->Printf ("ShouldStopHere callback didn't find a step out plan from: 0x%" PRIx64 ".", current_addr);
             }
         }
         return return_plan;

Modified: lldb/branches/windows/source/Target/ThreadPlanStepInRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepInRange.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepInRange.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepInRange.cpp Tue Jan  8 06:51:53 2013
@@ -52,6 +52,23 @@
     SetFlagsToDefault ();
 }
 
+ThreadPlanStepInRange::ThreadPlanStepInRange
+(
+    Thread &thread,
+    const AddressRange &range,
+    const SymbolContext &addr_context,
+    const char *step_into_target,
+    lldb::RunMode stop_others
+) :
+    ThreadPlanStepRange (ThreadPlan::eKindStepInRange, "Step Range stepping in", thread, range, addr_context, stop_others),
+    ThreadPlanShouldStopHere (this, ThreadPlanStepInRange::DefaultShouldStopHereCallback, NULL),
+    m_step_past_prologue (true),
+    m_virtual_step (false),
+    m_step_into_target (step_into_target)
+{
+    SetFlagsToDefault ();
+}
+
 ThreadPlanStepInRange::~ThreadPlanStepInRange ()
 {
 }
@@ -65,6 +82,7 @@
     {
         s->Printf ("Stepping through range (stepping into functions): ");
         DumpRanges(s);
+        s->Printf ("targeting %s.", m_step_into_target.AsCString());
     }
 }
 
@@ -140,6 +158,7 @@
             }
         
             SetPlanComplete();
+            m_no_more_plans = true;
             return true;
         }
         
@@ -279,15 +298,40 @@
         }
     }
     
-    if (!should_step_out)
+    if (current_plan->GetKind() == eKindStepInRange)
     {
-        if (current_plan->GetKind() == eKindStepInRange)
+        ThreadPlanStepInRange *step_in_range_plan = static_cast<ThreadPlanStepInRange *> (current_plan);
+        if (step_in_range_plan->m_step_into_target)
+        {
+            SymbolContext sc = frame->GetSymbolContext(eSymbolContextFunction|eSymbolContextBlock|eSymbolContextSymbol);
+            if (sc.symbol != NULL)
+            {
+                // First try an exact match, since that's cheap with ConstStrings.  Then do a strstr compare.
+                if (step_in_range_plan->m_step_into_target == sc.GetFunctionName())
+                {
+                    should_step_out = false;
+                }
+                else
+                {
+                    const char *target_name = step_in_range_plan->m_step_into_target.AsCString();
+                    const char *function_name = sc.GetFunctionName().AsCString();
+                    
+                    if (function_name == NULL)
+                        should_step_out = true;
+                    else if (strstr (function_name, target_name) == NULL)
+                        should_step_out = true;
+                }
+            }
+        }
+        
+        if (!should_step_out)
         {
-            ThreadPlanStepInRange *step_in_range_plan = static_cast<ThreadPlanStepInRange *> (current_plan);
-            should_step_out = step_in_range_plan->FrameMatchesAvoidRegexp ();
+                ThreadPlanStepInRange *step_in_range_plan = static_cast<ThreadPlanStepInRange *> (current_plan);
+                should_step_out = step_in_range_plan->FrameMatchesAvoidRegexp ();
         }
     }
     
+    
     if (should_step_out)
     {
         // FIXME: Make sure the ThreadPlanForStepOut does the right thing with inlined functions.
@@ -313,8 +357,12 @@
     // case we'll do our ordinary processing, or we stopped for some
     // reason that isn't handled by our sub-plans, in which case we want to just stop right
     // away.
-    // We also set ourselves complete when we stop for this sort of unintended reason, but mark
-    // success as false so we don't end up being the reason for the stop.
+    // In general, we don't want to mark the plan as complete for unexplained stops.
+    // For instance, if you step in to some code with no debug info, so you step out
+    // and in the course of that hit a breakpoint, then you want to stop & show the user
+    // the breakpoint, but not unship the step in plan, since you still may want to complete that
+    // plan when you continue.  This is particularly true when doing "step in to target function."
+    // stepping.
     //
     // The only variation is that if we are doing "step by running to next branch" in which case
     // if we hit our branch breakpoint we don't set the plan to complete.
@@ -335,12 +383,14 @@
         case eStopReasonWatchpoint:
         case eStopReasonSignal:
         case eStopReasonException:
+        case eStopReasonExec:
+        case eStopReasonThreadExiting:
             {
                 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
                 if (log)
                     log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step.");
-                SetPlanComplete(false);
             }
+            return false;
             break;
         default:
             break;

Modified: lldb/branches/windows/source/Target/ThreadPlanStepOut.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepOut.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepOut.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepOut.cpp Tue Jan  8 06:51:53 2013
@@ -148,7 +148,7 @@
         else if (m_step_through_inline_plan_sp)
             s->Printf ("Stepping out by stepping through inlined function.");
         else
-            s->Printf ("Stepping out from address 0x%llx to return address 0x%llx using breakpoint site %d",
+            s->Printf ("Stepping out from address 0x%" PRIx64 " to return address 0x%" PRIx64 " using breakpoint site %d",
                        (uint64_t)m_step_from_insn,
                        (uint64_t)m_return_addr,
                        m_return_bp_id);
@@ -251,6 +251,8 @@
         case eStopReasonWatchpoint:
         case eStopReasonSignal:
         case eStopReasonException:
+        case eStopReasonExec:
+        case eStopReasonThreadExiting:
             return false;
 
         default:

Modified: lldb/branches/windows/source/Target/ThreadPlanStepOverBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepOverBreakpoint.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepOverBreakpoint.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepOverBreakpoint.cpp Tue Jan  8 06:51:53 2013
@@ -48,7 +48,7 @@
 void
 ThreadPlanStepOverBreakpoint::GetDescription (Stream *s, lldb::DescriptionLevel level)
 {
-    s->Printf("Single stepping past breakpoint site %llu at 0x%llx", m_breakpoint_site_id, (uint64_t)m_breakpoint_addr);
+    s->Printf("Single stepping past breakpoint site %" PRIu64 " at 0x%" PRIx64, m_breakpoint_site_id, (uint64_t)m_breakpoint_addr);
 }
 
 bool

Modified: lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepOverRange.cpp Tue Jan  8 06:51:53 2013
@@ -319,6 +319,8 @@
         case eStopReasonWatchpoint:
         case eStopReasonSignal:
         case eStopReasonException:
+        case eStopReasonExec:
+        case eStopReasonThreadExiting:
         default:
             if (log)
                 log->PutCString ("ThreadPlanStepInRange got asked if it explains the stop for some reason other than step.");

Modified: lldb/branches/windows/source/Target/ThreadPlanStepRange.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepRange.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepRange.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepRange.cpp Tue Jan  8 06:51:53 2013
@@ -190,7 +190,7 @@
     }
 
     if (!ret_value && log)
-        log->Printf ("Step range plan out of range to 0x%llx", pc_load_addr);
+        log->Printf ("Step range plan out of range to 0x%" PRIx64, pc_load_addr);
 
     return ret_value;
 }

Modified: lldb/branches/windows/source/Target/ThreadPlanStepThrough.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepThrough.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepThrough.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepThrough.cpp Tue Jan  8 06:51:53 2013
@@ -65,7 +65,7 @@
             LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
             if (log)
             {
-                log->Printf ("Setting backstop breakpoint %d at address: 0x%llx", m_backstop_bkpt_id, m_backstop_addr);
+                log->Printf ("Setting backstop breakpoint %d at address: 0x%" PRIx64, m_backstop_bkpt_id, m_backstop_addr);
             }
         }
     }
@@ -103,11 +103,11 @@
         {
             StreamString s;
             m_sub_plan_sp->GetDescription(&s, lldb::eDescriptionLevelFull);
-            log->Printf ("Found step through plan from 0x%llx: %s", current_address, s.GetData());
+            log->Printf ("Found step through plan from 0x%" PRIx64 ": %s", current_address, s.GetData());
         }
         else
         {
-            log->Printf ("Couldn't find step through plan from address 0x%llx.", current_address);
+            log->Printf ("Couldn't find step through plan from address 0x%" PRIx64 ".", current_address);
         }
     }
 }

Modified: lldb/branches/windows/source/Target/ThreadPlanStepUntil.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanStepUntil.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanStepUntil.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanStepUntil.cpp Tue Jan  8 06:51:53 2013
@@ -133,21 +133,21 @@
     else
     {
         if (m_until_points.size() == 1)
-            s->Printf ("Stepping from address 0x%llx until we reach 0x%llx using breakpoint %d",
+            s->Printf ("Stepping from address 0x%" PRIx64 " until we reach 0x%" PRIx64 " using breakpoint %d",
                        (uint64_t)m_step_from_insn,
                        (uint64_t) (*m_until_points.begin()).first,
                        (*m_until_points.begin()).second);
         else
         {
             until_collection::iterator pos, end = m_until_points.end();
-            s->Printf ("Stepping from address 0x%llx until we reach one of:",
+            s->Printf ("Stepping from address 0x%" PRIx64 " until we reach one of:",
                        (uint64_t)m_step_from_insn);
             for (pos = m_until_points.begin(); pos != end; pos++)
             {
-                s->Printf ("\n\t0x%llx (bp: %d)", (uint64_t) (*pos).first, (*pos).second);
+                s->Printf ("\n\t0x%" PRIx64 " (bp: %d)", (uint64_t) (*pos).first, (*pos).second);
             }
         }
-        s->Printf(" stepped out address is 0x%llx.", (uint64_t) m_return_addr);
+        s->Printf(" stepped out address is 0x%" PRIx64 ".", (uint64_t) m_return_addr);
     }
 }
 
@@ -291,6 +291,8 @@
             case eStopReasonWatchpoint:
             case eStopReasonSignal:
             case eStopReasonException:
+            case eStopReasonExec:
+            case eStopReasonThreadExiting:
                 m_explains_stop = false;
                 break;
             default:

Modified: lldb/branches/windows/source/Target/ThreadPlanTracer.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadPlanTracer.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadPlanTracer.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadPlanTracer.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/Target/ThreadPlan.h"
 
 // C Includes

Modified: lldb/branches/windows/source/Target/ThreadSpec.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Target/ThreadSpec.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Target/ThreadSpec.cpp (original)
+++ lldb/branches/windows/source/Target/ThreadSpec.cpp Tue Jan  8 06:51:53 2013
@@ -140,7 +140,7 @@
         else
         {
             if (GetTID() != LLDB_INVALID_THREAD_ID)
-                s->Printf("tid: 0x%llx ", GetTID());
+                s->Printf("tid: 0x%" PRIx64 " ", GetTID());
                 
             if (GetIndex() != UINT32_MAX)
                 s->Printf("index: %d ", GetIndex());

Modified: lldb/branches/windows/source/Utility/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Utility/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Utility/Makefile (original)
+++ lldb/branches/windows/source/Utility/Makefile Tue Jan  8 06:51:53 2013
@@ -10,5 +10,13 @@
 LLDB_LEVEL := ../..
 LIBRARYNAME := lldbUtility
 BUILD_ARCHIVE = 1
+NO_PEDANTIC = 1
+
+# Enable RTTI on GCC builds because liblldbCore.a requires RTTI.
+# See source/Core/Makefile for details.
+ifeq (g++,$(shell basename $(CXX)))
+  REQUIRES_RTTI = 1
+endif
+
 
 include $(LLDB_LEVEL)/Makefile

Modified: lldb/branches/windows/source/Utility/StringExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/Utility/StringExtractor.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/Utility/StringExtractor.cpp (original)
+++ lldb/branches/windows/source/Utility/StringExtractor.cpp Tue Jan  8 06:51:53 2013
@@ -148,8 +148,8 @@
     uint32_t i = m_index;
     if ((i + 2) <= m_packet.size())
     {
-        const uint8_t hi_nibble = g_hex_ascii_to_hex_integer[m_packet[i]];
-        const uint8_t lo_nibble = g_hex_ascii_to_hex_integer[m_packet[i+1]];
+        const uint8_t hi_nibble = g_hex_ascii_to_hex_integer[static_cast<uint8_t>(m_packet[i])];
+        const uint8_t lo_nibble = g_hex_ascii_to_hex_integer[static_cast<uint8_t>(m_packet[i+1])];
         if (hi_nibble < 16 && lo_nibble < 16)
         {
             m_index += 2;

Modified: lldb/branches/windows/source/lldb-log.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/lldb-log.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/lldb-log.cpp (original)
+++ lldb/branches/windows/source/lldb-log.cpp Tue Jan  8 06:51:53 2013
@@ -126,6 +126,7 @@
                 else if (0 == ::strcasecmp(arg, "state"))       flag_bits &= ~LIBLLDB_LOG_STATE;
                 else if (0 == ::strcasecmp(arg, "step"))        flag_bits &= ~LIBLLDB_LOG_STEP;
                 else if (0 == ::strcasecmp(arg, "thread"))      flag_bits &= ~LIBLLDB_LOG_THREAD;
+                else if (0 == ::strcasecmp(arg, "target"))      flag_bits &= ~LIBLLDB_LOG_TARGET;
                 else if (0 == ::strcasecmp(arg, "verbose"))     flag_bits &= ~LIBLLDB_LOG_VERBOSE;
                 else if (0 == ::strncasecmp(arg, "watch", 5))   flag_bits &= ~LIBLLDB_LOG_WATCHPOINTS;
                 else if (0 == ::strncasecmp(arg, "temp", 4))    flag_bits &= ~LIBLLDB_LOG_TEMPORARY;
@@ -193,6 +194,7 @@
             else if (0 == ::strcasecmp(arg, "state"))       flag_bits |= LIBLLDB_LOG_STATE;
             else if (0 == ::strcasecmp(arg, "step"))        flag_bits |= LIBLLDB_LOG_STEP;
             else if (0 == ::strcasecmp(arg, "thread"))      flag_bits |= LIBLLDB_LOG_THREAD;
+            else if (0 == ::strcasecmp(arg, "target"))      flag_bits |= LIBLLDB_LOG_TARGET;
             else if (0 == ::strcasecmp(arg, "verbose"))     flag_bits |= LIBLLDB_LOG_VERBOSE;
             else if (0 == ::strncasecmp(arg, "watch", 5))   flag_bits |= LIBLLDB_LOG_WATCHPOINTS;
             else if (0 == ::strncasecmp(arg, "temp", 4))    flag_bits |= LIBLLDB_LOG_TEMPORARY;
@@ -237,6 +239,7 @@
                  "  state - log private and public process state changes\n"
                  "  step - log step related activities\n"
                  "  symbol - log symbol related issues and warnings\n"
+                 "  target - log target events and activities\n"
                  "  thread - log thread events and activities\n"
                  "  types - log type system related activities\n"
                  "  unwind - log stack unwind activities\n"

Modified: lldb/branches/windows/source/lldb.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/source/lldb.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/source/lldb.cpp (original)
+++ lldb/branches/windows/source/lldb.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 #include "lldb/lldb-private.h"
 #include "lldb/lldb-private-log.h"
 #include "lldb/Core/ArchSpec.h"
@@ -23,7 +25,6 @@
 #include "llvm/ADT/StringRef.h"
 
 #include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
-#include "Plugins/Disassembler/llvm/DisassemblerLLVM.h"
 #include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
 #include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
@@ -36,6 +37,7 @@
 #include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
 #include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
 #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
+#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
 #ifndef LLDB_DISABLE_PYTHON
 #include "Plugins/OperatingSystem/Python/OperatingSystemPython.h"
 #endif
@@ -45,7 +47,6 @@
 #include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
 
 #include "Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h"
-#include "Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.h"
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h"
 #include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
 #include "Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.h"
@@ -107,7 +108,6 @@
         ABIMacOSX_arm::Initialize();
         ABISysV_x86_64::Initialize();
         DisassemblerLLVMC::Initialize();
-        DisassemblerLLVM::Initialize();
         ObjectContainerBSDArchive::Initialize();
         EmulateInstructionARM::Initialize ();
         ObjectFilePECOFF::Initialize ();
@@ -118,6 +118,8 @@
         UnwindAssembly_x86::Initialize();
         DynamicLoaderPOSIXDYLD::Initialize ();
         DynamicLoaderMacOSXDYLD::Initialize();
+        SymbolFileDWARFDebugMap::Initialize();
+        ItaniumABILanguageRuntime::Initialize();
 #ifndef LLDB_DISABLE_PYTHON
         OperatingSystemPython::Initialize();
 #endif
@@ -190,7 +192,6 @@
     ABIMacOSX_arm::Terminate();
     ABISysV_x86_64::Terminate();
     DisassemblerLLVMC::Terminate();
-    DisassemblerLLVM::Terminate();
     ObjectContainerBSDArchive::Terminate();
     ObjectFileELF::Terminate();
     UnwindAssembly_x86::Terminate();
@@ -200,13 +201,14 @@
     SymbolFileSymtab::Terminate();
     ObjectFilePECOFF::Terminate ();
     DynamicLoaderPOSIXDYLD::Terminate ();
+    SymbolFileDWARFDebugMap::Terminate();
+    ItaniumABILanguageRuntime::Terminate();
 #ifndef LLDB_DISABLE_PYTHON
     OperatingSystemPython::Terminate();
 #endif
 
     DynamicLoaderMacOSXDYLD::Terminate();
     DynamicLoaderDarwinKernel::Terminate();
-    ItaniumABILanguageRuntime::Terminate();
     AppleObjCRuntimeV2::Terminate();
     AppleObjCRuntimeV1::Terminate();
 #if defined (__APPLE__)
@@ -266,8 +268,6 @@
     case eVoteNo:           return "no";
     case eVoteNoOpinion:    return "no opinion";
     case eVoteYes:          return "yes";
-    default:
-        break;
     }
     return "invalid";
 }
@@ -344,9 +344,6 @@
                 return regex.Execute (name);
             }
             break;
-        default:
-            assert (!"unhandled NameMatchType in lldb_private::NameMatches()");
-            break;
         }
     }
     return false;

Modified: lldb/branches/windows/test/dotest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/dotest.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/dotest.py (original)
+++ lldb/branches/windows/test/dotest.py Tue Jan  8 06:51:53 2013
@@ -377,7 +377,7 @@
     X('+a', "Just do lldb Python API tests. Do not specify along with '+a'", dest='plus_a')
     X('+b', 'Just do benchmark tests', dest='plus_b')
     group.add_argument('-b', metavar='blacklist', help='Read a blacklist file specified after this option')
-    group.add_argument('-f', metavar='filterspec', help='Specify a filter, which consists of the test class name, a dot, followed by the test method, to only admit such test into the test suite')  # FIXME: Example?
+    group.add_argument('-f', metavar='filterspec', action='append', help='Specify a filter, which consists of the test class name, a dot, followed by the test method, to only admit such test into the test suite')  # FIXME: Example?
     X('-g', 'If specified, the filterspec by -f is not exclusive, i.e., if a test module does not match the filterspec (testclass.testmethod), the whole module is still admitted to the test suite')
     X('-l', "Don't skip long running tests")
     group.add_argument('-p', metavar='pattern', help='Specify a regexp filename pattern for inclusion in the test suite')
@@ -510,9 +510,9 @@
         failfast = True
 
     if args.f:
-        if args.f.startswith('-'):
+        if any([x.startswith('-') for x in args.f]):
             usage(parser)
-        filters.append(args.f)
+        filters.extend(args.f)
 
     if args.g:
         fs4all = False
@@ -834,38 +834,62 @@
         # The '-i' option is used to skip looking for lldb.py in the build tree.
         if ignore:
             return
+        
+        # If our lldb supports the -P option, use it to find the python path:
+        init_in_python_dir = 'lldb/__init__.py'
+        import pexpect
+        lldb_dash_p_result = None
+
+        if lldbHere:
+            lldb_dash_p_result = pexpect.run("%s -P"%(lldbHere))
+        elif lldbExec:
+            lldb_dash_p_result = pexpect.run("%s -P"%(lldbExec))
+
+        if lldb_dash_p_result and not lldb_dash_p_result.startswith(("<", "lldb: invalid option:")):
+            lines = lldb_dash_p_result.splitlines()
+            if len(lines) == 1 and os.path.isfile(os.path.join(lines[0], init_in_python_dir)):
+                lldbPath = lines[0]
+                if "linux" in sys.platform:
+                    os.environ['LLDB_BUILD_DIR'] = os.path.join(lldbPath, 'lldb')
+        
+        if not lldbPath: 
+            dbgPath  = os.path.join(base, *(xcode3_build_dir + dbg + python_resource_dir))
+            dbgPath2 = os.path.join(base, *(xcode4_build_dir + dbg + python_resource_dir))
+            dbcPath  = os.path.join(base, *(xcode3_build_dir + dbc + python_resource_dir))
+            dbcPath2 = os.path.join(base, *(xcode4_build_dir + dbc + python_resource_dir))
+            relPath  = os.path.join(base, *(xcode3_build_dir + rel + python_resource_dir))
+            relPath2 = os.path.join(base, *(xcode4_build_dir + rel + python_resource_dir))
+            baiPath  = os.path.join(base, *(xcode3_build_dir + bai + python_resource_dir))
+            baiPath2 = os.path.join(base, *(xcode4_build_dir + bai + python_resource_dir))
     
-        dbgPath  = os.path.join(base, *(xcode3_build_dir + dbg + python_resource_dir))
-        dbgPath2 = os.path.join(base, *(xcode4_build_dir + dbg + python_resource_dir))
-        dbcPath  = os.path.join(base, *(xcode3_build_dir + dbc + python_resource_dir))
-        dbcPath2 = os.path.join(base, *(xcode4_build_dir + dbc + python_resource_dir))
-        relPath  = os.path.join(base, *(xcode3_build_dir + rel + python_resource_dir))
-        relPath2 = os.path.join(base, *(xcode4_build_dir + rel + python_resource_dir))
-        baiPath  = os.path.join(base, *(xcode3_build_dir + bai + python_resource_dir))
-        baiPath2 = os.path.join(base, *(xcode4_build_dir + bai + python_resource_dir))
-    
-        if os.path.isfile(os.path.join(dbgPath, 'lldb/__init__.py')):
-            lldbPath = dbgPath
-        elif os.path.isfile(os.path.join(dbgPath2, 'lldb/__init__.py')):
-            lldbPath = dbgPath2
-        elif os.path.isfile(os.path.join(dbcPath, 'lldb/__init__.py')):
-            lldbPath = dbcPath
-        elif os.path.isfile(os.path.join(dbcPath2, 'lldb/__init__.py')):
-            lldbPath = dbcPath2
-        elif os.path.isfile(os.path.join(relPath, 'lldb/__init__.py')):
-            lldbPath = relPath
-        elif os.path.isfile(os.path.join(relPath2, 'lldb/__init__.py')):
-            lldbPath = relPath2
-        elif os.path.isfile(os.path.join(baiPath, 'lldb/__init__.py')):
-            lldbPath = baiPath
-        elif os.path.isfile(os.path.join(baiPath2, 'lldb/__init__.py')):
-            lldbPath = baiPath2
-    
+            if os.path.isfile(os.path.join(dbgPath, init_in_python_dir)):
+                lldbPath = dbgPath
+            elif os.path.isfile(os.path.join(dbgPath2, init_in_python_dir)):
+                lldbPath = dbgPath2
+            elif os.path.isfile(os.path.join(dbcPath, init_in_python_dir)):
+                lldbPath = dbcPath
+            elif os.path.isfile(os.path.join(dbcPath2, init_in_python_dir)):
+                lldbPath = dbcPath2
+            elif os.path.isfile(os.path.join(relPath, init_in_python_dir)):
+                lldbPath = relPath
+            elif os.path.isfile(os.path.join(relPath2, init_in_python_dir)):
+                lldbPath = relPath2
+            elif os.path.isfile(os.path.join(baiPath, init_in_python_dir)):
+                lldbPath = baiPath
+            elif os.path.isfile(os.path.join(baiPath2, init_in_python_dir)):
+                lldbPath = baiPath2
+
         if not lldbPath:
             print 'This script requires lldb.py to be in either ' + dbgPath + ',',
             print relPath + ', or ' + baiPath
             sys.exit(-1)
 
+    # Some of the code that uses this path assumes it hasn't resolved the Versions... link.  
+    # If the path we've constructed looks like that, then we'll strip out the Versions/A part.
+    (before, frameWithVersion, after) = lldbPath.rpartition("LLDB.framework/Versions/A")
+    if frameWithVersion != "" :
+        lldbPath = before + "LLDB.framework" + after
+
     # If tests need to find LLDB_FRAMEWORK, now they can do it
     os.environ["LLDB_FRAMEWORK"] = os.path.dirname(os.path.dirname(lldbPath))
 

Modified: lldb/branches/windows/test/expression_command/call-function/TestCallStdStringFunction.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/expression_command/call-function/TestCallStdStringFunction.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/expression_command/call-function/TestCallStdStringFunction.py (original)
+++ lldb/branches/windows/test/expression_command/call-function/TestCallStdStringFunction.py Tue Jan  8 06:51:53 2013
@@ -25,6 +25,7 @@
         self.buildDsym()
         self.call_function()
 
+    @expectedFailureLinux # bugzilla 14437
     @dwarf_test
     def test_with_dwarf(self):
         """Test calling std::String member function."""

Modified: lldb/branches/windows/test/expression_command/formatters/TestFormatters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/expression_command/formatters/TestFormatters.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/expression_command/formatters/TestFormatters.py (original)
+++ lldb/branches/windows/test/expression_command/formatters/TestFormatters.py Tue Jan  8 06:51:53 2013
@@ -25,6 +25,7 @@
         self.buildDsym()
         self.do_my_test()
 
+    @expectedFailureLinux # bugzilla 14437
     @dwarf_test
     def test_with_dwarf(self):
         """Test expr + formatters for good interoperability."""
@@ -51,9 +52,9 @@
         self.runCmd("script import formatters")
         self.runCmd("script import foosynth")
         
-        self.runCmd("frame variable foo1 -T")
-        self.runCmd("frame variable foo1.b -T")
-        self.runCmd("frame variable foo1.b.b_ref -T")
+        self.runCmd("frame variable foo1 --show-types")
+        self.runCmd("frame variable foo1.b --show-types")
+        self.runCmd("frame variable foo1.b.b_ref --show-types")
 
         self.expect("expression *(new foo(47))",
             substrs = ['(int) a = 47', '(bar) b = {', '(int) i = 94', '(baz) b = {', '(int) k = 99'])

Modified: lldb/branches/windows/test/expression_command/issue_11588/Test11588.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/expression_command/issue_11588/Test11588.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/expression_command/issue_11588/Test11588.py (original)
+++ lldb/branches/windows/test/expression_command/issue_11588/Test11588.py Tue Jan  8 06:51:53 2013
@@ -63,8 +63,8 @@
                 self.expect("print *(StgClosure*)$r14",
                     substrs = ["(StgClosure) $",
                     "(StgClosure *) &$","0x",
-                    "(long) addr = ",
-                    "(long) load_address = ",
+                    "addr = ",
+                    "load_address = ",
                     hex(addr)[2:].rstrip("L"),
                     str(addr)])
 

Modified: lldb/branches/windows/test/expression_command/radar_9673664/TestExprHelpExamples.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/expression_command/radar_9673664/TestExprHelpExamples.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/expression_command/radar_9673664/TestExprHelpExamples.py (original)
+++ lldb/branches/windows/test/expression_command/radar_9673664/TestExprHelpExamples.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.line = line_number(self.main_source, '// Set breakpoint here.')
 
     # rdar://problem/9673664
+    @expectedFailureLinux # bugzilla 14805 -- expressions that require memory allocation evaluate incorrectly on Linux
     def test_expr_commands(self):
         """The following expression commands should just work."""
         self.buildDefault()

Modified: lldb/branches/windows/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py (original)
+++ lldb/branches/windows/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py Tue Jan  8 06:51:53 2013
@@ -27,6 +27,7 @@
         self.buildDsym()
         self.type_query_from_other_cu()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dwarf_test
     def test_with_dwarf(self):
         """The expression parser's type search should be wider than the current compilation unit."""

Modified: lldb/branches/windows/test/functionalities/abbreviation/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/abbreviation/TestAbbreviations.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/abbreviation/TestAbbreviations.py (original)
+++ lldb/branches/windows/test/functionalities/abbreviation/TestAbbreviations.py Tue Jan  8 06:51:53 2013
@@ -148,11 +148,9 @@
         if self.getArchitecture() in ["", 'x86_64', 'i386']:
             self.expect("dis -f",
                         startstr = "a.out`sum(int, int)",
-                        substrs = [' push',
-                                   ' mov',
+                        substrs = [' mov',
                                    ' addl ',
-                                   'ret'],
-                        patterns = ['(leave|popq|popl)'])
+                                   'ret'])
 
         self.expect("i d l main.cpp",
                     patterns = ["Line table for .*main.cpp in `a.out"])

Modified: lldb/branches/windows/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py (original)
+++ lldb/branches/windows/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py Tue Jan  8 06:51:53 2013
@@ -54,7 +54,7 @@
         lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
 
         # Now add callbacks for the breakpoints just created.
-        self.runCmd("breakpoint command add -s command -o 'frame variable -T -s' 1")
+        self.runCmd("breakpoint command add -s command -o 'frame variable --show-types --scope' 1")
         self.runCmd("breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); print >> here, \"lldb\"; here.close()' 2")
         self.runCmd("breakpoint command add --python-function bktptcmd.function 3")
 
@@ -73,7 +73,7 @@
 
         self.expect("breakpoint command list 1", "Breakpoint 1 command ok",
             substrs = ["Breakpoint commands:",
-                          "frame variable -T -s"])
+                          "frame variable --show-types --scope"])
         self.expect("breakpoint command list 2", "Breakpoint 2 command ok",
             substrs = ["Breakpoint commands:",
                           "here = open",

Modified: lldb/branches/windows/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/branches/windows/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py Tue Jan  8 06:51:53 2013
@@ -34,18 +34,21 @@
         self.buildDsym()
         self.breakpoint_conditions_python()
 
+    @expectedFailureLinux # bugzilla 14426
     @dwarf_test
     def test_breakpoint_condition_with_dwarf_and_run_command(self):
         """Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
         self.buildDwarf()
         self.breakpoint_conditions()
 
+    @expectedFailureLinux # bugzilla 14426
     @dwarf_test
     def test_breakpoint_condition_inline_with_dwarf_and_run_command(self):
         """Exercise breakpoint condition inline with 'breakpoint set'."""
         self.buildDwarf()
         self.breakpoint_conditions(inline=True)
 
+    @expectedFailureLinux # bugzilla 14426
     @python_api_test
     @dwarf_test
     def test_breakpoint_condition_with_dwarf_and_python_api(self):
@@ -82,8 +85,8 @@
         self.expect("process status", PROCESS_STOPPED,
             patterns = ['Process .* stopped'])
 
-        # 'frame variable -T val' should return 3 due to breakpoint condition.
-        self.expect("frame variable -T val", VARIABLES_DISPLAYED_CORRECTLY,
+        # 'frame variable --show-types val' should return 3 due to breakpoint condition.
+        self.expect("frame variable --show-types val", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(int) val = 3')
 
         # Also check the hit count, which should be 3, by design.
@@ -113,8 +116,8 @@
         self.expect("process status", PROCESS_STOPPED,
             patterns = ['Process .* stopped'])
 
-        # 'frame variable -T val' should return 1 since it is the first breakpoint hit.
-        self.expect("frame variable -T val", VARIABLES_DISPLAYED_CORRECTLY,
+        # 'frame variable --show-types val' should return 1 since it is the first breakpoint hit.
+        self.expect("frame variable --show-types val", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(int) val = 1')
 
 

Modified: lldb/branches/windows/test/functionalities/completion/TestCompletion.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/completion/TestCompletion.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/completion/TestCompletion.py (original)
+++ lldb/branches/windows/test/functionalities/completion/TestCompletion.py Tue Jan  8 06:51:53 2013
@@ -29,6 +29,7 @@
         """Test that 'de' completes to 'detach '."""
         self.complete_from_to('de', 'detach ')
 
+    @expectedFailureLinux # bugzilla 14425
     def test_process_attach_dash_dash_con(self):
         """Test that 'process attach --con' completes to 'process attach --continue '."""
         self.complete_from_to('process attach --con', 'process attach --continue ')

Modified: lldb/branches/windows/test/functionalities/connect_remote/TestConnectRemote.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/connect_remote/TestConnectRemote.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/connect_remote/TestConnectRemote.py (original)
+++ lldb/branches/windows/test/functionalities/connect_remote/TestConnectRemote.py Tue Jan  8 06:51:53 2013
@@ -12,6 +12,7 @@
 
     mydir = os.path.join("functionalities", "connect_remote")
 
+    @expectedFailureLinux # bugzilla 14427
     def test_connect_remote(self):
         """Test "process connect connect:://localhost:12345"."""
 

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py Tue Jan  8 06:51:53 2013
@@ -284,7 +284,7 @@
                                'i_2',
                                'k_2',
                                'o_2'])
-        self.expect('frame variable a_long_guy -A', matching=False,
+        self.expect('frame variable a_long_guy --show-all-children', matching=False,
                     substrs = ['...'])
 
 

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py Tue Jan  8 06:51:53 2013
@@ -94,9 +94,10 @@
             substrs = ['Second: x=65',
                         'y=0x'])
                     
-        self.expect("frame variable second --summary NoSuchSummary",
-            substrs = ['Second: x=65',
-                        'y=0x'])
+        # <rdar://problem/11576143> decided that invalid summaries will raise an error
+        # instead of just defaulting to the base summary
+        self.expect("frame variable second --summary NoSuchSummary",error=True,
+            substrs = ['must specify a valid named summary'])
                     
         self.runCmd("thread step-over")
                     

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py Tue Jan  8 06:51:53 2013
@@ -295,6 +295,15 @@
                     '(NSURL *) nsurl2 =','@"page.html -- http://www.foo.bar',
                     '(NSURL *) nsurl3 = ','@"?whatever -- http://www.foo.bar/page.html"'])
 
+        self.expect('frame variable nserror',
+                    substrs = ['domain: @"Foobar" - code: 12'])
+
+        self.expect('frame variable nserror->_userInfo',
+                    substrs = ['2 key/value pairs'])
+
+        self.expect('frame variable nserror->_userInfo --ptr-depth 1 -d run-target',
+                    substrs = ['@"a"','@"b"',"1","2"])
+
         self.expect('frame variable bundle_string bundle_url main_bundle',
                     substrs = ['(NSBundle *) bundle_string = ',' @"/System/Library/Frameworks/Accelerate.framework"',
                     '(NSBundle *) bundle_url = ',' @"/System/Library/Frameworks/Cocoa.framework"',
@@ -371,7 +380,7 @@
         self.expect('frame variable myclass4',
                     substrs = ['(Class) myclass4 = NSMutableArray'])
         self.expect('frame variable myclass5',
-                    substrs = ['(Class) myclass5 = <error: unknown Class>'])
+                    substrs = ['(Class) myclass5 = nil'])
 
 
     def expr_objc_data_formatter_commands(self):
@@ -411,9 +420,9 @@
         self.expect('expr -d true -- @"Hello"',
             substrs = ['Hello'])
 
-        self.expect('expr -d true -o -- @"Hello"',
+        self.expect('expr -d true --object-description -- @"Hello"',
             substrs = ['Hello'])
-        self.expect('expr -d true -o -- @"Hello"', matching=False,
+        self.expect('expr -d true --object-description -- @"Hello"', matching=False,
             substrs = ['@"Hello" Hello'])
 
 

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/main.m?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/main.m (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-objc/main.m Tue Jan  8 06:51:53 2013
@@ -507,6 +507,9 @@
 	    CFURLRef cfchildurl_ref = CFURLCreateWithString(NULL, CFSTR("page.html"), cfurl_ref);
 	    CFURLRef cfgchildurl_ref = CFURLCreateWithString(NULL, CFSTR("?whatever"), cfchildurl_ref);
 
+	    NSDictionary *error_userInfo = @{@"a": @1, @"b" : @2};
+	    NSError *nserror = [[NSError alloc] initWithDomain:@"Foobar" code:12 userInfo:error_userInfo];
+
 	    NSBundle* bundle_string = [[NSBundle alloc] initWithPath:@"/System/Library/Frameworks/Accelerate.framework"];
 	    NSBundle* bundle_url = [[NSBundle alloc] initWithURL:[[NSURL alloc] initWithString:@"file://localhost/System/Library/Frameworks/Cocoa.framework"]];
 

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py Tue Jan  8 06:51:53 2013
@@ -126,7 +126,7 @@
                                'a = 280']);
 
         # check that expanding a pointer does the right thing
-        self.expect("frame variable -P 1 f00_ptr",
+        self.expect("frame variable --ptr-depth 1 f00_ptr",
             substrs = ['r = 45',
                        'fake_a = 218103808',
                        'a = 12'])
@@ -139,7 +139,7 @@
         self.expect('frame variable f00_1', matching=False,
             substrs = ['b = 1',
                        'j = 17'])
-        self.expect("frame variable -P 1 f00_ptr",
+        self.expect("frame variable --ptr-depth 1 f00_ptr",
                     substrs = ['r = 45',
                                'fake_a = 218103808',
                                'a = 12'])
@@ -151,7 +151,7 @@
         self.expect('frame variable f00_1',
                         substrs = ['b = 1',
                                    'j = 17'])
-        self.expect("frame variable -P 1 f00_ptr", matching=False,
+        self.expect("frame variable --ptr-depth 1 f00_ptr", matching=False,
                     substrs = ['r = 45',
                                'fake_a = 218103808',
                                'a = 12'])
@@ -176,7 +176,7 @@
         self.expect('frame variable f00_1', matching=False,
                     substrs = ['b = 1',
                                'j = 17'])
-        self.expect("frame variable -P 1 f00_ptr", 
+        self.expect("frame variable --ptr-depth 1 f00_ptr", 
                     substrs = ['r = 45',
                                'fake_a = 218103808',
                                'a = 12'])

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py Tue Jan  8 06:51:53 2013
@@ -74,7 +74,7 @@
                        '}'])
 
         # Skip the default (should be 1) levels of summaries
-        self.expect('frame variable -Y',
+        self.expect('frame variable --no-summary-depth',
             substrs = ['(DeepData_1) data1 = {',
                        'm_child1 = 0x',
                        '}',
@@ -86,7 +86,7 @@
                        '}'])
 
         # Now skip 2 levels of summaries
-        self.expect('frame variable -Y2',
+        self.expect('frame variable --no-summary-depth=2',
             substrs = ['(DeepData_1) data1 = {',
                        'm_child1 = 0x',
                        '}',
@@ -99,15 +99,15 @@
                        '}'])
 
         # Check that no "Level 3" comes out
-        self.expect('frame variable data1.m_child1 -Y2', matching=False,
+        self.expect('frame variable data1.m_child1 --no-summary-depth=2', matching=False,
             substrs = ['Level 3'])
 
         # Now expand a pointer with 2 level of skipped summaries
-        self.expect('frame variable data1.m_child1 -Y2',
+        self.expect('frame variable data1.m_child1 --no-summary-depth=2',
                     substrs = ['(DeepData_2 *) data1.m_child1 = 0x'])
 
         # Deref and expand said pointer
-        self.expect('frame variable *data1.m_child1 -Y2',
+        self.expect('frame variable *data1.m_child1 --no-summary-depth=2',
                     substrs = ['(DeepData_2) *data1.m_child1 = {',
                                'm_child2 = {',
                                'm_child1 = 0x',
@@ -115,7 +115,7 @@
                                '}'])
 
         # Expand an expression, skipping 2 layers of summaries
-        self.expect('frame variable data1.m_child1->m_child2 -Y2',
+        self.expect('frame variable data1.m_child1->m_child2 --no-summary-depth=2',
                 substrs = ['(DeepData_3) data1.m_child1->m_child2 = {',
                            'm_child2 = {',
                            'm_child1 = Level 5',
@@ -124,7 +124,7 @@
                            '}'])
 
         # Expand same expression, skipping only 1 layer of summaries
-        self.expect('frame variable data1.m_child1->m_child2 -Y1',
+        self.expect('frame variable data1.m_child1->m_child2 --no-summary-depth=1',
                     substrs = ['(DeepData_3) data1.m_child1->m_child2 = {',
                                'm_child1 = 0x',
                                'Level 4',
@@ -148,14 +148,14 @@
                        self.skipTest("rdar://problem/9804600 wrong namespace for std::string in debug info")
 
         # Expand same expression, skipping 3 layers of summaries
-        self.expect('frame variable data1.m_child1->m_child2 -T -Y3',
+        self.expect('frame variable data1.m_child1->m_child2 --show-types --no-summary-depth=3',
                     substrs = ['(DeepData_3) data1.m_child1->m_child2 = {',
                                'm_some_text = "Just a test"',
                                'm_child2 = {',
                                'm_some_text = "Just a test"'])
 
         # Expand within a standard string (might depend on the implementation of the C++ stdlib you use)
-        self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 -Y2',
+        self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=2',
             substrs = ['(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {',
                        'm_some_text = {',
                        '_M_dataplus = {',
@@ -163,18 +163,18 @@
                        '"Just a test"'])
 
         # Repeat the above, but only skip 1 level of summaries
-        self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 -Y1',
+        self.expect('frame variable data1.m_child1->m_child2.m_child1.m_child2 --no-summary-depth=1',
                     substrs = ['(DeepData_5) data1.m_child1->m_child2.m_child1.m_child2 = {',
                                'm_some_text = "Just a test"',
                                '}'])
 
-        # Change summary and expand, first without -Y then with -Y
+        # Change summary and expand, first without --no-summary-depth then with --no-summary-depth
         self.runCmd("type summary add --summary-string \"${var.m_some_text}\" DeepData_5")
         
         self.expect('fr var data2.m_child4.m_child2.m_child2',
             substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = "Just a test"'])
 
-        self.expect('fr var data2.m_child4.m_child2.m_child2 -Y',
+        self.expect('fr var data2.m_child4.m_child2.m_child2 --no-summary-depth',
                     substrs = ['(DeepData_5) data2.m_child4.m_child2.m_child2 = {',
                                'm_some_text = "Just a test"',
                                '}'])

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py Tue Jan  8 06:51:53 2013
@@ -19,6 +19,7 @@
         self.buildDsym()
         self.data_formatter_commands()
 
+    @skipOnLinux # No standard locations for libc++ on Linux, so skip for now 
     @dwarf_test
     def test_with_dwarf_and_run_command(self):
         """Test data formatter commands."""
@@ -58,7 +59,7 @@
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.runCmd("frame variable numbers_list -T")
+        self.runCmd("frame variable numbers_list --show-types")
         self.runCmd("type summary add std::int_list std::string_list int_list string_list --summary-string \"list has ${svar%#} items\" -e")
         self.runCmd("type format add -f hex int")
 

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py Tue Jan  8 06:51:53 2013
@@ -19,6 +19,7 @@
         self.buildDsym()
         self.data_formatter_commands()
 
+    @skipOnLinux # No standard locations for libc++ on Linux, so skip for now 
     @dwarf_test
     def test_with_dwarf_and_run_command(self):
         """Test data formatter commands."""
@@ -58,7 +59,7 @@
 
         self.expect('image list',substrs=['libc++.1.dylib','libc++abi.dylib'])
 
-        self.runCmd("frame variable ii -T")
+        self.runCmd("frame variable ii --show-types")
         
         self.runCmd("type summary add -x \"std::__1::map<\" --summary-string \"map has ${svar%#} items\" -e") 
         
@@ -135,7 +136,7 @@
                     substrs = ['map has 0 items',
                                '{}'])
         
-        self.runCmd("frame variable si -T")
+        self.runCmd("frame variable si --show-types")
 
         self.expect('frame variable si',
                     substrs = ['map has 0 items',
@@ -206,7 +207,7 @@
                                '{}'])
 
         self.runCmd("n")
-        self.runCmd("frame variable is -T")
+        self.runCmd("frame variable is --show-types")
         
         self.expect('frame variable is',
                     substrs = ['map has 0 items',
@@ -267,7 +268,7 @@
                                '{}'])
 
         self.runCmd("n");self.runCmd("n");
-        self.runCmd("frame variable ss -T")
+        self.runCmd("frame variable ss --show-types")
         
         self.expect('frame variable ss',
                     substrs = ['map has 0 items',

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py Tue Jan  8 06:51:53 2013
@@ -19,6 +19,7 @@
         self.buildDsym()
         self.data_formatter_commands()
 
+    @skipOnLinux # No standard locations for libc++ on Linux, so skip for now 
     @dwarf_test
     def test_with_dwarf_and_run_command(self):
         """Test data formatter commands."""

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py Tue Jan  8 06:51:53 2013
@@ -56,7 +56,7 @@
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.runCmd("frame variable numbers_list -T")
+        self.runCmd("frame variable numbers_list --show-types")
         #self.runCmd("type synth add std::int_list std::string_list int_list string_list -l StdListSynthProvider")
         self.runCmd("type summary add std::int_list std::string_list int_list string_list --summary-string \"list has ${svar%#} items\" -e")
         self.runCmd("type format add -f hex int")

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py Tue Jan  8 06:51:53 2013
@@ -56,7 +56,7 @@
         # Execute the cleanup function during test case tear down.
         self.addTearDownHook(cleanup)
 
-        self.runCmd("frame variable ii -T")
+        self.runCmd("frame variable ii --show-types")
         
         self.runCmd("type summary add -x \"std::map<\" --summary-string \"map has ${svar%#} items\" -e") 
         
@@ -136,7 +136,7 @@
                                '{}'])
         
         self.runCmd("n")
-        self.runCmd("frame variable si -T")
+        self.runCmd("frame variable si --show-types")
 
         self.expect('frame variable si',
                     substrs = ['map has 0 items',
@@ -211,7 +211,7 @@
                                '{}'])
 
         self.runCmd("n")
-        self.runCmd("frame variable is -T")
+        self.runCmd("frame variable is --show-types")
         
         self.expect('frame variable is',
                     substrs = ['map has 0 items',
@@ -272,7 +272,7 @@
                                '{}'])
 
         self.runCmd("n")
-        self.runCmd("frame variable ss -T")
+        self.runCmd("frame variable ss --show-types")
         
         self.expect('frame variable ss',
                     substrs = ['map has 0 items',

Modified: lldb/branches/windows/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py Tue Jan  8 06:51:53 2013
@@ -71,7 +71,7 @@
                                'z = 8'])
         
         # if we skip synth and summary show y
-        self.expect("frame variable int_bag -S false -Y1",
+        self.expect("frame variable int_bag --synthetic-type false --no-summary-depth=1",
                     substrs = ['x = 6',
                                'y = 7',
                                'z = 8'])
@@ -97,7 +97,7 @@
                                'z = 8'])
 
         # If I skip summaries, still give me the artificial children
-        self.expect("frame variable int_bag -Y1",
+        self.expect("frame variable int_bag --no-summary-depth=1",
                     substrs = ['x = 6',
                                'z = 8'])
 
@@ -135,14 +135,14 @@
 
         # ...even bitfields
         self.runCmd("type filter add BagOfBags --child x.y --child \"y->z[1-2]\"")
-        self.expect('frame variable bag_bag -T',
+        self.expect('frame variable bag_bag --show-types',
                     substrs = ['x.y = 70',
                                '(int:2) y->z[1-2] = 2'])
 
         # ...even if we format the bitfields
         self.runCmd("type filter add BagOfBags --child x.y --child \"y->y[0-0]\"")
         self.runCmd("type format add \"int:1\" -f bool")
-        self.expect('frame variable bag_bag -T',
+        self.expect('frame variable bag_bag --show-types',
                     substrs = ['x.y = 70',
                                '(int:1) y->y[0-0] = true'])
         
@@ -167,7 +167,7 @@
                                'array[2] = 3'])
         
         # skip synthetic children
-        self.expect('frame variable plenty_of_stuff -S no',
+        self.expect('frame variable plenty_of_stuff --synthetic-type no',
                     substrs = ['some_values = 0x0',
                                'array = 0x',
                                'array_size = 5'])
@@ -180,19 +180,19 @@
                        '*(plenty_of_stuff.array) = 3'])
         
         # check that we do not lose location information for our children
-        self.expect('frame variable plenty_of_stuff -L',
+        self.expect('frame variable plenty_of_stuff --location',
                     substrs = ['0x',
                                ':   bitfield = 17'])
 
         # check we work across pointer boundaries
-        self.expect('frame variable plenty_of_stuff.some_values -P1',
+        self.expect('frame variable plenty_of_stuff.some_values --ptr-depth=1',
                     substrs = ['(BagOfInts *) plenty_of_stuff.some_values',
                                'x = 5',
                                'z = 7'])
 
         # but not if we don't want to
         self.runCmd("type filter add BagOfInts --child x --child z -p")
-        self.expect('frame variable plenty_of_stuff.some_values -P1',
+        self.expect('frame variable plenty_of_stuff.some_values --ptr-depth=1',
                     substrs = ['(BagOfInts *) plenty_of_stuff.some_values',
                                'x = 5',
                                'y = 6',

Modified: lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/TestRdar%2011988289.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/TestRdar 11988289.py Tue Jan  8 06:51:53 2013
@@ -59,23 +59,23 @@
         # Now check that we are displaying Cocoa classes correctly
         self.expect('frame variable dictionary',
                     substrs = ['3 key/value pairs'])
-        self.expect('frame variable mutable',
+        self.expect('frame variable mutabledict',
                     substrs = ['4 key/value pairs'])
         self.expect('frame variable dictionary --ptr-depth 1',
                     substrs = ['3 key/value pairs','[0] = {','key = 0x','value = 0x','[1] = {','[2] = {'])
-        self.expect('frame variable mutable --ptr-depth 1',
+        self.expect('frame variable mutabledict --ptr-depth 1',
                     substrs = ['4 key/value pairs','[0] = {','key = 0x','value = 0x','[1] = {','[2] = {','[3] = {'])
-        self.expect('frame variable dictionary --ptr-depth 1 -d no-run-target',
+        self.expect('frame variable dictionary --ptr-depth 1 --dynamic-type no-run-target',
                     substrs = ['3 key/value pairs','@"bar"','@"2 objects"','@"baz"','2 key/value pairs'])
-        self.expect('frame variable mutable --ptr-depth 1 -d no-run-target',
+        self.expect('frame variable mutabledict --ptr-depth 1 --dynamic-type no-run-target',
                     substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs'])
-        self.expect('frame variable mutable --ptr-depth 2 -d no-run-target',
+        self.expect('frame variable mutabledict --ptr-depth 2 --dynamic-type no-run-target',
         substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs {','@"bar"','@"2 objects"'])
-        self.expect('frame variable mutable --ptr-depth 3 -d no-run-target',
+        self.expect('frame variable mutabledict --ptr-depth 3 --dynamic-type no-run-target',
         substrs = ['4 key/value pairs','(int)23','@"123"','@"http://www.apple.com"','@"puartist"','3 key/value pairs {','@"bar"','@"2 objects"','(int)1','@"two"'])
 
         self.assertTrue(self.frame().FindVariable("dictionary").MightHaveChildren(), "dictionary says it does not have children!")
-        self.assertTrue(self.frame().FindVariable("mutable").MightHaveChildren(), "mutable says it does not have children!")
+        self.assertTrue(self.frame().FindVariable("mutabledict").MightHaveChildren(), "mutable says it does not have children!")
 
 
 if __name__ == '__main__':

Modified: lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/main.m?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/main.m (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/rdar-11988289/main.m Tue Jan  8 06:51:53 2013
@@ -18,11 +18,11 @@
 	NSArray* keys = @[@"foo",@"bar",@"baz"];
 	NSArray* values = @[@"hello",@[@"X",@"Y"],@{@1 : @"one", at 2 : @"two"}];
 	NSDictionary* dictionary = [NSDictionary dictionaryWithObjects:values forKeys:keys];
-	NSMutableDictionary* mutable = [NSMutableDictionary dictionaryWithCapacity:5];
-	[mutable setObject:@"123" forKey:@23];
-	[mutable setObject:[NSURL URLWithString:@"http://www.apple.com"] forKey:@"foobar"];
-	[mutable setObject:@[@"a", at 12] forKey:@57];
-	[mutable setObject:dictionary forKey:@"puartist"];
+	NSMutableDictionary* mutabledict = [NSMutableDictionary dictionaryWithCapacity:5];
+	[mutabledict setObject:@"123" forKey:@23];
+	[mutabledict setObject:[NSURL URLWithString:@"http://www.apple.com"] forKey:@"foobar"];
+	[mutabledict setObject:@[@"a", at 12] forKey:@57];
+	[mutabledict setObject:dictionary forKey:@"puartist"];
 
     [pool drain];// Set break point at this line.
     return 0;

Modified: lldb/branches/windows/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py (original)
+++ lldb/branches/windows/test/functionalities/data-formatter/rdar-12437442/TestRdar12437442.py Tue Jan  8 06:51:53 2013
@@ -64,7 +64,7 @@
         id_x.SetPreferSyntheticValue(True)
         
         if self.TraceOn():
-            self.runCmd("frame variable x -d run-target --ptr-depth 1")
+            self.runCmd("frame variable x --dynamic-type run-target --ptr-depth 1")
         
         self.assertTrue(id_x.GetSummary() == '@"5 objects"', "array does not get correct summary")
 
@@ -75,7 +75,7 @@
         id_x.SetPreferSyntheticValue(True)
 
         if self.TraceOn():
-            self.runCmd("frame variable x -d run-target --ptr-depth 1")
+            self.runCmd("frame variable x --dynamic-type run-target --ptr-depth 1")
 
         self.assertTrue(id_x.GetNumChildren() == 7, "dictionary does not have 7 children")
         id_x.SetPreferSyntheticValue(False)

Modified: lldb/branches/windows/test/functionalities/dead-strip/TestDeadStrip.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/dead-strip/TestDeadStrip.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/dead-strip/TestDeadStrip.py (original)
+++ lldb/branches/windows/test/functionalities/dead-strip/TestDeadStrip.py Tue Jan  8 06:51:53 2013
@@ -19,6 +19,7 @@
         self.buildDsym()
         self.dead_strip()
 
+    @skipOnLinux # The -dead_strip linker option isn't supported on Linux versions of ld.
     @dwarf_test
     def test_with_dwarf(self):
         """Test breakpoint works correctly with dead-code stripping."""
@@ -31,13 +32,13 @@
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
         # Break by function name f1 (live code).
-        lldbutil.run_break_set_by_symbol (self, "f1", extra_options="-s a.out", num_expected_locations=1, module_name="a.out")
+        lldbutil.run_break_set_by_symbol (self, "f1", num_expected_locations=1, module_name="a.out")
 
         # Break by function name f2 (dead code).
-        lldbutil.run_break_set_by_symbol (self, "f2", extra_options="-s a.out", num_expected_locations=0)
+        lldbutil.run_break_set_by_symbol (self, "f2", num_expected_locations=0, module_name="a.out")
 
         # Break by function name f3 (live code).
-        lldbutil.run_break_set_by_symbol (self, "f3", extra_options="-s a.out", num_expected_locations=1, module_name="a.out")
+        lldbutil.run_break_set_by_symbol (self, "f3", num_expected_locations=1, module_name="a.out")
 
         self.runCmd("run", RUN_SUCCEEDED)
 

Modified: lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py (original)
+++ lldb/branches/windows/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.expr_doesnt_deadlock()
 
     @dwarf_test
+    @expectedFailureLinux # due to bugzilla 14437
     def test_with_dwarf_and_run_command(self):
         """Test that expr will time out and allow other threads to run if it blocks."""
         self.buildDwarf()

Modified: lldb/branches/windows/test/functionalities/inferior-changed/TestInferiorChanged.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/inferior-changed/TestInferiorChanged.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/inferior-changed/TestInferiorChanged.py (original)
+++ lldb/branches/windows/test/functionalities/inferior-changed/TestInferiorChanged.py Tue Jan  8 06:51:53 2013
@@ -21,6 +21,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.inferior_not_crashing()
 
+    @expectedFailureLinux # bugzilla 14662 - POSIX dynamic loader asserts on re-launch
     def test_inferior_crashing_dwarf(self):
         """Test lldb reloads the inferior after it was changed during the session."""
         self.buildDwarf()
@@ -45,11 +46,13 @@
 
         self.runCmd("run", RUN_SUCCEEDED)
 
+        # FIXME: This expected stop reason is Darwin-specific
         # The stop reason of the thread should be a bad access exception.
         self.expect("thread list", STOPPED_DUE_TO_EXC_BAD_ACCESS,
             substrs = ['stopped',
                        'stop reason = EXC_BAD_ACCESS'])
 
+        # FIXME: This expected stop reason is Darwin-specific
         # And it should report the correct line number.
         self.expect("thread backtrace all",
             substrs = ['stop reason = EXC_BAD_ACCESS',
@@ -61,6 +64,7 @@
         self.runCmd("run", RUN_SUCCEEDED)
         self.runCmd("process status")
 
+        # FIXME: This unexpected stop reason is Darwin-specific
         if 'EXC_BAD_ACCESS' in self.res.GetOutput():
             self.fail("Inferior changed, but lldb did not perform a reload")
 

Modified: lldb/branches/windows/test/functionalities/inferior-crashing/TestInferiorCrashing.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/inferior-crashing/TestInferiorCrashing.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/inferior-crashing/TestInferiorCrashing.py (original)
+++ lldb/branches/windows/test/functionalities/inferior-crashing/TestInferiorCrashing.py Tue Jan  8 06:51:53 2013
@@ -39,14 +39,19 @@
 
         self.runCmd("run", RUN_SUCCEEDED)
 
+        if sys.platform.startswith("darwin"):
+            stop_reason = 'stop reason = EXC_BAD_ACCESS'
+        else:
+            stop_reason = 'stop reason = invalid address'
+
         # The stop reason of the thread should be a bad access exception.
         self.expect("thread list", STOPPED_DUE_TO_EXC_BAD_ACCESS,
             substrs = ['stopped',
-                       'stop reason = EXC_BAD_ACCESS'])
+                       stop_reason])
 
         # And it should report the correct line number.
         self.expect("thread backtrace all",
-            substrs = ['stop reason = EXC_BAD_ACCESS',
+            substrs = [stop_reason,
                        'main.c:%d' % self.line])
 
     def inferior_crashing_python(self):

Modified: lldb/branches/windows/test/functionalities/load_unload/TestLoadUnload.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/load_unload/TestLoadUnload.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/load_unload/TestLoadUnload.py (original)
+++ lldb/branches/windows/test/functionalities/load_unload/TestLoadUnload.py Tue Jan  8 06:51:53 2013
@@ -22,6 +22,7 @@
         self.line_d_function = line_number('d.c',
                                            '// Find this line number within d_dunction().')
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_modules_search_paths(self):
         """Test target modules list after loading a different copy of the library libd.dylib, and verifies that it works with 'target modules search-paths add'."""
 
@@ -30,7 +31,6 @@
 
         if sys.platform.startswith("darwin"):
             dylibName = 'libd.dylib'
-            dylibPath = 'DYLD_LIBRARY_PATH'
 
         # The directory with the dynamic library we did not link to.
         new_dir = os.path.join(os.getcwd(), "hidden")
@@ -61,13 +61,13 @@
         # Obliterate traces of libd from the old location.
         os.remove(old_dylib)
         # Inform dyld of the new path, too.
-        env_cmd_string = "settings set target.env-vars " + dylibPath + "=" + new_dir
+        env_cmd_string = "settings set target.env-vars " + self.dylibPath + "=" + new_dir
         if self.TraceOn():
             print "Set environment to: ", env_cmd_string
         self.runCmd(env_cmd_string)
         self.runCmd("settings show target.env-vars")
 
-        remove_dyld_path_cmd = "settings remove target.env-vars " + dylibPath
+        remove_dyld_path_cmd = "settings remove target.env-vars " + self.dylibPath
         self.addTearDownHook(lambda: self.runCmd(remove_dyld_path_cmd))
 
         self.runCmd("run")
@@ -75,7 +75,7 @@
         self.expect("target modules list", "LLDB successfully locates the relocated dynamic library",
             substrs = [new_dylib])
 
-        
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_dyld_library_path(self):
         """Test DYLD_LIBRARY_PATH after moving libd.dylib, which defines d_function, somewhere else."""
 
@@ -88,7 +88,6 @@
         if sys.platform.startswith("darwin"):
             dylibName = 'libd.dylib'
             dsymName = 'libd.dylib.dSYM'
-            dylibPath = 'DYLD_LIBRARY_PATH'
 
         # The directory to relocate the dynamic library and its debugging info.
         special_dir = "hidden"
@@ -104,13 +103,13 @@
         # Try running with the DYLD_LIBRARY_PATH environment variable set, make sure
         # we pick up the hidden dylib.
 
-        env_cmd_string = "settings set target.env-vars " + dylibPath + "=" + new_dir
+        env_cmd_string = "settings set target.env-vars " + self.dylibPath + "=" + new_dir
         if self.TraceOn():
             print "Set environment to: ", env_cmd_string
         self.runCmd(env_cmd_string)
         self.runCmd("settings show target.env-vars")
 
-        remove_dyld_path_cmd = "settings remove target.env-vars " + dylibPath
+        remove_dyld_path_cmd = "settings remove target.env-vars " + self.dylibPath
         self.addTearDownHook(lambda: self.runCmd(remove_dyld_path_cmd))
 
         lldbutil.run_break_set_by_file_and_line (self, "d.c", self.line_d_function, num_expected_locations=1, loc_exact=True)
@@ -130,6 +129,7 @@
         self.expect("target modules list",
             substrs = [special_dir, os.path.basename(new_dylib)])
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_lldb_process_load_and_unload_commands(self):
         """Test that lldb process load/unload command work correctly."""
 
@@ -176,6 +176,7 @@
 
         self.runCmd("process continue")
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_load_unload(self):
         """Test breakpoint by name works correctly with dlopen'ing."""
 
@@ -215,6 +216,7 @@
         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
             substrs = [' resolved, hit count = 2'])
 
+    @skipOnLinux # bugzilla 14424 - missing linux Makefiles/testcase support
     def test_step_over_load (self):
         """Test stepping over code that loads a shared library works correctly."""
 

Modified: lldb/branches/windows/test/functionalities/platform/TestPlatformCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/platform/TestPlatformCommand.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/platform/TestPlatformCommand.py (original)
+++ lldb/branches/windows/test/functionalities/platform/TestPlatformCommand.py Tue Jan  8 06:51:53 2013
@@ -18,6 +18,7 @@
         self.expect("platform list",
             patterns = ['^Available platforms:'])
 
+    @expectedFailureLinux # due to bugzilla 14541 -- Cannot list processes on Linux
     def test_process_list(self):
         self.expect("platform process list",
             substrs = ['PID', 'ARCH', 'NAME'])
@@ -27,6 +28,7 @@
         self.expect("platform process info", error=True,
             substrs = ['one or more process id(s) must be specified'])
 
+    @expectedFailureLinux # due to bugzilla 14806 -- "platform status" prints more information on Mac OS X than on Linux
     def test_status(self):
         self.expect("platform status",
             substrs = ['Platform', 'Triple', 'OS Version', 'Kernel', 'Hostname'])

Modified: lldb/branches/windows/test/functionalities/process_launch/TestProcessLaunch.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/process_launch/TestProcessLaunch.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/process_launch/TestProcessLaunch.py (original)
+++ lldb/branches/windows/test/functionalities/process_launch/TestProcessLaunch.py Tue Jan  8 06:51:53 2013
@@ -11,6 +11,13 @@
 
     mydir = os.path.join("functionalities", "process_launch")
 
+    def setUp(self):
+        # Call super's setUp().
+        TestBase.setUp(self)
+        # disable "There is a running process, kill it and restart?" prompt
+        self.runCmd("settings set auto-confirm true")
+        self.addTearDownHook(lambda: self.runCmd("settings clear auto-confirm"))
+
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dsym_test
     def test_io_with_dsym (self):

Modified: lldb/branches/windows/test/functionalities/register/TestRegisters.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/register/TestRegisters.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/register/TestRegisters.py (original)
+++ lldb/branches/windows/test/functionalities/register/TestRegisters.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.buildDefault()
         self.register_commands()
 
+    @expectedFailureLinux # bugzilla 14600 - Convenience registers not supported on Linux
     def test_convenience_registers(self):
         """Test convenience registers."""
         if not self.getArchitecture() in ['x86_64']:
@@ -27,6 +28,7 @@
         self.buildDefault()
         self.convenience_registers()
 
+    @expectedFailureLinux # bugzilla 14600 - Convenience registers not supported on Linux
     def test_convenience_registers_with_process_attach(self):
         """Test convenience registers after a 'process attach'."""
         if not self.getArchitecture() in ['x86_64']:
@@ -34,6 +36,7 @@
         self.buildDefault()
         self.convenience_registers_with_process_attach()
 
+    @expectedFailureLinux # bugzilla 14661 - Expressions involving XMM registers fail on Linux
     def register_commands(self):
         """Test commands related to registers, in particular xmm registers."""
         exe = os.path.join(os.getcwd(), "a.out")

Modified: lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py (original)
+++ lldb/branches/windows/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py Tue Jan  8 06:51:53 2013
@@ -21,6 +21,7 @@
         self.stop_hook_multiple_threads()
 
     @dwarf_test
+    @skipOnLinux # due to bugzilla 14323
     def test_stop_hook_multiple_threads_with_dwarf(self):
         """Test that lldb stop-hook works for multiple threads."""
         self.buildDwarf(dictionary=self.d)
@@ -61,7 +62,7 @@
         # Now run the program, expect to stop at the the first breakpoint which is within the stop-hook range.
         child.sendline('run')
         child.expect_exact(prompt)
-        child.sendline('target stop-hook add -o "frame variable -g g_val"')
+        child.sendline('target stop-hook add -o "frame variable --show-globals g_val"')
         child.expect_exact(prompt)
 
         # Continue and expect to find the output emitted by the firing of our stop hook.

Modified: lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py Tue Jan  8 06:51:53 2013
@@ -21,6 +21,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_watchlocation()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_hello_watchlocation_with_dwarf(self):
         """Test watching a location with '-x size' option."""

Modified: lldb/branches/windows/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py Tue Jan  8 06:51:53 2013
@@ -19,6 +19,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_hello_watchpoint_with_dwarf_using_watchpoint_set(self):
         """Test a simple sequence of watchpoint creation and watchpoint hit."""

Modified: lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py Tue Jan  8 06:51:53 2013
@@ -21,6 +21,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_multiple_threads()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_multiple_threads_with_dwarf(self):
         """Test that lldb watchpoint works for multiple threads."""
@@ -36,6 +37,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_multiple_threads_wp_set_and_then_delete()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_multiple_threads_wp_set_and_then_delete_with_dwarf(self):
         """Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires."""

Modified: lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py Tue Jan  8 06:51:53 2013
@@ -34,6 +34,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.normal_read_write_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_watchpoint_with_dwarf(self):
         """Test read_write watchpoint and expect to stop two times."""
@@ -49,6 +50,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.delete_read_write_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_watchpoint_delete_with_dwarf(self):
         """Test delete watchpoint and expect not to stop for watchpoint."""
@@ -64,6 +66,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.ignore_read_write_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_watchpoint_set_ignore_count_with_dwarf(self):
         """Test watchpoint ignore count and expect to not to stop at all."""
@@ -79,6 +82,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.read_write_watchpoint_disable_after_first_stop()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_disable_after_first_stop__with_dwarf(self):
         """Test read_write watchpoint but disable it after the first stop."""
@@ -94,6 +98,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.read_write_watchpoint_disable_then_enable()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_rw_disable_then_enable_with_dwarf(self):
         """Test read_write watchpoint, disable initially, then enable it."""

Modified: lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py Tue Jan  8 06:51:53 2013
@@ -33,6 +33,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_command()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_command_with_dwarf(self):
         """Test 'watchpoint command'."""
@@ -48,6 +49,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_command_can_disable_a_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_command_can_disable_a_watchpoint_with_dwarf(self):
         """Test that 'watchpoint command' action can disable a watchpoint after it is triggered."""
@@ -101,7 +103,7 @@
                        'new value:', ' = 1'])
 
         # The watchpoint command "forced" our global variable 'cookie' to become 777.
-        self.expect("frame variable -g cookie",
+        self.expect("frame variable --show-globals cookie",
             substrs = ['(int32_t)', 'cookie = 777'])
 
     def watchpoint_command_can_disable_a_watchpoint(self):

Modified: lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py Tue Jan  8 06:51:53 2013
@@ -33,6 +33,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_command()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_command_with_dwarf(self):
         """Test 'watchpoint command'."""
@@ -89,7 +90,7 @@
                        'new value:', ' = 1'])
 
         # The watchpoint command "forced" our global variable 'cookie' to become 777.
-        self.expect("frame variable -g cookie",
+        self.expect("frame variable --show-globals cookie",
             substrs = ['(int32_t)', 'cookie = 777'])
 
 

Modified: lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py Tue Jan  8 06:51:53 2013
@@ -33,6 +33,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_condition()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_cond_with_dwarf(self):
         """Test watchpoint condition."""
@@ -76,7 +77,7 @@
         # The stop reason of the thread should be watchpoint.
         self.expect("thread backtrace", STOPPED_DUE_TO_WATCHPOINT,
             substrs = ['stop reason = watchpoint'])
-        self.expect("frame variable -g global",
+        self.expect("frame variable --show-globals global",
             substrs = ['(int32_t)', 'global = 5'])
 
         # Use the '-v' option to do verbose listing of the watchpoint.

Modified: lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py (original)
+++ lldb/branches/windows/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.watchlocation_using_watchpoint_set()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchlocation_with_dwarf_using_watchpoint_set(self):
         """Test watching a location with 'watchpoint set expression -w write -x size' option."""

Modified: lldb/branches/windows/test/lang/c/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/array_types/TestArrayTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/array_types/TestArrayTypes.py (original)
+++ lldb/branches/windows/test/lang/c/array_types/TestArrayTypes.py Tue Jan  8 06:51:53 2013
@@ -71,7 +71,7 @@
 
         # Issue 'variable list' command on several array-type variables.
 
-        self.expect("frame variable -T strings", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types strings", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(char *[4])',
             substrs = ['(char *) [0]',
                        '(char *) [1]',
@@ -82,14 +82,14 @@
                        'Bonjour',
                        'Guten Tag'])
 
-        self.expect("frame variable -T char_16", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types char_16", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['(char) [0]',
                        '(char) [15]'])
 
-        self.expect("frame variable -T ushort_matrix", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types ushort_matrix", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(unsigned short [2][3])')
 
-        self.expect("frame variable -T long_6", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types long_6", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(long [6])')
 
     def array_types_python(self):

Modified: lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py (original)
+++ lldb/branches/windows/test/lang/c/bitfields/TestBitfields.py Tue Jan  8 06:51:53 2013
@@ -64,7 +64,7 @@
             substrs = [' resolved, hit count = 1'])
 
         # This should display correctly.
-        self.expect("frame variable -T bits", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types bits", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['(uint32_t:1) b1 = 1',
                        '(uint32_t:2) b2 = 3',
                        '(uint32_t:3) b3 = 7',
@@ -76,7 +76,7 @@
 
         # And so should this.
         # rdar://problem/8348251
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['(uint32_t:1) b1 = 1',
                        '(uint32_t:2) b2 = 3',
                        '(uint32_t:3) b3 = 7',
@@ -86,6 +86,39 @@
                        '(uint32_t:7) b7 = 127',
                        '(uint32_t:4) four = 15'])
 
+        self.expect("expr (bits.b1)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '1'])
+        self.expect("expr (bits.b2)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '3'])
+        self.expect("expr (bits.b3)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '7'])
+        self.expect("expr (bits.b4)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '15'])
+        self.expect("expr (bits.b5)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '31'])
+        self.expect("expr (bits.b6)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '63'])
+        self.expect("expr (bits.b7)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '127'])
+        self.expect("expr (bits.four)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '15'])
+
+        self.expect("frame variable --show-types more_bits", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['(uint32_t:3) a = 3',
+                       '(int:1)  = 0',
+                       '(uint8_t:1) b = \'\\0\'',
+                       '(uint8_t:1) c = \'\\x01\'',
+                       '(uint8_t:1) d = \'\\0\''])
+
+        self.expect("expr (more_bits.a)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint32_t', '3'])
+        self.expect("expr (more_bits.b)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint8_t', '\\0'])
+        self.expect("expr (more_bits.c)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint8_t', '\\x01'])
+        self.expect("expr (more_bits.d)", VARIABLES_DISPLAYED_CORRECTLY,
+            substrs = ['uint8_t', '\\0'])
+
     def bitfields_variable_python(self):
         """Use Python APIs to inspect a bitfields variable."""
         exe = os.path.join(os.getcwd(), "a.out")

Modified: lldb/branches/windows/test/lang/c/bitfields/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/bitfields/main.c?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/bitfields/main.c (original)
+++ lldb/branches/windows/test/lang/c/bitfields/main.c Tue Jan  8 06:51:53 2013
@@ -45,6 +45,23 @@
         bits.b7 = i;        //// break $source:$line
     for (i=0; i<(1<<4); i++)
         bits.four = i;      //// break $source:$line
+
+    struct MoreBits
+    {
+        uint32_t    a : 3;
+        uint8_t       : 1;
+        uint8_t     b : 1;
+        uint8_t     c : 1;
+        uint8_t     d : 1;
+    };
+
+    struct MoreBits more_bits;
+
+    more_bits.a = 3;
+    more_bits.b = 0;
+    more_bits.c = 1;
+    more_bits.d = 0;
+
     return 0;               //// Set break point at this line.
 
 }

Modified: lldb/branches/windows/test/lang/c/forward/TestForwardDeclaration.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/forward/TestForwardDeclaration.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/forward/TestForwardDeclaration.py (original)
+++ lldb/branches/windows/test/lang/c/forward/TestForwardDeclaration.py Tue Jan  8 06:51:53 2013
@@ -48,7 +48,7 @@
 
         # This should display correctly.
         # Note that the member fields of a = 1 and b = 2 is by design.
-        self.expect("frame variable -T *bar_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types *bar_ptr", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['(bar) *bar_ptr = ',
                        '(int) a = 1',
                        '(int) b = 2'])

Modified: lldb/branches/windows/test/lang/c/function_types/TestFunctionTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/function_types/TestFunctionTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/function_types/TestFunctionTypes.py (original)
+++ lldb/branches/windows/test/lang/c/function_types/TestFunctionTypes.py Tue Jan  8 06:51:53 2013
@@ -66,7 +66,7 @@
         self.runToBreakpoint()
 
         # Check that the 'callback' variable display properly.
-        self.expect("frame variable -T callback", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types callback", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(int (*)(const char *)) callback =')
 
         # And that we can break on the callback function.

Modified: lldb/branches/windows/test/lang/c/global_variables/TestGlobalVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/global_variables/TestGlobalVariables.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/global_variables/TestGlobalVariables.py (original)
+++ lldb/branches/windows/test/lang/c/global_variables/TestGlobalVariables.py Tue Jan  8 06:51:53 2013
@@ -13,13 +13,13 @@
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dsym_test
     def test_with_dsym(self):
-        """Test 'frame variable -s -a' which omits args and shows scopes."""
+        """Test 'frame variable --scope --no-args' which omits args and shows scopes."""
         self.buildDsym()
         self.global_variables()
 
     @dwarf_test
     def test_with_dwarf(self):
-        """Test 'frame variable -s -a' which omits args and shows scopes."""
+        """Test 'frame variable --scope --no-args' which omits args and shows scopes."""
         self.buildDwarf()
         self.global_variables()
 
@@ -28,9 +28,13 @@
         TestBase.setUp(self)
         # Find the line number to break inside main().
         self.line = line_number('main.c', '// Set break point at this line.')
+        if sys.platform.startswith("linux"):
+            # On Linux, LD_LIBRARY_PATH must be set so the shared libraries are found on startup
+            self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
+            self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath))
 
     def global_variables(self):
-        """Test 'frame variable -s -a' which omits args and shows scopes."""
+        """Test 'frame variable --scope --no-args' which omits args and shows scopes."""
         exe = os.path.join(os.getcwd(), "a.out")
         self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
@@ -49,7 +53,7 @@
             substrs = [' resolved, hit count = 1'])
 
         # Check that GLOBAL scopes are indicated for the variables.
-        self.expect("frame variable -T -s -g -a", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types --scope --show-globals --no-args", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['GLOBAL: (int) g_file_global_int = 42',
                        'GLOBAL: (const char *) g_file_global_cstr',
                        '"g_file_global_cstr"',

Modified: lldb/branches/windows/test/lang/c/set_values/TestSetValues.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/set_values/TestSetValues.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/set_values/TestSetValues.py (original)
+++ lldb/branches/windows/test/lang/c/set_values/TestSetValues.py Tue Jan  8 06:51:53 2013
@@ -61,63 +61,63 @@
             substrs = [' resolved, hit count = 1'])
 
         # main.c:15
-        # Check that 'frame variable -T' displays the correct data type and value.
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        # Check that 'frame variable --show-types' displays the correct data type and value.
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(char) i = 'a'")
 
         # Now set variable 'i' and check that it is correctly displayed.
         self.runCmd("expression i = 'b'")
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(char) i = 'b'")
 
         self.runCmd("continue")
 
         # main.c:36
-        # Check that 'frame variable -T' displays the correct data type and value.
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        # Check that 'frame variable --show-types' displays the correct data type and value.
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             patterns = ["\((short unsigned int|unsigned short)\) i = 33"])
 
         # Now set variable 'i' and check that it is correctly displayed.
         self.runCmd("expression i = 333")
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             patterns = ["\((short unsigned int|unsigned short)\) i = 333"])
 
         self.runCmd("continue")
 
         # main.c:57
-        # Check that 'frame variable -T' displays the correct data type and value.
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        # Check that 'frame variable --show-types' displays the correct data type and value.
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(long) i = 33")
 
         # Now set variable 'i' and check that it is correctly displayed.
         self.runCmd("expression i = 33333")
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(long) i = 33333")
 
         self.runCmd("continue")
 
         # main.c:78
-        # Check that 'frame variable -T' displays the correct data type and value.
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        # Check that 'frame variable --show-types' displays the correct data type and value.
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(double) i = 3.14159")
 
         # Now set variable 'i' and check that it is correctly displayed.
         self.runCmd("expression i = 3.14")
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(double) i = 3.14")
 
         self.runCmd("continue")
 
         # main.c:85
-        # Check that 'frame variable -T' displays the correct data type and value.
+        # Check that 'frame variable --show-types' displays the correct data type and value.
         # rdar://problem/8422727
         # set_values test directory: 'frame variable' shows only (long double) i =
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(long double) i = 3.14159")
 
         # Now set variable 'i' and check that it is correctly displayed.
         self.runCmd("expression i = 3.1")
-        self.expect("frame variable -T", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(long double) i = 3.1")
 
 

Modified: lldb/branches/windows/test/lang/c/shared_lib/TestSharedLib.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/shared_lib/TestSharedLib.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/shared_lib/TestSharedLib.py (original)
+++ lldb/branches/windows/test/lang/c/shared_lib/TestSharedLib.py Tue Jan  8 06:51:53 2013
@@ -39,6 +39,9 @@
         TestBase.setUp(self)
         # Find the line number to break inside main().
         self.line = line_number('main.c', '// Set breakpoint 0 here.')
+        if sys.platform.startswith("linux"):
+            self.runCmd("settings set target.env-vars " + self.dylibPath + "=" + os.getcwd())
+            self.addTearDownHook(lambda: self.runCmd("settings remove target.env-vars " + self.dylibPath))
 
     def common_setup(self):
         exe = os.path.join(os.getcwd(), "a.out")

Modified: lldb/branches/windows/test/lang/c/stepping/TestStepAndBreakpoints.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/stepping/TestStepAndBreakpoints.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/stepping/TestStepAndBreakpoints.py (original)
+++ lldb/branches/windows/test/lang/c/stepping/TestStepAndBreakpoints.py Tue Jan  8 06:51:53 2013
@@ -18,6 +18,7 @@
         self.buildDsym()
         self.step_over_stepping()
 
+    @expectedFailureLinux # bugzilla 14437
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_python_api(self):
@@ -160,6 +161,71 @@
         self.assertTrue (thread.GetFrameAtIndex(0).GetLineEntry().GetLine() == current_line)
         self.assertTrue (thread.GetFrameAtIndex(0).GetLineEntry().GetFileSpec() == current_file)
 
+        # Now we are going to test step in targetting a function:
+
+        break_in_b.SetEnabled (False)
+
+        break_before_complex_1 = target.BreakpointCreateBySourceRegex ('// Stop here to try step in targetting b.', self.main_source_spec)
+        self.assertTrue(break_before_complex_1, VALID_BREAKPOINT)
+
+        break_before_complex_2 = target.BreakpointCreateBySourceRegex ('// Stop here to try step in targetting complex.', self.main_source_spec)
+        self.assertTrue(break_before_complex_2, VALID_BREAKPOINT)
+
+        break_before_complex_3 = target.BreakpointCreateBySourceRegex ('// Stop here to step targetting b and hitting breakpoint.', self.main_source_spec)
+        self.assertTrue(break_before_complex_3, VALID_BREAKPOINT)
+
+        break_before_complex_4 = target.BreakpointCreateBySourceRegex ('// Stop here to make sure bogus target steps over.', self.main_source_spec)
+        self.assertTrue(break_before_complex_4, VALID_BREAKPOINT)
+
+        threads = lldbutil.continue_to_breakpoint(process, break_before_complex_1)
+        self.assertTrue (len(threads) == 1)
+        thread = threads[0]
+        break_before_complex_1.SetEnabled(False)
+
+        thread.StepInto ("b")
+        self.assertTrue (thread.GetFrameAtIndex(0).GetFunctionName() == "b")
+
+        # Now continue out and stop at the next call to complex.  This time step all the way into complex:
+        threads = lldbutil.continue_to_breakpoint (process, break_before_complex_2)
+        self.assertTrue (len(threads) == 1)
+        thread = threads[0]
+        break_before_complex_2.SetEnabled(False)
+
+        thread.StepInto ("complex")
+        self.assertTrue (thread.GetFrameAtIndex(0).GetFunctionName() == "complex")
+        
+        # Now continue out and stop at the next call to complex.  This time enable breakpoints in a and c and then step targetting b:
+        threads = lldbutil.continue_to_breakpoint (process, break_before_complex_3)
+        self.assertTrue (len(threads) == 1)
+        thread = threads[0]
+        break_before_complex_3.SetEnabled(False)
+
+        break_at_start_of_a = target.BreakpointCreateByName ('a')
+        break_at_start_of_c = target.BreakpointCreateByName ('c')
+
+        thread.StepInto ("b")
+        threads = lldbutil.get_stopped_threads(process, lldb.eStopReasonBreakpoint);
+
+        self.assertTrue (len(threads) == 1)
+        thread = threads[0]
+        stop_break_id = thread.GetStopReasonDataAtIndex(0)
+        self.assertTrue(stop_break_id == break_at_start_of_a.GetID() or stop_break_id == break_at_start_of_c.GetID())
+
+        break_at_start_of_a.SetEnabled(False)
+        break_at_start_of_c.SetEnabled(False)
+
+        process.Continue()
+        self.assertTrue (thread.GetFrameAtIndex(0).GetFunctionName() == "b")
+        
+        # Now continue out and stop at the next call to complex.  This time enable breakpoints in a and c and then step targetting b:
+        threads = lldbutil.continue_to_breakpoint (process, break_before_complex_4)
+        self.assertTrue (len(threads) == 1)
+        thread = threads[0]
+        break_before_complex_4.SetEnabled(False)
+
+        thread.StepInto("NoSuchFunction")
+        self.assertTrue (thread.GetFrameAtIndex(0).GetFunctionName() == "main")
+        
 if __name__ == '__main__':
     import atexit
     lldb.SBDebugger.Initialize()

Modified: lldb/branches/windows/test/lang/c/stepping/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/stepping/main.c?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/stepping/main.c (original)
+++ lldb/branches/windows/test/lang/c/stepping/main.c Tue Jan  8 06:51:53 2013
@@ -14,7 +14,7 @@
 
 int a(int val)
 {
-    int return_value = val;
+    int return_value = val;  // basic break at the start of b
 
     if (val <= 1)
     {
@@ -39,6 +39,11 @@
     return val + 3; // Find the line number of function "c" here.
 }
 
+int complex (int first, int second, int third)
+{
+    return first + second + third;  // Step in targetting complex should stop here
+}
+
 int main (int argc, char const *argv[])
 {
     int A1 = a(1); // frame select 2, thread step-out while stopped at "c(1)"
@@ -50,5 +55,13 @@
     int A3 = a(3); // frame select 1, thread step-out while stopped at "c(3)"
     printf("a(3) returns %d\n", A3);
     
+    int A4 = complex (a(1), b(2), c(3)); // Stop here to try step in targetting b.
+
+    int A5 = complex (a(2), b(3), c(4)); // Stop here to try step in targetting complex.
+
+    int A6 = complex (a(4), b(5), c(6)); // Stop here to step targetting b and hitting breakpoint.
+
+    int A7 = complex (a(5), b(6), c(7)); // Stop here to make sure bogus target steps over.
+
     return 0;
 }

Modified: lldb/branches/windows/test/lang/c/strings/TestCStrings.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/strings/TestCStrings.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/strings/TestCStrings.py (original)
+++ lldb/branches/windows/test/lang/c/strings/TestCStrings.py Tue Jan  8 06:51:53 2013
@@ -16,6 +16,7 @@
         self.buildDsym()
         self.static_method_commands()
 
+    @expectedFailureLinux # bugzilla 14437
     @dwarf_test
     def test_with_dwarf_and_run_command(self):
         """Tests that C strings work as expected in expressions"""

Modified: lldb/branches/windows/test/lang/c/struct_types/TestStructTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/struct_types/TestStructTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/struct_types/TestStructTypes.py (original)
+++ lldb/branches/windows/test/lang/c/struct_types/TestStructTypes.py Tue Jan  8 06:51:53 2013
@@ -14,6 +14,8 @@
 
     mydir = os.path.join("lang", "c", "struct_types")
 
+    # rdar://problem/12566646
+    @unittest2.expectedFailure
     @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dsym_test
     def test_with_dsym(self):
@@ -21,6 +23,8 @@
         self.buildDsym()
         self.struct_types()
 
+    # rdar://problem/12566646
+    @unittest2.expectedFailure
     @dwarf_test
     def test_with_dwarf(self):
         """Test that break on a struct declaration has no effect."""
@@ -31,19 +35,31 @@
         # Call super's setUp().
         TestBase.setUp(self)
         # Find the line number to break for main.c.
-        self.line = line_number('main.c', '// Set break point at this line.')
-        self.first_executable_line = line_number('main.c',
+        self.source = 'main.c'
+        self.line = line_number(self.source, '// Set break point at this line.')
+        self.first_executable_line = line_number(self.source,
                                                  '// This is the first executable statement.')
+        self.return_line = line_number(self.source, '// This is the return statement.')
 
     def struct_types(self):
-        """Test that break on a struct declaration has no effect."""
+        """Test that break on a struct declaration has no effect and test structure access for zero sized arrays."""
         exe = os.path.join(os.getcwd(), "a.out")
-        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+        # Create a target by the debugger.
+        target = self.dbg.CreateTarget(exe)
+        self.assertTrue(target, VALID_TARGET)
 
         # Break on the struct declration statement in main.c.
         lldbutil.run_break_set_by_file_and_line (self, "main.c", self.line, num_expected_locations=1, loc_exact=False)
+        lldbutil.run_break_set_by_file_and_line (self, "main.c", self.return_line, num_expected_locations=1, loc_exact=True)
+
+        # Now launch the process, and do not stop at entry point.
+        process = target.LaunchSimple(None, None, os.getcwd())
 
-        self.runCmd("run", RUN_SUCCEEDED)
+        if not process:
+            self.fail("SBTarget.Launch() failed")
+
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
 
         # We should be stopped on the first executable statement within the
         # function where the original breakpoint was attempted.
@@ -55,10 +71,26 @@
         self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
             substrs = [' resolved, hit count = 1'])
 
+        process.Continue()
+        thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint)
+
+        # Test zero length array access and make sure it succeeds with "frame variable"
+        self.expect("frame variable pt.padding[0]",
+            DATA_TYPES_DISPLAYED_CORRECTLY,
+            substrs = ["pt.padding[0] = '"])
+        self.expect("frame variable pt.padding[1]",
+            DATA_TYPES_DISPLAYED_CORRECTLY,
+            substrs = ["pt.padding[1] = '"])
+        # Test zero length array access and make sure it succeeds with "expression"
+        self.expect("expression -- (pt.padding[0])",
+            DATA_TYPES_DISPLAYED_CORRECTLY,
+            substrs = ["(char)", " = '"])
+
         # The padding should be an array of size 0
         self.expect("image lookup -t point_tag",
             DATA_TYPES_DISPLAYED_CORRECTLY,
-            substrs = ['padding[0]'])
+            substrs = ['padding[]']) # Once rdar://problem/12566646 is fixed, this should display correctly
+
 
 
 if __name__ == '__main__':

Modified: lldb/branches/windows/test/lang/c/struct_types/main.c
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/c/struct_types/main.c?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/c/struct_types/main.c (original)
+++ lldb/branches/windows/test/lang/c/struct_types/main.c Tue Jan  8 06:51:53 2013
@@ -20,5 +20,5 @@
     };
     struct point_tag pt = { 2, 3, {} }; // This is the first executable statement.
     struct rect_tag rect = {{1, 2, {}}, {3, 4, {}}};
-    return 0;
+    return 0; // This is the return statement.
 }

Modified: lldb/branches/windows/test/lang/cpp/class_types/TestClassTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/cpp/class_types/TestClassTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/cpp/class_types/TestClassTypes.py (original)
+++ lldb/branches/windows/test/lang/cpp/class_types/TestClassTypes.py Tue Jan  8 06:51:53 2013
@@ -92,7 +92,7 @@
             substrs = [' resolved, hit count = 1'])
 
         # We should be stopped on the ctor function of class C.
-        self.expect("frame variable -T this", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types this", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['C *',
                        ' this = '])
 
@@ -188,10 +188,10 @@
         self.expect("frame variable this",VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ['C *'])
 
-        # Verify that frame variable -T this->m_c_int behaves correctly.
+        # Verify that frame variable --show-types this->m_c_int behaves correctly.
         self.runCmd("register read pc")
         self.runCmd("expr m_c_int")
-        self.expect("frame variable -T this->m_c_int", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types this->m_c_int", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = '(int) this->m_c_int = 66')
 
         # Verify that 'expression this' gets the data type correct.

Modified: lldb/branches/windows/test/lang/cpp/class_types/TestClassTypesDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/cpp/class_types/TestClassTypesDisassembly.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/cpp/class_types/TestClassTypesDisassembly.py (original)
+++ lldb/branches/windows/test/lang/cpp/class_types/TestClassTypesDisassembly.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.disassemble_call_stack()
 
     @dwarf_test
+    @expectedFailureLinux # due to bugzilla 14540
     def test_with_dwarf_and_run_command(self):
         """Disassemble each call frame when stopped on C's constructor."""
         self.buildDwarf()
@@ -35,6 +36,7 @@
 
     @python_api_test
     @dwarf_test
+    @expectedFailureLinux # due to bugzilla 14540
     def test_with_dwarf_and_python_api(self):
         """Disassemble each call frame when stopped on C's constructor."""
         self.buildDwarf()

Modified: lldb/branches/windows/test/lang/cpp/namespace/TestNamespace.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/cpp/namespace/TestNamespace.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/cpp/namespace/TestNamespace.py (original)
+++ lldb/branches/windows/test/lang/cpp/namespace/TestNamespace.py Tue Jan  8 06:51:53 2013
@@ -66,12 +66,12 @@
             substrs = slist)
 
         # 'frame variable' with basename 'i' should work.
-        self.expect("frame variable -c -g i",
+        self.expect("frame variable --show-declaration --show-globals i",
             startstr = "main.cpp:%d: (int) (anonymous namespace)::i = 3" % self.line_var_i)
         # main.cpp:12: (int) (anonymous namespace)::i = 3
 
         # 'frame variable' with basename 'j' should work, too.
-        self.expect("frame variable -c -g j",
+        self.expect("frame variable --show-declaration --show-globals j",
             startstr = "main.cpp:%d: (int) A::B::j = 4" % self.line_var_j)
         # main.cpp:19: (int) A::B::j = 4
 

Modified: lldb/branches/windows/test/lang/cpp/signed_types/TestSignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/cpp/signed_types/TestSignedTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/cpp/signed_types/TestSignedTypes.py (original)
+++ lldb/branches/windows/test/lang/cpp/signed_types/TestSignedTypes.py Tue Jan  8 06:51:53 2013
@@ -54,7 +54,7 @@
         self.runCmd("thread step-over")
 
         # Test that signed types display correctly.
-        self.expect("frame variable -T -a", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types --no-args", VARIABLES_DISPLAYED_CORRECTLY,
             patterns = ["\((short int|short)\) the_signed_short = 99"],
             substrs = ["(signed char) the_signed_char = 'c'",
                        "(int) the_signed_int = 99",

Modified: lldb/branches/windows/test/lang/cpp/unique-types/TestUniqueTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/cpp/unique-types/TestUniqueTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/cpp/unique-types/TestUniqueTypes.py (original)
+++ lldb/branches/windows/test/lang/cpp/unique-types/TestUniqueTypes.py Tue Jan  8 06:51:53 2013
@@ -58,8 +58,8 @@
                     if clang_version < 3:
                         self.skipTest("rdar://problem/9173060 lldb hangs while running unique-types for clang version < 3")
 
-        # Do a "frame variable -T longs" and verify "long" is in each line of output.
-        self.runCmd("frame variable -T longs")
+        # Do a "frame variable --show-types longs" and verify "long" is in each line of output.
+        self.runCmd("frame variable --show-types longs")
         output = self.res.GetOutput()
         for x in [line.strip() for line in output.split(os.linesep)]:
             # Skip empty line or closing brace.
@@ -68,8 +68,8 @@
             self.expect(x, "Expect type 'long'", exe=False,
                 substrs = ['long'])
 
-        # Do a "frame variable -T shorts" and verify "short" is in each line of output.
-        self.runCmd("frame variable -T shorts")
+        # Do a "frame variable --show-types shorts" and verify "short" is in each line of output.
+        self.runCmd("frame variable --show-types shorts")
         output = self.res.GetOutput()
         for x in [line.strip() for line in output.split(os.linesep)]:
             # Skip empty line or closing brace.

Modified: lldb/branches/windows/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/cpp/unsigned_types/TestUnsignedTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/cpp/unsigned_types/TestUnsignedTypes.py (original)
+++ lldb/branches/windows/test/lang/cpp/unsigned_types/TestUnsignedTypes.py Tue Jan  8 06:51:53 2013
@@ -51,7 +51,7 @@
             substrs = [' resolved, hit count = 1'])
 
         # Test that unsigned types display correctly.
-        self.expect("frame variable -T -a", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types --no-args", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(unsigned char) the_unsigned_char = 'c'",
             patterns = ["\((short unsigned int|unsigned short)\) the_unsigned_short = 99"],
             substrs = ["(unsigned int) the_unsigned_int = 99",

Modified: lldb/branches/windows/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/blocks/TestObjCIvarsInBlocks.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/blocks/TestObjCIvarsInBlocks.py (original)
+++ lldb/branches/windows/test/lang/objc/blocks/TestObjCIvarsInBlocks.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.buildDsym()
         self.ivars_in_blocks()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     # This test requires the 2.0 runtime, so it will fail on i386.
     @expectedFailurei386

Modified: lldb/branches/windows/test/lang/objc/foundation/TestFoundationDisassembly.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/foundation/TestFoundationDisassembly.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/foundation/TestFoundationDisassembly.py (original)
+++ lldb/branches/windows/test/lang/objc/foundation/TestFoundationDisassembly.py Tue Jan  8 06:51:53 2013
@@ -81,7 +81,7 @@
         lldbutil.run_break_set_by_symbol (self, '-[MyString initWithNSString:]', num_expected_locations=1, sym_exact=True)
 
         # Stop at the "description" selector.
-        lldbutil.run_break_set_by_selector (self, 'description', num_expected_locations=1)
+        lldbutil.run_break_set_by_selector (self, 'description', num_expected_locations=1, module_name='a.out')
 
         # Stop at -[NSAutoreleasePool release].
         break_results = lldbutil.run_break_set_command (self, "_regexp-break -[NSAutoreleasePool release]")

Modified: lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods.py (original)
+++ lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods.py Tue Jan  8 06:51:53 2013
@@ -69,7 +69,7 @@
         lldbutil.run_break_set_by_symbol (self, '-[MyString initWithNSString:]', num_expected_locations=1, sym_exact=True)
 
         # Stop at the "description" selector.
-        lldbutil.run_break_set_by_selector (self, 'description', num_expected_locations=1)
+        lldbutil.run_break_set_by_selector (self, 'description', num_expected_locations=1, module_name='a.out')
 
         # Stop at -[NSAutoreleasePool release].
         break_results = lldbutil.run_break_set_command(self, "_regexp-break -[NSAutoreleasePool release]")
@@ -146,7 +146,7 @@
                        'NSString * str;',
                        'NSDate * date;'])
 
-        self.expect("frame variable -T -s", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types --scope", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["ARG: (MyString *) self"],
             patterns = ["ARG: \(.*\) _cmd",
                         "(objc_selector *)|(SEL)"])
@@ -158,16 +158,16 @@
         # rdar://problem/8492646
         # test/foundation fails after updating to tot r115023
         # self->str displays nothing as output
-        self.expect("frame variable -T self->str", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types self->str", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(NSString *) self->str")
 
         # rdar://problem/8447030
         # 'frame variable self->date' displays the wrong data member
-        self.expect("frame variable -T self->date", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types self->date", VARIABLES_DISPLAYED_CORRECTLY,
             startstr = "(NSDate *) self->date")
 
         # This should display the str and date member fields as well.
-        self.expect("frame variable -T *self", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("frame variable --show-types *self", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["(MyString) *self",
                        "(NSString *) str",
                        "(NSDate *) date"])
@@ -204,7 +204,7 @@
         #
         # Test new feature with r115115:
         # Add "-o" option to "expression" which prints the object description if available.
-        self.expect("expression -o -- my", "Object description displayed correctly",
+        self.expect("expression --object-description -- my", "Object description displayed correctly",
             patterns = ["Hello from.*a.out.*with timestamp: "])
 
     # See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets

Modified: lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods2.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods2.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods2.py (original)
+++ lldb/branches/windows/test/lang/objc/foundation/TestObjCMethods2.py Tue Jan  8 06:51:53 2013
@@ -230,7 +230,7 @@
 
         self.runCmd("run", RUN_SUCCEEDED)
 
-        self.expect("p [NSError errorWithDomain:@\"Hello\" code:35 userInfo:nil]",
+        self.expect("p [NSError thisMethodIsntImplemented:0]",
                     error = True, 
                     patterns = ["no known method", "cast the message send to the method's return type"])
         self.runCmd("process continue")

Modified: lldb/branches/windows/test/lang/objc/foundation/TestObjectDescriptionAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/foundation/TestObjectDescriptionAPI.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/foundation/TestObjectDescriptionAPI.py (original)
+++ lldb/branches/windows/test/lang/objc/foundation/TestObjectDescriptionAPI.py Tue Jan  8 06:51:53 2013
@@ -24,6 +24,7 @@
         self.find_global_variables_then_object_description('a.out')
 
     # rdar://problem/10857337
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_find_global_variables_then_object_description_with_dwarf(self):

Modified: lldb/branches/windows/test/lang/objc/objc++/TestObjCXX.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc%2B%2B/TestObjCXX.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc++/TestObjCXX.py (original)
+++ lldb/branches/windows/test/lang/objc/objc++/TestObjCXX.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.buildDsym()
         self.do_testObjCXXClasses()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dwarf_test
     def test_break_with_dwarf(self):
         """Test ivars of Objective-C++ classes"""

Modified: lldb/branches/windows/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py Tue Jan  8 06:51:53 2013
@@ -62,7 +62,7 @@
 
         self.expect("expr (foo)", patterns = ["\(ns::id\) \$.* = 0"])
 
-        self.expect("expr id my_id = 0; my_id", patterns = ["\(id\) \$.* = 0x0"])
+        self.expect("expr id my_id = 0; my_id", patterns = ["\(id\) \$.* = nil"])
 
 if __name__ == '__main__':
     import atexit

Modified: lldb/branches/windows/test/lang/objc/objc-checker/TestObjCCheckers.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-checker/TestObjCCheckers.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-checker/TestObjCCheckers.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-checker/TestObjCCheckers.py Tue Jan  8 06:51:53 2013
@@ -22,6 +22,7 @@
         self.buildDsym()
         self.do_test_checkers()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_objc_checker_with_dwarf(self):

Modified: lldb/branches/windows/test/lang/objc/objc-class-method/TestObjCClassMethod.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-class-method/TestObjCClassMethod.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-class-method/TestObjCClassMethod.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-class-method/TestObjCClassMethod.py Tue Jan  8 06:51:53 2013
@@ -20,6 +20,7 @@
         self.buildDsym()
         self.objc_class_method()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @expectedFailurei386
     @python_api_test
     @dwarf_test

Modified: lldb/branches/windows/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py Tue Jan  8 06:51:53 2013
@@ -23,6 +23,7 @@
         self.buildDsym()
         self.do_get_dynamic_vals()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_get_objc_dynamic_vals_with_dwarf(self):

Modified: lldb/branches/windows/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py Tue Jan  8 06:51:53 2013
@@ -18,6 +18,7 @@
         self.buildDsym()
         self.objc_ivar_offsets()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_python_api(self):

Modified: lldb/branches/windows/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py Tue Jan  8 06:51:53 2013
@@ -64,62 +64,62 @@
 
         self.common_setup()
 
-        self.expect("expr -o -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- immutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["foo"])
 
-        self.expect("expr -o -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["foo"])
 
-        self.expect("expr -o -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- mutable_array[0] = @\"bar\"", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["bar"])
 
-        self.expect("expr -o -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- mutable_array[0]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["bar"])
 
-        self.expect("expr -o -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- immutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["value"])
 
-        self.expect("expr -o -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["value"])
 
-        self.expect("expr -o -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- mutable_dictionary[@\"key\"] = @\"object\"", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["object"])
 
-        self.expect("expr -o -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- mutable_dictionary[@\"key\"]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["object"])
 
-        self.expect("expr -o -- @[ @\"foo\", @\"bar\" ]", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @[ @\"foo\", @\"bar\" ]", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSArray", "foo", "bar"])
 
-        self.expect("expr -o -- @{ @\"key\" : @\"object\" }", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @{ @\"key\" : @\"object\" }", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSDictionary", "key", "object"])
 
-        self.expect("expr -o -- @'a'", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @'a'", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", str(ord('a'))])
 
-        self.expect("expr -o -- @1", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @1", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "1"])
 
-        self.expect("expr -o -- @1l", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @1l", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "1"])
 
-        self.expect("expr -o -- @1ul", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @1ul", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "1"])
 
-        self.expect("expr -o -- @1ll", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @1ll", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "1"])
 
-        self.expect("expr -o -- @1ull", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @1ull", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "1"])
 
-        self.expect("expr -o -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @123.45", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "123.45"])
-        self.expect("expr -o -- @123.45f", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @123.45f", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "123.45"])
 
-        self.expect("expr -o -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @( 1 + 3 )", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSNumber", "4"])
-        self.expect("expr -o -- @(\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,
+        self.expect("expr --object-description -- @(\"Hello world\" + 6)", VARIABLES_DISPLAYED_CORRECTLY,
             substrs = ["NSString", "world"])
 
             

Modified: lldb/branches/windows/test/lang/objc/objc-optimized/TestObjcOptimized.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-optimized/TestObjcOptimized.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-optimized/TestObjcOptimized.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-optimized/TestObjcOptimized.py Tue Jan  8 06:51:53 2013
@@ -12,6 +12,7 @@
 import lldb
 from lldbtest import *
 import lldbutil
+import re
 
 # rdar://problem/9087739
 # test failure: objc_optimized does not work for "-C clang -A i386"
@@ -50,8 +51,21 @@
         self.expect('expression member',
             startstr = "(int) $0 = 5")
 
-        self.expect('expression self',
-            startstr = "(%s *) $1 = " % self.myclass)
+        # <rdar://problem/12693963>
+        interp = self.dbg.GetCommandInterpreter()
+        result = lldb.SBCommandReturnObject()
+        interp.HandleCommand('frame variable self', result)
+        output = result.GetOutput()
+
+        desired_pointer = "0x0"
+
+        mo = re.search("0x[0-9a-f]+", output)
+
+        if mo:
+            desired_pointer = mo.group(0)
+
+        self.expect('expression (self)',
+            substrs = [("(%s *) $1 = " % self.myclass), desired_pointer])
 
         self.expect('expression self->non_member', error=True,
             substrs = ["does not have a member named 'non_member'"])

Modified: lldb/branches/windows/test/lang/objc/objc-property/TestObjCProperty.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-property/TestObjCProperty.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-property/TestObjCProperty.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-property/TestObjCProperty.py Tue Jan  8 06:51:53 2013
@@ -22,6 +22,7 @@
         self.buildDsym()
         self.do_test_properties()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_objc_properties_with_dwarf(self):
@@ -123,6 +124,11 @@
         unbacked_value = frame.EvaluateExpression("mine.unbackedInt", False)
         unbacked_error = unbacked_value.GetError()
         self.assertTrue (unbacked_error.Success())
+
+        idWithProtocol_value = frame.EvaluateExpression("mine.idWithProtocol", False)
+        idWithProtocol_error = idWithProtocol_value.GetError()
+        self.assertTrue (idWithProtocol_error.Success())
+        self.assertTrue (idWithProtocol_value.GetTypeName() == "id")
         
 if __name__ == '__main__':
     import atexit

Modified: lldb/branches/windows/test/lang/objc/objc-property/main.m
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-property/main.m?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-property/main.m (original)
+++ lldb/branches/windows/test/lang/objc/objc-property/main.m Tue Jan  8 06:51:53 2013
@@ -1,5 +1,11 @@
 #import <Foundation/Foundation.h>
 
+ at protocol MyProtocol
+
+-(const char *)hello;
+
+ at end
+
 @interface BaseClass : NSObject
 {
   int _backedInt;
@@ -18,6 +24,7 @@
 
 @property(getter=myGetUnbackedInt,setter=mySetUnbackedInt:) int unbackedInt;
 @property int backedInt;
+ at property (nonatomic, assign) id <MyProtocol> idWithProtocol;
 @end
 
 @implementation BaseClass
@@ -79,6 +86,8 @@
 
   int unbackedInt = mine.unbackedInt;
 
+  id idWithProtocol = mine.idWithProtocol;
+
   NSLog (@"Results for %p: nonexistant: %d backed: %d unbacked: %d accessCount: %d.",
          mine,
          nonexistant,

Modified: lldb/branches/windows/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-static-method/TestObjCStaticMethod.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-static-method/TestObjCStaticMethod.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-static-method/TestObjCStaticMethod.py Tue Jan  8 06:51:53 2013
@@ -19,6 +19,7 @@
         self.buildDsym()
         self.objc_static_method()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     #<rdar://problem/9745789> "expression" can't call functions in class methods
     @dwarf_test

Modified: lldb/branches/windows/test/lang/objc/objc-stepping/TestObjCStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/objc-stepping/TestObjCStepping.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/objc-stepping/TestObjCStepping.py (original)
+++ lldb/branches/windows/test/lang/objc/objc-stepping/TestObjCStepping.py Tue Jan  8 06:51:53 2013
@@ -18,6 +18,7 @@
         self.buildDsym()
         self.objc_stepping()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_python_api(self):

Modified: lldb/branches/windows/test/lang/objc/rdar-11355592/TestRdar11355592.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/rdar-11355592/TestRdar11355592.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/rdar-11355592/TestRdar11355592.py (original)
+++ lldb/branches/windows/test/lang/objc/rdar-11355592/TestRdar11355592.py Tue Jan  8 06:51:53 2013
@@ -48,13 +48,13 @@
         self.runCmd("run", RUN_SUCCEEDED)
         # check that we correctly see the const char*, even with dynamic types on
         self.expect("frame variable my_string", substrs = ['const char *'])
-        self.expect("frame variable my_string -d run-target", substrs = ['const char *'])
+        self.expect("frame variable my_string --dynamic-type run-target", substrs = ['const char *'])
         # check that expr also gets it right
         self.expect("expr my_string", substrs = ['const char *'])
         self.expect("expr -d true -- my_string", substrs = ['const char *'])
         # but check that we get the real Foolie as such
         self.expect("frame variable my_foolie", substrs = ['FoolMeOnce *'])
-        self.expect("frame variable my_foolie -d run-target", substrs = ['FoolMeOnce *'])
+        self.expect("frame variable my_foolie --dynamic-type run-target", substrs = ['FoolMeOnce *'])
         # check that expr also gets it right
         self.expect("expr my_foolie", substrs = ['FoolMeOnce *'])
         self.expect("expr -d true -- my_foolie", substrs = ['FoolMeOnce *'])
@@ -62,13 +62,13 @@
         self.runCmd("next")
         # check that we correctly see the const char*, even with dynamic types on
         self.expect("frame variable my_string", substrs = ['const char *'])
-        self.expect("frame variable my_string -d run-target", substrs = ['const char *'])
+        self.expect("frame variable my_string --dynamic-type run-target", substrs = ['const char *'])
         # check that expr also gets it right
         self.expect("expr my_string", substrs = ['const char *'])
         self.expect("expr -d true -- my_string", substrs = ['const char *'])
         # but check that we get the real Foolie as such
         self.expect("frame variable my_foolie", substrs = ['FoolMeOnce *'])
-        self.expect("frame variable my_foolie -d run-target", substrs = ['FoolMeOnce *'])
+        self.expect("frame variable my_foolie --dynamic-type run-target", substrs = ['FoolMeOnce *'])
         # check that expr also gets it right
         self.expect("expr my_foolie", substrs = ['FoolMeOnce *'])
         self.expect("expr -d true -- my_foolie", substrs = ['FoolMeOnce *'])

Modified: lldb/branches/windows/test/lang/objc/self/TestObjCSelf.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lang/objc/self/TestObjCSelf.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lang/objc/self/TestObjCSelf.py (original)
+++ lldb/branches/windows/test/lang/objc/self/TestObjCSelf.py Tue Jan  8 06:51:53 2013
@@ -16,6 +16,7 @@
         self.buildDsym()
         self.self_commands()
 
+    @unittest2.skipUnless(sys.platform.startswith("darwin"), "requires Darwin")
     @dwarf_test
     def test_with_dwarf_and_run_command(self):
         """Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""

Modified: lldb/branches/windows/test/lldbtest.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lldbtest.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lldbtest.py (original)
+++ lldb/branches/windows/test/lldbtest.py Tue Jan  8 06:51:53 2013
@@ -410,6 +410,42 @@
             raise case._UnexpectedSuccess
     return wrapper
 
+def expectedFailureLinux(func):
+    """Decorate the item as a Linux only expectedFailure."""
+    if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+        raise Exception("@expectedFailureLinux can only be used to decorate a test method")
+    @wraps(func)
+    def wrapper(*args, **kwargs):
+        from unittest2 import case
+        self = args[0]
+        platform = sys.platform
+        try:
+            func(*args, **kwargs)
+        except Exception:
+            if "linux" in platform:
+                raise case._ExpectedFailure(sys.exc_info())
+            else:
+                raise
+
+        if "linux" in platform:
+            raise case._UnexpectedSuccess
+    return wrapper
+
+def skipOnLinux(func):
+    """Decorate the item to skip tests that should be skipped on Linux."""
+    if isinstance(func, type) and issubclass(func, unittest2.TestCase):
+        raise Exception("@skipOnLinux can only be used to decorate a test method")
+    @wraps(func)
+    def wrapper(*args, **kwargs):
+        from unittest2 import case
+        self = args[0]
+        platform = sys.platform
+        if "linux" in platform:
+            self.skipTest("skip on linux")
+        else:
+            func(*args, **kwargs)
+    return wrapper
+
 class Base(unittest2.TestCase):
     """
     Abstract base for performing lldb (see TestBase) or other generic tests (see
@@ -585,6 +621,12 @@
         # See HideStdout(self).
         self.sys_stdout_hidden = False
 
+        # set environment variable names for finding shared libraries
+        if sys.platform.startswith("darwin"):
+            self.dylibPath = 'DYLD_LIBRARY_PATH'
+        elif sys.platform.startswith("linux") or sys.platform.startswith("freebsd"):
+            self.dylibPath = 'LD_LIBRARY_PATH'
+
     def runHooks(self, child=None, child_prompt=None, use_cmd_api=False):
         """Perform the run hooks to bring lldb debugger to the desired state.
 

Modified: lldb/branches/windows/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/lldbutil.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/lldbutil.py (original)
+++ lldb/branches/windows/test/lldbutil.py Tue Jan  8 06:51:53 2013
@@ -275,6 +275,9 @@
     else:
         command = 'breakpoint set -f "%s" -l %d'%(file_name, line_number)
 
+    if module_name:
+        command += " --shlib '%s'" % (module_name)
+
     if extra_options:
         command += " " + extra_options
 
@@ -292,6 +295,10 @@
 
     If sym_exact is true, then the output symbol must match the input exactly, otherwise we do a substring match."""
     command = 'breakpoint set -n "%s"'%(symbol)
+
+    if module_name:
+        command += " --shlib '%s'" % (module_name)
+
     if extra_options:
         command += " " + extra_options
 
@@ -307,7 +314,11 @@
 def run_break_set_by_selector (test, selector, extra_options = None, num_expected_locations = -1, module_name=None):
     """Set a breakpoint by selector.  Common options are the same as run_break_set_by_file_and_line."""
 
-    command = 'breakpoint set -S "%s"'%(selector)
+    command = 'breakpoint set -S "%s"' % (selector)
+
+    if module_name:
+        command += ' --shlib "%s"' % (module_name)
+
     if extra_options:
         command += " " + extra_options
 

Modified: lldb/branches/windows/test/logging/TestLogging.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/logging/TestLogging.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/logging/TestLogging.py (original)
+++ lldb/branches/windows/test/logging/TestLogging.py Tue Jan  8 06:51:53 2013
@@ -28,13 +28,13 @@
                     patterns = [ "Current executable set to .*a.out" ])
 
         log_file = os.path.join (os.getcwd(), "lldb-commands-log-%s-%s-%s.txt" % (type,
-                                                                                  self.getCompiler(),
+                                                                                  os.path.basename(self.getCompiler()),
                                                                                   self.getArchitecture()))
 
         if (os.path.exists (log_file)):
             os.remove (log_file)
 
-        self.runCmd ("log enable lldb commands -f " + log_file)
+        self.runCmd ("log enable -f '%s' lldb commands" % (log_file))
         
         self.runCmd ("command alias bp breakpoint")
                      

Modified: lldb/branches/windows/test/python_api/event/TestEvents.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/event/TestEvents.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/event/TestEvents.py (original)
+++ lldb/branches/windows/test/python_api/event/TestEvents.py Tue Jan  8 06:51:53 2013
@@ -20,7 +20,6 @@
         self.buildDsym()
         self.do_listen_for_and_print_event()
 
-    @unittest2.skipIf(sys.platform.startswith("linux"), "Hanging on Linux: bugzilla #14384")
     @python_api_test
     @dwarf_test
     def test_listen_for_and_print_event_with_dwarf(self):
@@ -36,7 +35,6 @@
         self.buildDsym()
         self.do_wait_for_event()
 
-    @unittest2.skipIf(sys.platform.startswith("linux"), "Hanging on Linux: bugzilla #14384")
     @python_api_test
     @dwarf_test
     def test_wait_for_event_with_dwarf(self):

Modified: lldb/branches/windows/test/python_api/hello_world/TestHelloWorld.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/hello_world/TestHelloWorld.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/hello_world/TestHelloWorld.py (original)
+++ lldb/branches/windows/test/python_api/hello_world/TestHelloWorld.py Tue Jan  8 06:51:53 2013
@@ -67,6 +67,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.hello_world_attach_with_name_api()
 
+    @expectedFailureLinux # due to bugzilla 14541
     @python_api_test
     @dwarf_test
     def test_with_dwarf_and_attach_to_process_with_name_api(self):

Modified: lldb/branches/windows/test/python_api/lldbutil/iter/TestLLDBIterator.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/lldbutil/iter/TestLLDBIterator.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/lldbutil/iter/TestLLDBIterator.py (original)
+++ lldb/branches/windows/test/python_api/lldbutil/iter/TestLLDBIterator.py Tue Jan  8 06:51:53 2013
@@ -31,6 +31,7 @@
         self.buildDefault()
         self.lldb_iter_breakpoint()
 
+    @expectedFailureLinux # bugzilla 14323
     @python_api_test
     def test_lldb_iter_frame(self):
         """Test iterator works correctly for SBProcess->SBThread->SBFrame."""

Modified: lldb/branches/windows/test/python_api/lldbutil/process/TestPrintStackTraces.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/lldbutil/process/TestPrintStackTraces.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/lldbutil/process/TestPrintStackTraces.py (original)
+++ lldb/branches/windows/test/python_api/lldbutil/process/TestPrintStackTraces.py Tue Jan  8 06:51:53 2013
@@ -18,6 +18,7 @@
         # Find the line number to break inside main().
         self.line = line_number('main.cpp', '// Set break point at this line.')
 
+    @expectedFailureLinux # bugzilla 14323
     @python_api_test
     def test_stack_traces(self):
         """Test SBprocess and SBThread APIs with printing of the stack traces."""

Modified: lldb/branches/windows/test/python_api/thread/TestThreadAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/thread/TestThreadAPI.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/thread/TestThreadAPI.py (original)
+++ lldb/branches/windows/test/python_api/thread/TestThreadAPI.py Tue Jan  8 06:51:53 2013
@@ -74,6 +74,7 @@
         self.setTearDownCleanup(dictionary=d)
         self.step_out_of_malloc_into_function_b(self.exe_name)
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_step_out_of_malloc_into_function_b_with_dwarf(self):

Modified: lldb/branches/windows/test/python_api/type/TestTypeList.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/type/TestTypeList.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/type/TestTypeList.py (original)
+++ lldb/branches/windows/test/python_api/type/TestTypeList.py Tue Jan  8 06:51:53 2013
@@ -66,7 +66,7 @@
         type_list = target.FindTypes('Task')
         if self.TraceOn():
             print "Size of type_list from target.FindTypes('Task') query: %d" % type_list.GetSize()
-        self.assertTrue(len(type_list) == 1)
+        self.assertTrue(len(type_list) >= 1) # a second Task make be scared up by the Objective-C runtime
         for type in type_list:
             self.assertTrue(type)
             self.DebugSBType(type)

Modified: lldb/branches/windows/test/python_api/watchpoint/TestSetWatchpoint.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/TestSetWatchpoint.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/TestSetWatchpoint.py (original)
+++ lldb/branches/windows/test/python_api/watchpoint/TestSetWatchpoint.py Tue Jan  8 06:51:53 2013
@@ -28,6 +28,7 @@
         self.buildDsym()
         self.do_set_watchpoint()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_val_with_dwarf(self):

Modified: lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIgnoreCount.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIgnoreCount.py (original)
+++ lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIgnoreCount.py Tue Jan  8 06:51:53 2013
@@ -28,6 +28,7 @@
         self.buildDsym()
         self.do_watchpoint_ignore_count()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_set_watch_ignore_count_with_dwarf(self):

Modified: lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIter.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIter.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIter.py (original)
+++ lldb/branches/windows/test/python_api/watchpoint/TestWatchpointIter.py Tue Jan  8 06:51:53 2013
@@ -28,6 +28,7 @@
         self.buildDsym()
         self.do_watchpoint_iter()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_iter_with_dwarf(self):

Modified: lldb/branches/windows/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py (original)
+++ lldb/branches/windows/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py Tue Jan  8 06:51:53 2013
@@ -33,6 +33,7 @@
         self.setTearDownCleanup(dictionary=self.d)
         self.watchpoint_condition_api()
 
+    @expectedFailureLinux # bugzilla 14416
     @dwarf_test
     def test_watchpoint_cond_api_with_dwarf(self):
         """Test watchpoint condition API."""

Modified: lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py (original)
+++ lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py Tue Jan  8 06:51:53 2013
@@ -30,6 +30,7 @@
         self.buildDsym()
         self.do_set_watchlocation()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_location_with_dwarf(self):

Modified: lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py (original)
+++ lldb/branches/windows/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py Tue Jan  8 06:51:53 2013
@@ -30,6 +30,7 @@
         self.buildDsym()
         self.do_set_watchaddress()
 
+    @expectedFailureLinux # bugzilla 14416
     @python_api_test
     @dwarf_test
     def test_watch_address_with_dwarf(self):

Modified: lldb/branches/windows/test/types/AbstractBase.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/types/AbstractBase.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/types/AbstractBase.py (original)
+++ lldb/branches/windows/test/types/AbstractBase.py Tue Jan  8 06:51:53 2013
@@ -10,7 +10,7 @@
 
 def Msg(var, val, using_frame_variable):
     return "'%s %s' matches the output (from compiled code): %s" % (
-        'frame variable -T' if using_frame_variable else 'expression' ,var, val)
+        'frame variable --show-types' if using_frame_variable else 'expression' ,var, val)
 
 class GenericTester(TestBase):
 
@@ -116,7 +116,7 @@
             lambda: self.runCmd("settings set target.inline-breakpoint-strategy headers"))
 
         # Bring the program to the point where we can issue a series of
-        # 'frame variable -T' command.
+        # 'frame variable --show-types' command.
         if blockCaptured:
             break_line = line_number ("basic_type.cpp", "// Break here to test block captured variables.")
         else:
@@ -128,19 +128,19 @@
             substrs = [" at basic_type.cpp:%d" % break_line,
                        "stop reason = breakpoint"])
 
-        #self.runCmd("frame variable -T")
+        #self.runCmd("frame variable --show-types")
 
         # Now iterate through the golden list, comparing against the output from
-        # 'frame variable -T var'.
+        # 'frame variable --show-types var'.
         for var, val in gl:
-            self.runCmd("frame variable -T %s" % var)
+            self.runCmd("frame variable --show-types %s" % var)
             output = self.res.GetOutput()
 
             # The input type is in a canonical form as a set of named atoms.
             # The display type string must conatin each and every element.
             #
             # Example:
-            #     runCmd: frame variable -T a_array_bounded[0]
+            #     runCmd: frame variable --show-types a_array_bounded[0]
             #     output: (char) a_array_bounded[0] = 'a'
             #
             try:
@@ -209,7 +209,7 @@
             substrs = [" at basic_type.cpp:%d" % break_line,
                        "stop reason = breakpoint"])
 
-        #self.runCmd("frame variable -T")
+        #self.runCmd("frame variable --show-types")
 
         # Now iterate through the golden list, comparing against the output from
         # 'expr var'.

Modified: lldb/branches/windows/test/warnings/uuid/TestAddDsymCommand.py
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/test/warnings/uuid/TestAddDsymCommand.py?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/test/warnings/uuid/TestAddDsymCommand.py (original)
+++ lldb/branches/windows/test/warnings/uuid/TestAddDsymCommand.py Tue Jan  8 06:51:53 2013
@@ -81,7 +81,7 @@
 
         right_path = os.path.join("%s.dSYM" % exe_name, "Contents", "Resources", "DWARF", exe_name)
         self.expect("add-dsym " + right_path, error=True,
-            substrs = ['symbol file', 'with UUID', 'does not match'])
+            substrs = ['symbol file', 'does not match'])
 
     def do_add_dsym_with_success(self, exe_name):
         """Test that the 'add-dsym' command informs the user about success."""
@@ -90,8 +90,7 @@
         # This time, the UUID should match and we expect some feedback from lldb.
         right_path = os.path.join("%s.dSYM" % exe_name, "Contents", "Resources", "DWARF", exe_name)
         self.expect("add-dsym " + right_path,
-            substrs = ['symbol file', 'with UUID', 'has been successfully added to the',
-                       'module'])
+            substrs = ['symbol file', 'has been added to'])
 
     def do_add_dsym_with_dSYM_bundle(self, exe_name):
         """Test that the 'add-dsym' command informs the user about success when loading files in bundles."""
@@ -100,8 +99,7 @@
         # This time, the UUID should be found inside the bundle
         right_path = "%s.dSYM" % exe_name
         self.expect("add-dsym " + right_path,
-            substrs = ['symbol file', 'with UUID', 'has been successfully added to the',
-                       'module'])
+            substrs = ['symbol file', 'has been added to'])
 
 
 if __name__ == '__main__':

Modified: lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj (original)
+++ lldb/branches/windows/tools/debugserver/debugserver.xcodeproj/project.pbxproj Tue Jan  8 06:51:53 2013
@@ -486,7 +486,7 @@
 					i386,
 				);
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 193;
+				CURRENT_PROJECT_VERSION = 198;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
@@ -507,7 +507,7 @@
 					armv7s,
 				);
 				"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
-				CURRENT_PROJECT_VERSION = 193;
+				CURRENT_PROJECT_VERSION = 198;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -533,7 +533,7 @@
 					x86_64,
 					i386,
 				);
-				CURRENT_PROJECT_VERSION = 193;
+				CURRENT_PROJECT_VERSION = 198;
 				DEAD_CODE_STRIPPING = YES;
 				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
@@ -554,7 +554,7 @@
 				CLANG_CXX_LIBRARY = "libc++";
 				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 193;
+				CURRENT_PROJECT_VERSION = 198;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -610,7 +610,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 193;
+				CURRENT_PROJECT_VERSION = 198;
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
 					"$(SDKROOT)/System/Library/PrivateFrameworks",
@@ -665,7 +665,7 @@
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
 				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
 				COPY_PHASE_STRIP = YES;
-				CURRENT_PROJECT_VERSION = 193;
+				CURRENT_PROJECT_VERSION = 198;
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
 				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
@@ -711,6 +711,86 @@
 			};
 			name = Release;
 		};
+		4968B7A916657FAE00741ABB /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				"ARCHS[sdk=iphoneos*]" = (
+					armv7,
+					armv7s,
+				);
+				"ARCHS[sdk=macosx*]" = (
+					x86_64,
+					i386,
+				);
+				COPY_PHASE_STRIP = NO;
+				CURRENT_PROJECT_VERSION = 198;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNUSED_VARIABLE = YES;
+				ONLY_ACTIVE_ARCH = YES;
+				SDKROOT = "";
+				STRIP_INSTALLED_PRODUCT = NO;
+				VALID_ARCHS = "armv4t armv5 armv6 armv7 armv7s i386 ppc ppc64 ppc7400 ppc970 x86_64";
+				VERSIONING_SYSTEM = "apple-generic";
+				VERSION_INFO_BUILDER = "$(USER)";
+			};
+			name = DebugClang;
+		};
+		4968B7AA16657FAE00741ABB /* DebugClang */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
+				CLANG_CXX_LIBRARY = "libc++";
+				"CODE_SIGN_ENTITLEMENTS[sdk=iphoneos*]" = "source/debugserver-entitlements.plist";
+				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "-";
+				"CODE_SIGN_IDENTITY[sdk=macosx*]" = lldb_codesign;
+				COPY_PHASE_STRIP = YES;
+				CURRENT_PROJECT_VERSION = 198;
+				FRAMEWORK_SEARCH_PATHS = $SDKROOT/System/Library/PrivateFrameworks;
+				"FRAMEWORK_SEARCH_PATHS[sdk=iphoneos*][arch=*]" = (
+					"$(SDKROOT)/System/Library/PrivateFrameworks",
+					"$(SDKROOT)/Developer/Library/PrivateFrameworks",
+				);
+				"FRAMEWORK_SEARCH_PATHS[sdk=macosx*][arch=*]" = "$(SDKROOT)/System/Library/PrivateFrameworks";
+				GCC_C_LANGUAGE_STANDARD = c99;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_DEBUG;
+				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				INSTALL_PATH = /usr/bin;
+				LLDB_DEBUGSERVER = 1;
+				OTHER_CFLAGS = "-Wparentheses";
+				"OTHER_CFLAGS[sdk=iphoneos*][arch=*]" = (
+					"-Wparentheses",
+					"-DWITH_LOCKDOWN",
+					"-DWITH_SPRINGBOARD",
+					"-DUSE_ARM_DISASSEMBLER_FRAMEWORK",
+					"-DOS_OBJECT_USE_OBJC=0",
+				);
+				"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
+				OTHER_LDFLAGS = (
+					"-sectcreate",
+					__TEXT,
+					__info_plist,
+					"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
+				);
+				"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
+					"-framework",
+					SpringBoardServices,
+					"-framework",
+					ARMDisassembler,
+					"-llockdown",
+				);
+				OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
+				PRODUCT_NAME = debugserver;
+				"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
+				"PROVISIONING_PROFILE[sdk=macosx*]" = "";
+				SKIP_INSTALL = YES;
+				USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR)";
+				ZERO_LINK = NO;
+			};
+			name = DebugClang;
+		};
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
@@ -718,6 +798,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				1DEB914F08733D8E0010E9CD /* Debug */,
+				4968B7A916657FAE00741ABB /* DebugClang */,
 				1DEB915008733D8E0010E9CD /* Release */,
 				262419A11198A93E00067686 /* BuildAndIntegration */,
 			);
@@ -728,6 +809,7 @@
 			isa = XCConfigurationList;
 			buildConfigurations = (
 				26CE0596115C31C30022F371 /* Debug */,
+				4968B7AA16657FAE00741ABB /* DebugClang */,
 				26CE0597115C31C30022F371 /* Release */,
 				262419A21198A93E00067686 /* BuildAndIntegration */,
 			);

Modified: lldb/branches/windows/tools/debugserver/source/DNB.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/DNB.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/DNB.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/DNB.cpp Tue Jan  8 06:51:53 2013
@@ -255,6 +255,7 @@
                 // We failed to get the task for our process ID which is bad.
                 // Kill our process otherwise it will be stopped at the entry
                 // point and get reparented to someone else and never go away.
+                DNBLog ("Could not get task port for process, sending SIGKILL and exiting.");
                 kill (SIGKILL, pid);
 
                 if (err_str && err_len > 0)
@@ -1217,14 +1218,14 @@
     return -1;
 }
 
-const char *
-DNBProcessGetProfileDataAsCString (nub_process_t pid)
+std::string
+DNBProcessGetProfileData (nub_process_t pid)
 {
     MachProcessSP procSP;
     if (GetProcessSP (pid, procSP))
-        return procSP->Task().GetProfileDataAsCString();
+        return procSP->Task().GetProfileData();
     
-    return NULL;
+    return std::string("");
 }
 
 nub_bool_t

Modified: lldb/branches/windows/tools/debugserver/source/DNB.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/DNB.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/DNB.h (original)
+++ lldb/branches/windows/tools/debugserver/source/DNB.h Tue Jan  8 06:51:53 2013
@@ -17,10 +17,6 @@
 #include "DNBDefs.h"
 #include <mach/thread_info.h>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #define DNB_EXPORT __attribute__((visibility("default")))
 
 typedef bool (*DNBShouldCancelCallback) (void *);
@@ -67,7 +63,7 @@
 nub_addr_t      DNBProcessMemoryAllocate    (nub_process_t pid, nub_size_t size, uint32_t permissions) DNB_EXPORT;
 nub_bool_t      DNBProcessMemoryDeallocate  (nub_process_t pid, nub_addr_t addr) DNB_EXPORT;
 int             DNBProcessMemoryRegionInfo  (nub_process_t pid, nub_addr_t addr, DNBRegionInfo *region_info) DNB_EXPORT;
-const char *    DNBProcessGetProfileDataAsCString (nub_process_t pid) DNB_EXPORT; // Process owns the returned string. Do not free.
+std::string     DNBProcessGetProfileData (nub_process_t pid) DNB_EXPORT;
 nub_bool_t      DNBProcessSetAsyncEnableProfiling   (nub_process_t pid, nub_bool_t enable, uint64_t interval_usec) DNB_EXPORT;
 
 //----------------------------------------------------------------------
@@ -160,8 +156,4 @@
 const char *    DNBStateAsString (nub_state_t state) DNB_EXPORT;
 nub_bool_t      DNBResolveExecutablePath (const char *path, char *resolved_path, size_t resolved_path_size) DNB_EXPORT;
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif

Modified: lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.cpp Tue Jan  8 06:51:53 2013
@@ -364,6 +364,7 @@
     nub_state_t state = DoSIGSTOP(true, false, NULL);
     DNBLogThreadedIf(LOG_PROCESS, "MachProcess::Kill() DoSIGSTOP() state = %s", DNBStateAsString(state));
     errno = 0;
+    DNBLog ("Sending ptrace PT_KILL to terminate inferior process.");
     ::ptrace (PT_KILL, m_pid, 0, 0);
     DNBError err;
     err.SetErrorToErrno();
@@ -1347,7 +1348,7 @@
 {
     DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (%s) ...", __FUNCTION__, info);
     PTHREAD_MUTEX_LOCKER (locker, m_profile_data_mutex);
-    m_profile_data.append(info);
+    m_profile_data.push_back(info);
     m_events.SetEvents(eEventProfileDataAvailable);
     
     // Wait for the event bit to reset if a reset ACK is requested
@@ -1360,19 +1361,22 @@
 {
     DNBLogThreadedIf(LOG_PROCESS, "MachProcess::%s (&%p[%llu]) ...", __FUNCTION__, buf, (uint64_t)buf_size);
     PTHREAD_MUTEX_LOCKER (locker, m_profile_data_mutex);
-    size_t bytes_available = m_profile_data.size();
+    if (m_profile_data.empty())
+        return 0;
+    
+    size_t bytes_available = m_profile_data.front().size();
     if (bytes_available > 0)
     {
         if (bytes_available > buf_size)
         {
-            memcpy(buf, m_profile_data.data(), buf_size);
-            m_profile_data.erase(0, buf_size);
+            memcpy(buf, m_profile_data.front().data(), buf_size);
+            m_profile_data.front().erase(0, buf_size);
             bytes_available = buf_size;
         }
         else
         {
-            memcpy(buf, m_profile_data.data(), bytes_available);
-            m_profile_data.clear();
+            memcpy(buf, m_profile_data.front().data(), bytes_available);
+            m_profile_data.erase(m_profile_data.begin());
         }
     }
     return bytes_available;
@@ -1390,10 +1394,10 @@
         nub_state_t state = proc->GetState();
         if (state == eStateRunning)
         {
-            const char *data = proc->Task().GetProfileDataAsCString();
-            if (data)
+            std::string data = proc->Task().GetProfileData();
+            if (!data.empty())
             {
-                proc->SignalAsyncProfileData(data);
+                proc->SignalAsyncProfileData(data.c_str());
             }
         }
         else if ((state == eStateUnloaded) || (state == eStateDetached) || (state == eStateUnloaded))
@@ -1687,6 +1691,7 @@
         {
             if (launch_err.AsString() == NULL)
                 launch_err.SetErrorString("unable to start the exception thread");
+            DNBLog ("Could not get inferior's Mach exception port, sending ptrace PT_KILL and exiting.");
             ::ptrace (PT_KILL, m_pid, 0, 0);
             m_pid = INVALID_NUB_PROCESS;
             return INVALID_NUB_PROCESS;
@@ -2027,6 +2032,7 @@
         {
             if (launch_err.AsString() == NULL)
                 launch_err.SetErrorString("unable to start the exception thread");
+            DNBLog ("Could not get inferior's Mach exception port, sending ptrace PT_KILL and exiting.");
             ::ptrace (PT_KILL, m_pid, 0, 0);
             m_pid = INVALID_NUB_PROCESS;
             return INVALID_NUB_PROCESS;

Modified: lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.h (original)
+++ lldb/branches/windows/tools/debugserver/source/MacOSX/MachProcess.h Tue Jan  8 06:51:53 2013
@@ -282,7 +282,7 @@
     uint64_t                    m_profile_interval_usec;    // If enable, the profiling interval in microseconds
     pthread_t                   m_profile_thread;           // Thread ID for the thread that profiles the inferior
     PThreadMutex                m_profile_data_mutex;       // Multithreaded protection for profile info data
-    std::string                 m_profile_data;             // Profile data, must be protected by m_profile_data_mutex
+    std::vector<std::string>    m_profile_data;             // Profile data, must be protected by m_profile_data_mutex
     
     DNBThreadResumeActions      m_thread_actions;           // The thread actions for the current MachProcess::Resume() call
     MachException::Message::collection

Modified: lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.cpp Tue Jan  8 06:51:53 2013
@@ -23,6 +23,7 @@
 #include <mach/mach_vm.h>
 
 // C++ Includes
+#include <iomanip>
 #include <sstream>
 
 // Other libraries and framework includes
@@ -54,7 +55,6 @@
     m_exception_port (MACH_PORT_NULL)
 {
     memset(&m_exc_port_info, 0, sizeof(m_exc_port_info));
-
 }
 
 //----------------------------------------------------------------------
@@ -231,8 +231,8 @@
 (r)->tv_usec = (a)->microseconds;               \
 } while (0)
 
-// todo: make use of existing MachThread, if there is already one?
-static void update_used_time(task_t task, int &num_threads, uint64_t **threads_id, uint64_t **threads_used_usec, struct timeval &current_used_time)
+// We should consider moving this into each MacThread.
+static void get_threads_profile_data(task_t task, nub_process_t pid, int &num_threads, std::vector<uint64_t> &threads_id, std::vector<std::string> &threads_name, std::vector<uint64_t> &threads_used_usec)
 {
     kern_return_t kr;
     thread_act_array_t threads;
@@ -243,33 +243,40 @@
         return;
     
     num_threads = tcnt;
-    *threads_id = (uint64_t *)malloc(num_threads * sizeof(uint64_t));
-    *threads_used_usec = (uint64_t *)malloc(num_threads * sizeof(uint64_t));
-
     for (int i = 0; i < tcnt; i++) {
         thread_identifier_info_data_t identifier_info;
         mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
-        kr = thread_info(threads[i], THREAD_IDENTIFIER_INFO, (thread_info_t)&identifier_info, &count);
+        kr = ::thread_info(threads[i], THREAD_IDENTIFIER_INFO, (thread_info_t)&identifier_info, &count);
         if (kr != KERN_SUCCESS) continue;
-
+        
         thread_basic_info_data_t basic_info;
         count = THREAD_BASIC_INFO_COUNT;
-        kr = thread_info(threads[i], THREAD_BASIC_INFO, (thread_info_t)&basic_info, &count);
+        kr = ::thread_info(threads[i], THREAD_BASIC_INFO, (thread_info_t)&basic_info, &count);
         if (kr != KERN_SUCCESS) continue;
-        
-        if ((basic_info.flags & TH_FLAGS_IDLE) == 0) {
-            (*threads_id)[i] = identifier_info.thread_id;
 
+        if ((basic_info.flags & TH_FLAGS_IDLE) == 0) {
+            threads_id.push_back(identifier_info.thread_id);
+            
+            if (identifier_info.thread_handle != 0) {
+                struct proc_threadinfo proc_threadinfo;
+                int len = ::proc_pidinfo(pid, PROC_PIDTHREADINFO, identifier_info.thread_handle, &proc_threadinfo, PROC_PIDTHREADINFO_SIZE);
+                if (len && proc_threadinfo.pth_name[0]) {
+                    threads_name.push_back(proc_threadinfo.pth_name);
+                }
+                else {
+                    threads_name.push_back("");
+                }
+            }
+            else {
+                threads_name.push_back("");
+            }
             struct timeval tv;
             struct timeval thread_tv;
-            TIME_VALUE_TO_TIMEVAL(&basic_info.user_time, &tv);
             TIME_VALUE_TO_TIMEVAL(&basic_info.user_time, &thread_tv);
-            timeradd(&current_used_time, &tv, &current_used_time);
             TIME_VALUE_TO_TIMEVAL(&basic_info.system_time, &tv);
             timeradd(&thread_tv, &tv, &thread_tv);
-            timeradd(&current_used_time, &tv, &current_used_time);
             uint64_t used_usec = thread_tv.tv_sec * 1000000ULL + thread_tv.tv_usec;
-            (*threads_used_usec)[i] = used_usec;
+            threads_used_usec.push_back(used_usec);
         }
         
         kr = mach_port_deallocate(mach_task_self(), threads[i]);
@@ -277,31 +284,30 @@
     kr = mach_vm_deallocate(mach_task_self(), (mach_vm_address_t)(uintptr_t)threads, tcnt * sizeof(*threads));
 }
 
-const char *
-MachTask::GetProfileDataAsCString ()
+#define RAW_HEXBASE     std::setfill('0') << std::hex << std::right
+#define DECIMAL         std::dec << std::setfill(' ')
+std::string
+MachTask::GetProfileData ()
 {
+    std::string result;
     task_t task = TaskPort();
     if (task == TASK_NULL)
-        return NULL;
+        return result;
     
     struct task_basic_info task_info;
     DNBError err;
     err = BasicInfo(task, &task_info);
     
     if (!err.Success())
-        return NULL;
+        return result;
     
     uint64_t elapsed_usec = 0;
     uint64_t task_used_usec = 0;
     int num_threads = 0;
-    uint64_t *threads_used_usec = NULL;
-    uint64_t *threads_id = NULL;
-    mach_vm_size_t rprvt = 0;
-    mach_vm_size_t rsize = 0;
-    mach_vm_size_t vprvt = 0;
-    mach_vm_size_t vsize = 0;
-    mach_vm_size_t dirty_size = 0;
-
+    std::vector<uint64_t> threads_id;
+    std::vector<std::string> threads_name;
+    std::vector<uint64_t> threads_used_usec;
+    
     // Get current used time.
     struct timeval current_used_time;
     struct timeval tv;
@@ -309,7 +315,7 @@
     TIME_VALUE_TO_TIMEVAL(&task_info.system_time, &tv);
     timeradd(&current_used_time, &tv, &current_used_time);
     task_used_usec = current_used_time.tv_sec * 1000000ULL + current_used_time.tv_usec;
-    update_used_time(task, num_threads, &threads_id, &threads_used_usec, current_used_time);
+    get_threads_profile_data(task, m_process->ProcessID(), num_threads, threads_id, threads_name, threads_used_usec);
     
     struct timeval current_elapsed_time;
     int res = gettimeofday(&current_elapsed_time, NULL);
@@ -318,38 +324,62 @@
         elapsed_usec = current_elapsed_time.tv_sec * 1000000ULL + current_elapsed_time.tv_usec;
     }
     
-    if (m_vm_memory.GetMemoryProfile(task, task_info, m_process->GetCPUType(), m_process->ProcessID(), rprvt, rsize, vprvt, vsize, dirty_size))
+    struct vm_statistics vm_stats;
+    uint64_t physical_memory;
+    mach_vm_size_t rprvt = 0;
+    mach_vm_size_t rsize = 0;
+    mach_vm_size_t vprvt = 0;
+    mach_vm_size_t vsize = 0;
+    mach_vm_size_t dirty_size = 0;
+    if (m_vm_memory.GetMemoryProfile(task, task_info, m_process->GetCPUType(), m_process->ProcessID(), vm_stats, physical_memory, rprvt, rsize, vprvt, vsize, dirty_size))
     {
         std::ostringstream profile_data_stream;
         
         profile_data_stream << "elapsed_usec:" << elapsed_usec << ';';
         profile_data_stream << "task_used_usec:" << task_used_usec << ';';
         
-        profile_data_stream << "threads_info:" << num_threads;
+        profile_data_stream << "threads_used_usec:" << num_threads;
         for (int i=0; i<num_threads; i++) {
             profile_data_stream << ',' << threads_id[i];
+            
+            profile_data_stream << ',';
+            int len = threads_name[i].size();
+            if (len) {
+                const char *thread_name = threads_name[i].c_str();
+                // Make sure that thread name doesn't interfere with our delimiter.
+                profile_data_stream << RAW_HEXBASE << std::setw(2);
+                const uint8_t *ubuf8 = (const uint8_t *)(thread_name);
+                for (int i=0; i<len; i++)
+                {
+                    profile_data_stream << (uint32_t)(ubuf8[i]);
+                }
+                // Reset back to DECIMAL.
+                profile_data_stream << DECIMAL;
+            }
+            
             profile_data_stream << ',' << threads_used_usec[i];
         }
         profile_data_stream << ';';
         
+        profile_data_stream << "wired:" << vm_stats.wire_count * vm_page_size << ';';
+        profile_data_stream << "active:" << vm_stats.active_count * vm_page_size << ';';
+        profile_data_stream << "inactive:" << vm_stats.inactive_count * vm_page_size << ';';
+        uint64_t total_used_count = vm_stats.wire_count + vm_stats.inactive_count + vm_stats.active_count;
+        profile_data_stream << "used:" << total_used_count * vm_page_size << ';';
+        profile_data_stream << "free:" << vm_stats.free_count * vm_page_size << ';';
+        profile_data_stream << "total:" << physical_memory << ';';        
+        
         profile_data_stream << "rprvt:" << rprvt << ';';
         profile_data_stream << "rsize:" << rsize << ';';
         profile_data_stream << "vprvt:" << vprvt << ';';
         profile_data_stream << "vsize:" << vsize << ';';
         profile_data_stream << "dirty:" << dirty_size << ';';
-        profile_data_stream << "$";
+        profile_data_stream << "end;";
         
-        m_profile_data = profile_data_stream.str();
+        result = profile_data_stream.str();
     }
-    else
-    {
-        m_profile_data.clear();
-    }
-    
-    free(threads_id);
-    free(threads_used_usec);
     
-    return m_profile_data.c_str();
+    return result;
 }
 
 

Modified: lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.h (original)
+++ lldb/branches/windows/tools/debugserver/source/MacOSX/MachTask.h Tue Jan  8 06:51:53 2013
@@ -66,7 +66,7 @@
             nub_size_t      ReadMemory (nub_addr_t addr, nub_size_t size, void *buf);
             nub_size_t      WriteMemory (nub_addr_t addr, nub_size_t size, const void *buf);
             int             GetMemoryRegionInfo (nub_addr_t addr, DNBRegionInfo *region_info);
-            const char *    GetProfileDataAsCString ();
+            std::string     GetProfileData ();
 
             nub_addr_t      AllocateMemory (nub_size_t size, uint32_t permissions);
             nub_bool_t      DeallocateMemory (nub_addr_t addr);
@@ -123,7 +123,6 @@
 
             typedef std::map <mach_vm_address_t, size_t> allocation_collection;
             allocation_collection m_allocations;
-            std::string m_profile_data;
 
 private:
     MachTask(const MachTask&); // Outlaw

Modified: lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.cpp Tue Jan  8 06:51:53 2013
@@ -16,6 +16,7 @@
 #include "DNBLog.h"
 #include <mach/mach_vm.h>
 #include <mach/shared_region.h>
+#include <sys/sysctl.h>
 
 MachVMMemory::MachVMMemory() :
     m_page_size    (kInvalidPageSize),
@@ -89,6 +90,126 @@
     return true;
 }
 
+// For integrated graphics chip, this makes the accounting info for 'wired' memory more like top.
+static uint64_t GetStolenPages()
+{
+    static uint64_t stolenPages = 0;
+    static bool calculated = false;
+    if (calculated) return stolenPages;
+
+	static int mib_reserved[CTL_MAXNAME];
+	static int mib_unusable[CTL_MAXNAME];
+	static int mib_other[CTL_MAXNAME];
+	static size_t mib_reserved_len = 0;
+	static size_t mib_unusable_len = 0;
+	static size_t mib_other_len = 0;
+	int r;	
+    
+	/* This can be used for testing: */
+	//tsamp->pages_stolen = (256 * 1024 * 1024ULL) / tsamp->pagesize;
+    
+	if(0 == mib_reserved_len)
+    {
+		mib_reserved_len = CTL_MAXNAME;
+		
+		r = sysctlnametomib("machdep.memmap.Reserved", mib_reserved,
+                            &mib_reserved_len);
+        
+		if(-1 == r)
+        {
+			mib_reserved_len = 0;
+			return 0;
+		}
+        
+		mib_unusable_len = CTL_MAXNAME;
+        
+		r = sysctlnametomib("machdep.memmap.Unusable", mib_unusable,
+                            &mib_unusable_len);
+        
+		if(-1 == r)
+        {
+			mib_reserved_len = 0;
+			return 0;
+		}
+        
+        
+		mib_other_len = CTL_MAXNAME;
+		
+		r = sysctlnametomib("machdep.memmap.Other", mib_other,
+                            &mib_other_len);
+        
+		if(-1 == r)
+        {
+			mib_reserved_len = 0;
+			return 0;
+		}
+	}
+    
+	if(mib_reserved_len > 0 && mib_unusable_len > 0 && mib_other_len > 0)
+    {
+		uint64_t reserved = 0, unusable = 0, other = 0;
+		size_t reserved_len;
+		size_t unusable_len;
+		size_t other_len;
+		
+		reserved_len = sizeof(reserved);
+		unusable_len = sizeof(unusable);
+		other_len = sizeof(other);
+        
+		/* These are all declared as QUAD/uint64_t sysctls in the kernel. */
+        
+		if(-1 == sysctl(mib_reserved, mib_reserved_len, &reserved,
+                        &reserved_len, NULL, 0))
+        {
+			return 0;
+		}
+        
+		if(-1 == sysctl(mib_unusable, mib_unusable_len, &unusable,
+                        &unusable_len, NULL, 0))
+        {
+			return 0;
+		}
+        
+		if(-1 == sysctl(mib_other, mib_other_len, &other,
+                        &other_len, NULL, 0))
+        {
+			return 0;
+		}
+        
+		if(reserved_len == sizeof(reserved)
+		   && unusable_len == sizeof(unusable)
+		   && other_len == sizeof(other))
+        {
+			uint64_t stolen = reserved + unusable + other;	
+			uint64_t mb128 = 128 * 1024 * 1024ULL;
+            
+			if(stolen >= mb128)
+            {
+                stolen = (stolen & ~((128 * 1024 * 1024ULL) - 1)); // rounding down
+                stolenPages = stolen/vm_page_size;
+			}
+		}
+	}
+    
+    calculated = true;
+    return stolenPages;
+}
+
+static uint64_t GetPhysicalMemory()
+{
+    // This doesn't change often at all. No need to poll each time.
+    static uint64_t physical_memory = 0;
+    static bool calculated = false;
+    if (calculated) return physical_memory;
+    
+    int mib[2];
+    mib[0] = CTL_HW;
+    mib[1] = HW_MEMSIZE;
+    size_t len = sizeof(physical_memory);
+    sysctl(mib, 2, &physical_memory, &len, NULL, 0);
+    return physical_memory;
+}
+
 // rsize and dirty_size is not adjusted for dyld shared cache and multiple __LINKEDIT segment, as in vmmap. In practice, dirty_size doesn't differ much but rsize may. There is performance penalty for the adjustment. Right now, only use the dirty_size.
 static void GetRegionSizes(task_t task, mach_vm_size_t &rsize, mach_vm_size_t &dirty_size)
 {
@@ -276,8 +397,14 @@
 }
 
 nub_bool_t
-MachVMMemory::GetMemoryProfile(task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size)
+MachVMMemory::GetMemoryProfile(task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics_data_t &vm_stats, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size)
 {
+    static mach_port_t localHost = mach_host_self();
+    mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
+    host_statistics(localHost, HOST_VM_INFO, (host_info_t)&vm_stats, &count);
+    vm_stats.wire_count += GetStolenPages();
+    physical_memory = GetPhysicalMemory();
+
     // This uses vmmap strategy. We don't use the returned rsize for now. We prefer to match top's version since that's what we do for the rest of the metrics.
     GetRegionSizes(task, rsize, dirty_size);
     

Modified: lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.h (original)
+++ lldb/branches/windows/tools/debugserver/source/MacOSX/MachVMMemory.h Tue Jan  8 06:51:53 2013
@@ -28,7 +28,7 @@
     nub_size_t Write(task_t task, nub_addr_t address, const void *data, nub_size_t data_count);
     nub_size_t PageSize();
     nub_bool_t GetMemoryRegionInfo(task_t task, nub_addr_t address, DNBRegionInfo *region_info);
-    nub_bool_t GetMemoryProfile(task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size);
+    nub_bool_t GetMemoryProfile(task_t task, struct task_basic_info ti, cpu_type_t cputype, nub_process_t pid, vm_statistics_data_t &vm_stats, uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize, mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size);
 
 protected:
     nub_size_t MaxBytesLeftInPage(nub_addr_t addr, nub_size_t count);

Modified: lldb/branches/windows/tools/debugserver/source/RNBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/RNBRemote.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/RNBRemote.cpp (original)
+++ lldb/branches/windows/tools/debugserver/source/RNBRemote.cpp Tue Jan  8 06:51:53 2013
@@ -173,6 +173,7 @@
     t.push_back (Packet (query_vattachorwait_supported, &RNBRemote::HandlePacket_qVAttachOrWaitSupported,NULL, "qVAttachOrWaitSupported", "Replys with OK if the 'vAttachOrWait' packet is supported."));
     t.push_back (Packet (query_sync_thread_state_supported, &RNBRemote::HandlePacket_qSyncThreadStateSupported,NULL, "qSyncThreadStateSupported", "Replys with OK if the 'QSyncThreadState:' packet is supported."));
     t.push_back (Packet (query_host_info,               &RNBRemote::HandlePacket_qHostInfo,     NULL, "qHostInfo", "Replies with multiple 'key:value;' tuples appended to each other."));
+    t.push_back (Packet (query_process_info,            &RNBRemote::HandlePacket_qProcessInfo,     NULL, "qProcessInfo", "Replies with multiple 'key:value;' tuples appended to each other."));
 //  t.push_back (Packet (query_symbol_lookup,           &RNBRemote::HandlePacket_UNIMPLEMENTED, NULL, "qSymbol", "Notify that host debugger is ready to do symbol lookups"));
     t.push_back (Packet (start_noack_mode,              &RNBRemote::HandlePacket_QStartNoAckMode        , NULL, "QStartNoAckMode", "Request that " DEBUGSERVER_PROGRAM_NAME " stop acking remote protocol packets"));
     t.push_back (Packet (prefix_reg_packets_with_tid,   &RNBRemote::HandlePacket_QThreadSuffixSupported , NULL, "QThreadSuffixSupported", "Check if thread specifc packets (register packets 'g', 'G', 'p', and 'P') support having the thread ID appended to the end of the command"));
@@ -234,7 +235,7 @@
     if (m_ctx.HasValidProcessID())
     {
         nub_process_t pid = m_ctx.ProcessID();
-        char buf[256];
+        char buf[1024];
         nub_size_t count;
         do
         {
@@ -3467,10 +3468,10 @@
     if (pid == INVALID_NUB_PROCESS)
         return SendPacket ("OK");
 
-    const char *data = DNBProcessGetProfileDataAsCString(pid);
-    if (data)
+    std::string data = DNBProcessGetProfileData(pid);
+    if (!data.empty())
     {
-        return SendPacket (data);
+        return SendPacket (data.c_str());
     }
     else
     {
@@ -3777,3 +3778,109 @@
         strm << "ptrsize:" << std::dec << sizeof(void *) << ';';
     return SendPacket (strm.str());
 }
+
+
+// Note that all numeric values returned by qProcessInfo are hex encoded,
+// including the pid and the cpu type.
+
+rnb_err_t
+RNBRemote::HandlePacket_qProcessInfo (const char *p)
+{
+    nub_process_t pid;
+    std::ostringstream rep;
+
+    // If we haven't run the process yet, return an error.
+    if (!m_ctx.HasValidProcessID())
+        return SendPacket ("E68");
+
+    pid = m_ctx.ProcessID();
+
+    rep << "pid:" << std::hex << pid << ";";
+
+    int procpid_mib[4];
+    procpid_mib[0] = CTL_KERN;
+    procpid_mib[1] = KERN_PROC;
+    procpid_mib[2] = KERN_PROC_PID;
+    procpid_mib[3] = pid;
+    struct kinfo_proc proc_kinfo;
+    size_t proc_kinfo_size = sizeof(struct kinfo_proc);
+
+    if (::sysctl (procpid_mib, 4, &proc_kinfo, &proc_kinfo_size, NULL, 0) == 0)
+    {
+        if (proc_kinfo_size > 0)
+        {
+            rep << "parent-pid:" << std::hex << proc_kinfo.kp_eproc.e_ppid << ";";
+            rep << "real-uid:" << std::hex << proc_kinfo.kp_eproc.e_pcred.p_ruid << ";";
+            rep << "real-gid:" << std::hex << proc_kinfo.kp_eproc.e_pcred.p_rgid << ";";
+            rep << "effective-uid:" << std::hex << proc_kinfo.kp_eproc.e_ucred.cr_uid << ";";
+            if (proc_kinfo.kp_eproc.e_ucred.cr_ngroups > 0)
+                rep << "effective-gid:" << std::hex << proc_kinfo.kp_eproc.e_ucred.cr_groups[0] << ";";
+        }
+    }
+    
+    int cputype_mib[CTL_MAXNAME]={0,};
+    size_t cputype_mib_len = CTL_MAXNAME;
+    cpu_type_t cputype = -1;
+    if (::sysctlnametomib("sysctl.proc_cputype", cputype_mib, &cputype_mib_len) == 0)
+    {
+        cputype_mib[cputype_mib_len] = pid;
+        cputype_mib_len++;
+        size_t len = sizeof(cputype);
+        if (::sysctl (cputype_mib, cputype_mib_len, &cputype, &len, 0, 0) == 0)
+        {
+            rep << "cputype:" << std::hex << cputype << ";";
+        }
+    }
+
+    uint32_t cpusubtype;
+    size_t cpusubtype_len = sizeof(cpusubtype);
+    if (::sysctlbyname("hw.cpusubtype", &cpusubtype, &cpusubtype_len, NULL, 0) == 0)
+    {
+        if (cputype == CPU_TYPE_X86_64 && cpusubtype == CPU_SUBTYPE_486)
+        {
+            cpusubtype = CPU_SUBTYPE_X86_64_ALL;
+        }
+
+        rep << "cpusubtype:" << std::hex << cpusubtype << ';';
+    }
+
+    // The OS in the triple should be "ios" or "macosx" which doesn't match our
+    // "Darwin" which gets returned from "kern.ostype", so we need to hardcode
+    // this for now.
+    if (cputype == CPU_TYPE_ARM)
+        rep << "ostype:ios;";
+    else
+        rep << "ostype:macosx;";
+
+    rep << "vendor:apple;";
+
+#if defined (__LITTLE_ENDIAN__)
+    rep << "endian:little;";
+#elif defined (__BIG_ENDIAN__)
+    rep << "endian:big;";
+#elif defined (__PDP_ENDIAN__)
+    rep << "endian:pdp;";
+#endif
+
+    nub_thread_t thread = DNBProcessGetCurrentThread (pid);
+    kern_return_t kr;
+
+#if (defined (__x86_64__) || defined (__i386__)) && defined (x86_THREAD_STATE)
+    x86_thread_state_t gp_regs;
+    mach_msg_type_number_t gp_count = x86_THREAD_STATE_COUNT;
+    kr = thread_get_state (thread, x86_THREAD_STATE,
+                           (thread_state_t) &gp_regs, &gp_count);
+    if (kr == KERN_SUCCESS)
+    {
+        if (gp_regs.tsh.flavor == x86_THREAD_STATE64)
+            rep << "ptrsize:8;";
+        else
+            rep << "ptrsize:4;";
+    }
+#elif defined (__arm__)
+    rep << "ptrsize:4;";
+#endif
+
+    return SendPacket (rep.str());
+}
+

Modified: lldb/branches/windows/tools/debugserver/source/RNBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/RNBRemote.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/RNBRemote.h (original)
+++ lldb/branches/windows/tools/debugserver/source/RNBRemote.h Tue Jan  8 06:51:53 2013
@@ -95,6 +95,7 @@
         query_vattachorwait_supported,  // 'qVAttachOrWaitSupported'
         query_sync_thread_state_supported,// 'QSyncThreadState'
         query_host_info,                // 'qHostInfo'
+        query_process_info,             // 'qProcessInfo'
         pass_signals_to_inferior,       // 'QPassSignals'
         start_noack_mode,               // 'QStartNoAckMode'
         prefix_reg_packets_with_tid,    // 'QPrefixRegisterPacketsWithThreadID
@@ -176,6 +177,7 @@
     rnb_err_t HandlePacket_qThreadExtraInfo (const char *p);
     rnb_err_t HandlePacket_qThreadStopInfo (const char *p);
     rnb_err_t HandlePacket_qHostInfo (const char *p);
+    rnb_err_t HandlePacket_qProcessInfo (const char *p);
     rnb_err_t HandlePacket_QStartNoAckMode (const char *p);
     rnb_err_t HandlePacket_QThreadSuffixSupported (const char *p);
     rnb_err_t HandlePacket_QSetLogging (const char *p);

Modified: lldb/branches/windows/tools/debugserver/source/com.apple.debugserver.posix.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/debugserver/source/com.apple.debugserver.posix.plist?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/debugserver/source/com.apple.debugserver.posix.plist (original)
+++ lldb/branches/windows/tools/debugserver/source/com.apple.debugserver.posix.plist Tue Jan  8 06:51:53 2013
@@ -3,7 +3,7 @@
 <plist version="1.0">
 <dict>
 	<key>Label</key>
-	<string>com.apple.debugserver</string>
+	<string>com.apple.debugserver.posix</string>
 	<key>UserName</key>
 	<string>mobile</string>
 	<key>ProgramArguments</key>

Modified: lldb/branches/windows/tools/driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/Driver.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/Driver.cpp (original)
+++ lldb/branches/windows/tools/driver/Driver.cpp Tue Jan  8 06:51:53 2013
@@ -19,6 +19,10 @@
 #include <stdlib.h>
 #include <limits.h>
 #include <fcntl.h>
+#ifndef _WIN32
+#include <inttypes.h>
+#endif
+
 
 #include "IOChannel.h"
 #include "lldb/API/SBBreakpoint.h"
@@ -46,7 +50,8 @@
     m_editline_reader (),
     m_io_channel_ap (),
     m_option_data (),
-    m_waiting_for_command (false)
+    m_waiting_for_command (false),
+    m_done(false)
 {
 }
 
@@ -154,7 +159,6 @@
             StopReason thread_stop_reason = thread.GetStopReason();
             switch (thread_stop_reason)
 			{
-            default:
             case eStopReasonInvalid:
             case eStopReasonNone:
                 break;
@@ -164,6 +168,8 @@
             case eStopReasonWatchpoint:
             case eStopReasonSignal:
             case eStopReasonException:
+            case eStopReasonExec:
+            case eStopReasonThreadExiting:
                 if (!other_thread.IsValid())
                     other_thread = thread;
                 break;
@@ -196,7 +202,8 @@
     // reprint the thread status for that thread.
     using namespace lldb;
     const uint32_t event_type = event.GetType();
-    if (event_type == SBThread::eBroadcastBitStackChanged)
+    if (event_type == SBThread::eBroadcastBitStackChanged
+        || event_type == SBThread::eBroadcastBitThreadSelected)
     {
         SBThread thread = SBThread::GetThreadFromEvent (event);
         if (thread.IsValid())
@@ -244,7 +251,8 @@
                                          SBTarget::eBroadcastBitBreakpointChanged);
         listener.StartListeningForEventClass(m_debugger, 
                                          SBThread::GetBroadcasterClassName(),
-                                         SBThread::eBroadcastBitStackChanged);
+                                         SBThread::eBroadcastBitStackChanged |
+                                         SBThread::eBroadcastBitThreadSelected);
     listener.StartListeningForEvents (*m_io_channel_ap,
                                         IOChannel::eBroadcastBitHasUserInput |
                                         IOChannel::eBroadcastBitUserInterrupt |

Modified: lldb/branches/windows/tools/driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/Driver.h?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/Driver.h (original)
+++ lldb/branches/windows/tools/driver/Driver.h Tue Jan  8 06:51:53 2013
@@ -115,6 +115,7 @@
         std::vector<std::string> m_source_command_files;
         bool m_debug_mode;
         bool m_print_version;
+        bool m_print_python_path;
         bool m_print_help;
         bool m_wait_for;
         std::string m_process_name;

Modified: lldb/branches/windows/tools/driver/DriverEvents.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/DriverEvents.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/DriverEvents.cpp (original)
+++ lldb/branches/windows/tools/driver/DriverEvents.cpp Tue Jan  8 06:51:53 2013
@@ -16,7 +16,11 @@
 #include <string.h>
 #include <stdlib.h>
 #include <limits.h>
-#include <fcntl.h>
+#include <fcntl.h>
+#ifndef _WIN32
+#include <inttypes.h>
+#endif
+
 
 #include "IOChannel.h"
 #include "lldb/API/SBBreakpoint.h"

Modified: lldb/branches/windows/tools/driver/DriverOptions.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/DriverOptions.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/DriverOptions.cpp (original)
+++ lldb/branches/windows/tools/driver/DriverOptions.cpp Tue Jan  8 06:51:53 2013
@@ -11,8 +11,12 @@
 
 #ifdef _WIN32
 #include "lldb/lldb-windows.h"
+#endif
+#ifndef _WIN32
+#include <inttypes.h>
 #endif
 
+#include "IOChannel.h"
 #include "lldb/API/SBHostOS.h"
 using namespace lldb;
 
@@ -22,7 +26,7 @@
                                              // then this option belongs to option set n.
     bool required;                           // This option is required (in the current usage level)
     const char * long_option;                // Full name for this option.
-    char short_option;                       // Single character for this option.
+    int short_option;                       // Single character for this option.
     int option_has_arg;                      // no_argument, required_argument or optional_argument
     uint32_t completion_type;                // Cookie the option class can use to do define the argument completion.
     lldb::CommandArgumentType argument_type; // Type of argument this option takes
@@ -64,6 +68,8 @@
         "Tells the debugger to open source files using the host's \"external editor\" mechanism." },
     { LLDB_3_TO_5,       false, "no-lldbinit"    , 'x', no_argument      , 0,  eArgTypeNone,
         "Do not automatically parse any '.lldbinit' files." },
+    { LLDB_OPT_SET_6,    true , "python-path"        , 'P', no_argument      , 0,  eArgTypeNone,
+        "Prints out the path to the lldb.py file for this version of lldb." },
     { 0,                 false, NULL             , 0  , 0                , 0,  eArgTypeNone,         NULL }
 };
 
@@ -303,6 +309,7 @@
     m_source_command_files (),
     m_debug_mode (false),
     m_print_version (false),
+    m_print_python_path (false),
     m_print_help (false),
     m_wait_for(false),
     m_process_name(),
@@ -325,6 +332,7 @@
     m_debug_mode = false;
     m_print_help = false;
     m_print_version = false;
+    m_print_python_path = false;
     m_use_external_editor = false;
     m_wait_for = false;
     m_process_name.erase();
@@ -451,7 +459,7 @@
 
             if (long_options_index >= 0)
             {
-                const char short_option = (char) g_options[long_options_index].short_option;
+                const int short_option = g_options[long_options_index].short_option;
 
                 switch (short_option)
                 {
@@ -463,6 +471,10 @@
                         m_option_data.m_print_version = true;
                         break;
 
+                    case 'P':
+                        m_option_data.m_print_python_path = true;
+                        break;
+						
                     case 'c':
                         m_option_data.m_crash_log = optarg;
                         break;
@@ -568,6 +580,24 @@
         ::fprintf (out_fh, "%s\n", m_debugger.GetVersionString());
         exit = true;
     }
+    else if (m_option_data.m_print_python_path)
+    {
+        SBFileSpec python_file_spec = SBHostOS::GetLLDBPythonPath();
+        if (python_file_spec.IsValid())
+        {
+            char python_path[PATH_MAX];
+            size_t num_chars = python_file_spec.GetPath(python_path, PATH_MAX);
+            if (num_chars < PATH_MAX)
+            {
+                ::fprintf (out_fh, "%s\n", python_path);
+            }
+            else
+                ::fprintf (out_fh, "<PATH TOO LONG>\n");
+        }
+        else
+            ::fprintf (out_fh, "<COULD NOT FIND PATH>\n");
+        exit = true;
+    }
     else if (! m_option_data.m_crash_log.empty())
     {
         // Handle crash log stuff here.
@@ -614,6 +644,7 @@
     // Now we handle options we got from the command line
     char command_string[PATH_MAX * 2];
     const size_t num_source_command_files = GetNumSourceCommandFiles();
+    const bool dump_stream_only_if_no_immediate = true;
     if (num_source_command_files > 0)
     {
         for (size_t i=0; i < num_source_command_files; ++i)
@@ -626,6 +657,20 @@
                 result.PutError (m_debugger.GetErrorFileHandle());
                 result.PutOutput (m_debugger.GetOutputFileHandle());
             }
+                    
+			// if the command sourcing generated an error - dump the result object
+			if (result.Succeeded() == false)
+			{
+				const size_t output_size = result.GetOutputSize();
+				if (output_size > 0)
+					m_io_channel_ap->OutWrite (result.GetOutput(dump_stream_only_if_no_immediate), output_size, NO_ASYNC);
+				const size_t error_size = result.GetErrorSize();
+				if (error_size > 0)
+					m_io_channel_ap->OutWrite (result.GetError(dump_stream_only_if_no_immediate), error_size, NO_ASYNC);
+			}
+			
+			result.Clear();
+			
         }
     }
 

Modified: lldb/branches/windows/tools/driver/DriverPosix.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/DriverPosix.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/DriverPosix.cpp (original)
+++ lldb/branches/windows/tools/driver/DriverPosix.cpp Tue Jan  8 06:51:53 2013
@@ -244,6 +244,25 @@
     
     exit (signo);
 }
+
+void
+sigtstp_handler (int signo)
+{
+    g_driver->GetDebugger().SaveInputTerminalState();
+    signal (signo, SIG_DFL);
+    kill (getpid(), signo);
+    signal (signo, sigtstp_handler);
+}
+
+void
+sigcont_handler (int signo)
+{
+    g_driver->GetDebugger().RestoreInputTerminalState();
+    signal (signo, SIG_DFL);
+    kill (getpid(), signo);
+    signal (signo, sigcont_handler);
+}
+
 #endif
 
 void
@@ -253,5 +272,7 @@
     signal (SIGPIPE, SIG_IGN);
     signal (SIGWINCH, sigwinch_handler);
     signal (SIGINT, sigint_handler);
+    signal (SIGTSTP, sigtstp_handler);
+    signal (SIGCONT, sigcont_handler);
 #endif
 }

Modified: lldb/branches/windows/tools/driver/IOChannel.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/IOChannel.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/IOChannel.cpp (original)
+++ lldb/branches/windows/tools/driver/IOChannel.cpp Tue Jan  8 06:51:53 2013
@@ -500,7 +500,7 @@
     }
     BroadcastEventByType (IOChannel::eBroadcastBitThreadDidExit);
     m_driver = NULL;
-    m_read_thread = NULL;
+    m_read_thread = 0;
 }
 
 bool

Modified: lldb/branches/windows/tools/driver/Makefile
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/driver/Makefile?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/driver/Makefile (original)
+++ lldb/branches/windows/tools/driver/Makefile Tue Jan  8 06:51:53 2013
@@ -10,6 +10,8 @@
 
 TOOLNAME = lldb
 
+NO_PEDANTIC = 1
+
 LLVMLibsOptions += -ledit -llldb -llldbUtility
 
 include $(LLDB_LEVEL)/Makefile

Modified: lldb/branches/windows/tools/lldb-platform/lldb-platform.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/tools/lldb-platform/lldb-platform.cpp?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/tools/lldb-platform/lldb-platform.cpp (original)
+++ lldb/branches/windows/tools/lldb-platform/lldb-platform.cpp Tue Jan  8 06:51:53 2013
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+#include "lldb/lldb-python.h"
+
 // C Includes
 #include <errno.h>
 #include <getopt.h>

Modified: lldb/branches/windows/www/build.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/build.html?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/www/build.html (original)
+++ lldb/branches/windows/www/build.html Tue Jan  8 06:51:53 2013
@@ -53,6 +53,12 @@
                     <li><a href="http://llvm.org/docs/GettingStarted.html">LLVM</a></li>
                     <li><a href="http://clang.llvm.org/get_started.html">Clang</a></li>
                 </ul>
+                <p>Supported compilers for building LLDB on Linux include:</p>
+                <ul>
+                  <li>Clang 3.2</li>
+                  <li><a href="http://gcc.gnu.org">GCC</a> 4.6.2 (later versions should work as well)</li>
+                </ul>
+                <p>It is recommended to use libstdc++ 4.6 (or higher) to build LLDB on Linux, but using libc++ is also known to work.</p>
                 <p>In addition to any dependencies required by LLVM and Clang, LLDB needs a few
                 development packages that may also need to be installed depending on your
                 system.  The current list of dependencies are:</p>
@@ -65,10 +71,6 @@
                 <code>> yum install swig python-devel libedit-devel</code>
                 <p>On an Ubuntu system one might run:</p>
                 <code>> sudo apt-get install swig python-dev libedit-dev </code>
-                <p>If building using GCC instead of Clang, GCC 4.6.2 or newer is required.</p>
-                <ul>
-                    <li><a href="http://gcc.gnu.org">GCC</a></li>
-                </ul>
                 <h2 >Building LLDB</h2>
                 <p>We first need to checkout the source trees into the appropriate locations.  Both
                 Clang and LLDB build as subprojects of LLVM.  This means we will be checking out
@@ -105,25 +107,33 @@
                 <code>> cd $llvm/..
                   <br>> mkdir build
                   <br>> cd build
-                  <br>> $llvm/configure --enable-cxx11 --enable-libcpp
+                </code>
+                <p>If you are using clang:</p>
+                <code>
+                  <br>> $llvm/configure --enable-cxx11
                   <br>> make </code>
+                <p>If you are using GCC 4.6+:</p>
+                <code>
+                  <br>> $llvm/configure
+                  <br>> make CXXFLAGS=-std=c++0x</code>
                 <p>Note that once both LLVM and Clang have been configured and built it is not
                 necessary to perform a top-level <tt>make</tt> to rebuild changes made only to LLDB.
-                You can run <tt>make</tt> from the <tt>build/tools/lldb</tt> subdirectory as well. If your
-                compiler doesn't support libc++, you may need to tweak or remove the last
-                parameter to the configure script.</p>
+                You can run <tt>make</tt> from the <tt>build/tools/lldb</tt> subdirectory as well.</p>
+                <p> If you wish to build with libc++ instead of libstdc++ (the default), you should run configure with the
+                <tt>--enable-libcpp</tt> flag.</p>
+                <p> If you wish to build a release version of LLDB, run configure with the <tt>--enable-optimized</tt> flag.</p>
                 
                 <h2>Additional Notes</h2>
-                <p>LLDB has a Python scripting capability and supplies its own Python module,
-                <tt>lldb</tt>, built alongside the <tt>lldb</tt> binary.  Python needs to know where to
-                look for this module when LLDB starts up.  To tell python the location of LLDB, set
-                <tt>PYTHONPATH</tt> environment variable.
-                <p>In bash with a <tt>Debug+Asserts</tt> build (the default if configure is invoked
-                like in the example on this page) one might run:</p>
-                <code>> export PYTHONPATH=$llvm/build/Debug+Asserts/lib/python2.7/site-packages</code>
-                <p>If you used different configure flags, or have a different version of python,
-                you may need to adjust the above to suit your needs. To test that the lldb python module
-                is built correctly and is available to Python, run:</p>
+                <p>LLDB has a Python scripting capability and supplies its own Python module named <tt>lldb</tt>.
+                If a script is run inside the command line <tt>lldb</tt> application, the Python module
+                is made available automatically.  However, if a script is to be run by a Python interpreter
+                outside the command line application, the <tt>PYTHONPATH</tt> environment variable can be used
+                to let the Python interpreter find the <tt>lldb</tt> module. 
+                <p>The correct path can be obtained by invoking the command line <tt>lldb</tt> tool with the -P flag:</p>
+                <code>> export PYTHONPATH=`$llvm/build/Debug+Asserts/bin/lldb -P`</code>
+                <p>If you used a different build directory or made a release build, you may need to adjust the
+                above to suit your needs. To test that the lldb Python module
+                is built correctly and is available to the default Python interpreter, run:</p>
                 <code>> python -c 'import lldb'</code></p>
                 </div>
               	<div class="postfooter"></div>

Modified: lldb/branches/windows/www/lldb-gdb.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/lldb-gdb.html?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/www/lldb-gdb.html (original)
+++ lldb/branches/windows/www/lldb-gdb.html Tue Jan  8 06:51:53 2013
@@ -98,6 +98,24 @@
                         </td>
                     </tr>
 
+                    <tr><td class="header" colspan="2">Set environment variables for process before launching.</td></tr>
+                        <td class="content">
+                            <b>(gdb)</b> set env DEBUG 1<br>
+                        </td>
+                        <td class="content">
+                            <b>(lldb)</b> settings set target.env-vars DEBUG=1<br>
+                            <b>(lldb)</b> set se target.env-vars DEBUG=1<br>
+                        </td>
+                    </tr>
+
+                    <tr><td class="header" colspan="2">Set environment variables for process and launch process in one command.</td></tr>
+                        <td class="content">
+                        </td>
+                        <td class="content">
+                            <b>(lldb)</b> process launch -v DEBUG=1<br>
+                        </td>
+                    </tr>
+
                     <tr><td class="header" colspan="2">Attach to a process with process ID 123.</td></tr>
                     <tr>
                         <td class="content">
@@ -318,7 +336,7 @@
                             <b>(gdb)</b> rbreak regular-expression<br>
                         </td>
                         <td class="content">
-                            <b>(lldb)</b> breakpoint set --regex regular-expression<br>
+                            <b>(lldb)</b> breakpoint set --func-regex regular-expression<br>
                             <b>(lldb)</b> br s -r regular-expression<br>
                         </td>
                     </tr>

Modified: lldb/branches/windows/www/python-reference.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/python-reference.html?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/www/python-reference.html (original)
+++ lldb/branches/windows/www/python-reference.html Tue Jan  8 06:51:53 2013
@@ -96,10 +96,14 @@
                     <p>This drops you into the embedded python interpreter. When running under the <b>script</b> command, 
                        lldb sets some convenience variables that give you quick access to the currently selected entities that characterize
                        the program and debugger state.  In each case, if there is no currently selected entity of the appropriate
-                       type, the variable's <b>IsValid</b> method will return false.  
+                       type, the variable's <b>IsValid</b> method will return false. 
                     <p>Note also, these variables hold the values
                        of the selected objects on entry to the embedded interpreter.  They do not update as you use the LLDB
-                       API's to change, for example, the currently selected stack frame or thread.</p>
+                       API's to change, for example, the currently selected stack frame or thread.  
+                     <p>As a corollary to this, because they get reset every time the script interpreter is entered, you should not
+                       use these variables in general purpose python code that you write using the lldb module.  After all, lldb can
+                       run in a multithreaded environment, and another thread might call the "script" command, changing the value out
+                       from under you.</p>
                        These are all global variables contained in the <b>lldb</b> python namespace :</p>
                     <table class="stats" width="620" cellspacing="0">
                     <tr>

Modified: lldb/branches/windows/www/sidebar.incl
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/sidebar.incl?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/www/sidebar.incl (original)
+++ lldb/branches/windows/www/sidebar.incl Tue Jan  8 06:51:53 2013
@@ -17,6 +17,7 @@
         <li><a href="tutorial.html">Tutorial</a></li>
         <li><a href="lldb-gdb.html">GDB and LLDB command examples</a></li>
         <li><a href="formats.html">Frame and Thread Formatting</a></li>
+        <li><a href="symbolication.html">Symbolication</a></li>
         <li><a href="varformats.html">Variable Formatting</a></li>
         <li><a href="python-reference.html">Python Reference</a></li>
         <li><a href="scripting.html">Python Example</a></li>

Modified: lldb/branches/windows/www/tutorial.html
URL: http://llvm.org/viewvc/llvm-project/lldb/branches/windows/www/tutorial.html?rev=171849&r1=171848&r2=171849&view=diff
==============================================================================
--- lldb/branches/windows/www/tutorial.html (original)
+++ lldb/branches/windows/www/tutorial.html Tue Jan  8 06:51:53 2013
@@ -136,10 +136,12 @@
                    things like if you specify "<code>--shlib <path></code>", and are completing on "<code>--file <path></code>", we will only
                    list source files in the shared library specified by "<code>--shlib <path></code>".</p>
 
-                   <p>The individual commands are pretty extensively documented, using
-                   the <code>help</code> command.  And there is an <code>apropos</code> command that will
-                   search the help for a particular word and dump a summary help string
-                   for each matching command.</p>
+                   <p>The individual commands are pretty extensively documented.  You can
+                   use the <code>help</code> command to get an overview of which commands are
+                   available or to obtain details about specific commands.  There is also an
+                   <code>apropos</code> command that will search the help text for all commands
+                   for a particular word and dump a summary help string for each matching
+                   command.</p>
 
                    <p>Finally, there is a mechanism to construct aliases for commonly used
                    commands.  So for instance if you get annoyed typing:</p>





More information about the lldb-commits mailing list