crashanalysercmd/Libraries/File Formats/Plugins/CrashXmlPlugin/FileFormat/Segment/Entries/CodeSegs/CXmlSegCodeSegs.cs
changeset 0 818e61de6cd1
equal deleted inserted replaced
-1:000000000000 0:818e61de6cd1
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 * 
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 using System;
       
    18 using System.Text;
       
    19 using System.Collections.Generic;
       
    20 using CrashItemLib.Crash.Base;
       
    21 using CrashItemLib.Crash.Symbols;
       
    22 using CrashItemLib.Crash.Stacks;
       
    23 using CrashItemLib.Crash.Registers;
       
    24 using CrashItemLib.Crash.CodeSegs;
       
    25 
       
    26 namespace CrashXmlPlugin.FileFormat.Segment.Entries.CodeSegs
       
    27 {
       
    28     internal class CXmlSegCodeSegs : CXmlSegBase
       
    29 	{
       
    30 		#region Constructors
       
    31         public CXmlSegCodeSegs()
       
    32             : base( SegConstants.CodeSegs )
       
    33 		{
       
    34 		}
       
    35 		#endregion
       
    36 
       
    37         #region From CXmlSegBase
       
    38         public override int SegmentPriority
       
    39         {
       
    40             get { return 30; }
       
    41         }
       
    42         #endregion
       
    43 
       
    44         #region From CXmlNode
       
    45         protected override void XmlSerializeChildren( CrashXmlPlugin.FileFormat.Document.CXmlDocumentSerializationParameters aParameters )
       
    46         {
       
    47             // Get the code segments
       
    48             CIElementList<CICodeSeg> codeSegs = aParameters.Container.ChildrenByType<CICodeSeg>( CIElement.TChildSearchType.EEntireHierarchy );
       
    49             
       
    50             // Sort them
       
    51             Comparison<CICodeSeg> comparer = delegate( CICodeSeg aLeft, CICodeSeg aRight )
       
    52             {
       
    53                 return string.Compare( aLeft.Name, aRight.Name, true );
       
    54             };
       
    55             codeSegs.Sort( comparer );
       
    56 
       
    57             // List them
       
    58             foreach ( CICodeSeg codeSeg in codeSegs )
       
    59             {
       
    60                 CXmlCodeSeg xmlCodeSeg = new CXmlCodeSeg( codeSeg );
       
    61                 xmlCodeSeg.XmlSerialize( aParameters );
       
    62             }
       
    63         }
       
    64         #endregion
       
    65 
       
    66         #region Properties
       
    67         #endregion
       
    68 
       
    69         #region Data members
       
    70 		#endregion
       
    71 	}
       
    72 }